Polymarket / polymarket-subgraph

Polymarket's public subgraph manifest for indexing on-chain trade, volume, user, liquidity and market data.
GNU Lesser General Public License v3.0
33 stars 9 forks source link

NegRisk Support #38

Closed mshrieve closed 8 months ago

mshrieve commented 9 months ago

Utils

getPositionId.ts Implementation of getPositionId to avoid calling on-chain.

Entities

NegRiskConversion Represents a conversion transaction on the Neg Risk Adapter.

NegRiskEvent Tracks known neg risk events and their question counts.

Mappings

NegRiskAdapterMapping.ts A new mapping watching the NegRiskAdapter's events: PositionSplit, PositionsMerged, PositionsConverted, MarketPrepared, QuestionPrepared, PayoutRedemption. Handles all NegRisk Splits, Merges, and Redemptions.

ConditionalTokensMapping.ts Add clauses to Split, Merge, and Redemption handling to skip if the caller is the NegRiskAdapter. These events will be tracked separately by the NegRiskAdapter mapping.

ExchangeMapping.ts Create MarketData at TokenRegistered, using getPositionId.