All packages

polymarket-neg-risk-adapter
colindickson
Package ref
polymarket-neg-risk-adapter@v0.12.0Run package
CLI
Run map_market_events from the command line.
substreams run polymarket-neg-risk-adapter@v0.12.0 map_market_events -e polygon --start-block -1Authenticate by running
substreams auth or directly on thegraph.market (see docs).README
Polymarket Neg Risk Adapter Substreams Package
Substreams package for extracting events from the Polymarket NegRiskAdapter contract on Polygon.
Contract Information
- Address:
0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296 - Network: Polygon
- Initial Block: 50505403
- Explorer: View on Polygonscan
Available Modules
| Module | Description | Output Type |
|---|---|---|
map_market_events | Extracts market/question lifecycle events | proto:polymarket.neg_risk_adapter.v1.MarketEvents |
map_trading_events | Extracts position and redemption events | proto:polymarket.neg_risk_adapter.v1.TradingEvents |
map_admin_events | Extracts admin role events | proto:polymarket.neg_risk_adapter.v1.AdminEvents |
map_all_events | Extracts all NegRiskAdapter events | proto:polymarket.neg_risk_adapter.v1.AllEvents |
Quick Start
Build the WASM binary:
make build-neg-risk-adapter
# or
cd polymarket-neg-risk-adapter && substreams build
Create the Substreams package:
cd polymarket-neg-risk-adapter && substreams pack
Run the Substreams:
substreams run substreams.yaml map_all_events \
--network polygon \
--start-block 50505403 \
--stop-block +10000
Event Types
The package extracts the following event categories:
Market Events
MarketPrepared- New neg-risk market preparedQuestionPrepared- Question added to a marketOutcomeReported- Outcome reported for a question
Trading Events
PositionSplit- Collateral split into conditional positionsPositionsMerge- Conditional positions merged back to collateralPositionsConverted- Neg-risk positions converted across outcomesPayoutRedemption- Winning positions redeemed for collateral
Admin Events
NewAdmin- New admin addedRemovedAdmin- Admin removed
Dependencies
substreams: ^0.7substreams-ethereum: ^0.11ethabi: ^18
Binary Output
Build artifacts: target/wasm32-unknown-unknown/release/polymarket_neg_risk_adapter.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
