Package Logo
polymarket-exchange
polymarket-exchange@v0.2.3
Total Downloads
20
Published
1 weeks ago
Network
polygon polygon
Publisher
User Avatar colindickson

Readme

Polymarket Exchange Substreams Package

Substreams package for extracting events from the Polymarket CTF Exchange contract on Polygon.

Contract Information

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

Available Modules

Module Description Output Type
map_exchange_events Extracts exchange trading events proto:exchange.v1.ExchangeEvents
map_registry_events Extracts token registry events proto:exchange.v1.RegistryEvents
map_fee_events Extracts fee-related events proto:exchange.v1.FeeEvents
map_all_events Extracts all exchange events proto:exchange.v1.AllEvents

Quick Start

Build the WASM binary:

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

Create the Substreams package:

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

Run the Substreams:

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

Event Types

The package extracts the following event categories:

Exchange Events

  • OrderFilled - Order executed
  • OrderCancelled - Order cancelled
  • OrdersMatched - Orders matched

Registry Events

  • TokenRegistered - New token pair registered

Fee Events

  • FeeCharged - Trading fee charged

Dependencies

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

Binary Output

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

Documentation

Modules

Maps icon
Maps

map
map_exchange_events

e72562e1294a44f7c2ce62b4d47992a03da39690
map map_exchange_events (
blocksf.ethereum.type.v2.Block
)  -> polymarket.exchange.v1.ExchangeEvents
substreams gui polymarket-exchange@v0.2.3 map_exchange_events

map
map_fee_events

a1aeddce7a9b5b43a1a8e578b5175f44191c1dd6
substreams gui polymarket-exchange@v0.2.3 map_fee_events

map
map_admin_events

664b70bb5642cfb8112a59544c2ffc2ecf6e4497
substreams gui polymarket-exchange@v0.2.3 map_admin_events

map
map_pause_events

8b4f98769eef312f922d7b9ac52e942dcde0a841
substreams gui polymarket-exchange@v0.2.3 map_pause_events

map
map_approval_events

69321b246ea120bcc1eb8f59cf3dd3c6a7c3961c
substreams gui polymarket-exchange@v0.2.3 map_approval_events

map
map_all_events

130546237b303946bdef173be669a9fe69ce8b3f
substreams gui polymarket-exchange@v0.2.3 map_all_events
Protobuf

Protobuf Docs Explorer

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