Package Logo
polymarket-ctf
polymarket-ctf@v0.3.0
Total Downloads
11
Published
4 hours ago
Network
polygon polygon
Publisher
User Avatar colindickson

Readme

Polymarket CTF Substreams Package

Substreams package for extracting events from the Polymarket Conditional Tokens Framework (CTF) contract on Polygon.

Contract Information

  • Address: 0x4D97DCd97eC945f40cF65F87097ACe5EA0476045
  • Network: Polygon
  • Explorer: View on Polygonscan

Available Modules

Module Description Output Type
map_ctf_events Extracts CTF-specific events proto:ctf.v1.CtfEvents
map_erc1155_events Extracts ERC-1155 token events proto:ctf.v1.Erc1155Events
map_all_events Extracts all CTF and ERC-1155 events proto:ctf.v1.AllEvents

Quick Start

Build the WASM binary:

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

Create the Substreams package:

make package-ctf
# or
cd polymarket-ctf && substreams pack

Run the Substreams:

make run-ctf
# or
substreams run substreams.yaml map_all_events \
  --network polygon \
  --start-block -1000

Event Types

The package extracts the following event categories:

CTF Events

  • ConditionPreparation - New prediction market condition prepared
  • ConditionResolution - Condition resolved with payout numerators
  • PositionSplit - Collateral split into conditional positions
  • PositionsMerge - Conditional positions merged back to collateral
  • PayoutRedemption - Winning positions redeemed for collateral

ERC-1155 Events

  • TransferBatch - Batch transfer of tokens
  • TransferSingle - Single token transfer
  • ApprovalForAll - Approval for all operator

Dependencies

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

Binary Output

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

Documentation

Modules

Maps icon
Maps

map
map_ctf_events

bcf1cc448d63063098eaf7c96920594902fbfffe
map map_ctf_events (
blocksf.ethereum.type.v2.Block
)  -> polymarket.ctf.v1.CtfEvents
substreams gui polymarket-ctf@v0.3.0 map_ctf_events

map
map_erc1155_events

de5d3ebdf032533038c0048138975fb7e4f241f7
substreams gui polymarket-ctf@v0.3.0 map_erc1155_events

map
map_all_events

2f297ec92060e834ecf34bc7bd5afab1757c6992
substreams gui polymarket-ctf@v0.3.0 map_all_events
Protobuf

Protobuf Docs Explorer

sf.ethereum.transform.v1
sf.ethereum.type.v2
polymarket.ctf.v1
sf.ethereum.substreams.v1