Package Logo
polymarket-ctf
polymarket-ctf@v0.1.0
Total Downloads
1
Published
20 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

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

map
map_erc1155_events

66a6364c102cbf9f1c7365dc41d608ff00aaf6f4
substreams gui polymarket-ctf@v0.1.0 map_erc1155_events

map
map_all_events

16b8d17630b5f3905d7903c8df95312a9b5d989f
substreams gui polymarket-ctf@v0.1.0 map_all_events
Protobuf

Protobuf Docs Explorer

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