All packages

polymarket-neg-risk-ctf
colindickson
Package ref
polymarket-neg-risk-ctf@v0.12.0Run package
CLI
Run map_trading_events from the command line.
substreams run polymarket-neg-risk-ctf@v0.12.0 map_trading_events -e polygon --start-block -1Authenticate by running
substreams auth or directly on thegraph.market (see docs).README
Polymarket Negative Risk CTF Substreams Package
Substreams package for extracting events from the Polymarket Negative Risk Conditional Tokens Framework contract on Polygon.
Contract Information
- Address:
0xe2222d279d744050d28e00520010520000310F59 - Network: Polygon
- Explorer: View on Polygonscan
Available Modules
| Module | Description | Output Type |
|---|---|---|
map_trading_events | Extracts trading events | proto:polymarket.neg_risk_ctf.v1.TradingEvents |
map_fee_events | Extracts fee-related events | proto:polymarket.neg_risk_ctf.v1.FeeEvents |
map_admin_events | Extracts admin role events | proto:polymarket.neg_risk_ctf.v1.AdminEvents |
map_pause_events | Extracts user pause events | proto:polymarket.neg_risk_ctf.v1.PauseEvents |
map_approval_events | Extracts order approval events | proto:polymarket.neg_risk_ctf.v1.OrderApprovalEvents |
map_all_events | Extracts all negative risk CTF events | proto:polymarket.neg_risk_ctf.v1.AllEvents |
Quick Start
Build the WASM binary:
make build-neg-risk-ctf
# or
cd polymarket-neg-risk-ctf && substreams build
Create the Substreams package:
cd polymarket-neg-risk-ctf && substreams pack
Run the Substreams:
substreams run substreams.yaml map_all_events \
--network polygon \
--start-block -1000
Event Types
The package extracts the following V2 event categories:
Trading Events
OrderFilled- Order filled (withsideuint8,token_id,builder,metadata)OrdersMatched- Orders matched (withsideuint8,token_id)
Fee Events
FeeCharged- Protocol fee collected (recipient,amount)FeeReceiverUpdated- Fee receiver address changedMaxFeeRateUpdated- Maximum fee rate changed
Admin Events
NewAdmin- New admin addedNewOperator- New operator addedRemovedAdmin- Admin removedRemovedOperator- Operator removed
Pause Events
UserPaused- User paused from tradingUserUnpaused- User unpausedUserPauseBlockIntervalUpdated- Pause interval changed
Order Approval Events
OrderPreapproved- Order preapprovedOrderPreapprovalInvalidated- Order preapproval invalidated
Dependencies
substreams: ^0.7substreams-ethereum: ^0.11ethabi: ^18
Binary Output
Build artifacts: target/wasm32-unknown-unknown/release/polymarket_neg_risk_ctf.wasm
Modules
Execution graph
Show 2 dependencies
Output
sf.substreams.ethereum.v1.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
Inputs
