All packages

polymarket-resolution

colindickson
v0.12.0/2 downloads/Repository

Package ref

polymarket-resolution@v0.12.0

Run package

CLI

Run map_oracle_events from the command line.

substreams run polymarket-resolution@v0.12.0 map_oracle_events -e polygon --start-block -1
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

Polymarket Resolution Substreams Package

Substreams package for the full Polymarket resolution pipeline — UMA Optimistic Oracle disputes plus the UMA CTF Adapter question lifecycle — on Polygon.

Contract Information

  • Network: Polygon
  • Initial Block: 29786052
ContractAddress
UMA Oracle V20xee3afe347D5C74317041E2618C49534dAf887c24
UMA Oracle V30x5953f2538F613E05bAED8A5AeFa8e6622467AD3D
CTF Adapter V20x6A9D222616C90FcA5754cd1333cFD9b7fb6a4F74
CTF Adapter V30x2f5e3684cb1F318eC51b00eDba38D79ac2c0aA9D

Available Modules

ModuleDescriptionOutput Type
map_oracle_eventsExtracts UMA Oracle proposals, disputes, settlements (V2 + V3)proto:polymarket.resolution.v1.OracleEvents
map_adapter_eventsExtracts CTF Adapter question lifecycle events (V2 + V3)proto:polymarket.resolution.v1.AdapterEvents
map_dispute_alertsExtracts a unified alert stream (disputes, emergency resolutions, flags, pauses, resets)proto:polymarket.resolution.v1.DisputeAlerts
map_resolution_eventsExtracts the full combined resolution pipelineproto:polymarket.resolution.v1.ResolutionEvents

Quick Start

Build the WASM binary:

make build-resolution
# or
cd polymarket-resolution && substreams build

Create the Substreams package:

cd polymarket-resolution && substreams pack

Run the Substreams:

substreams run substreams.yaml map_resolution_events \
  --network polygon \
  --start-block 29786052 \
  --stop-block +10000

Event Types

The package extracts the following event categories:

Oracle Events (UMA Optimistic Oracle V2 + V3, unified)

  • ResolutionProposal - A price/assertion was proposed (V2 ProposePrice, V3 AssertionMade)
  • ResolutionDispute - A proposal was disputed (V2 DisputePrice, V3 AssertionDisputed)
  • ResolutionSettlement - A proposal was settled (V2 Settle, V3 AssertionSettled)

Adapter Events (UMA CTF Adapter V2 + V3)

  • QuestionInitialized - Question registered with the adapter
  • QuestionResolved - Question resolved with payouts
  • QuestionEmergencyResolved - Question emergency-resolved
  • QuestionFlagged / QuestionUnflagged - Question flagged / unflagged
  • QuestionPaused / QuestionUnpaused - Question paused / unpaused
  • QuestionReset - Question reset for re-resolution
  • AncillaryDataUpdated - Question ancillary data updated
  • Admin changes - NewAdmin / RemovedAdmin

Dispute Alerts

  • DisputeAlert - Unified alert emitted for disputes, emergency resolutions, flags, pauses, and resets across both oracle and adapter contracts

Dependencies

  • substreams: ^0.7
  • substreams-ethereum: ^0.11
  • ethabi: ^18

Binary Output

Build artifacts: target/wasm32-unknown-unknown/release/polymarket_resolution.wasm

Modules

Execution graph

6 modules
Show 2 dependencies
map

eth_common:all_events

`all_events` gives you all the events in a block (from successful transactions), with basic block hash/number/timestamp and transaction hash

Output

sf.substreams.ethereum.v1.Events

blockIndex

eth_common:index_events

`index_events` sets the following keys on the block: * Event signatures evt_sig:0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef (signature in hex, prefixed by 0x) * Event address evt_addr:0x0123456789abcdef0123456789abcdef01234567 (address in hex, prefixed by 0x)

Output

sf.substreams.index.v1.Keys