Overview
Subgraph Overview
Polymarket has written and open sourced a subgraph that provides, via a GraphQL query interface, useful aggregate calculations and event indexing for things like volume, user position, market and liquidity data. The subgraph updates in real time to be able to be mixed, and match core data from the primary Polymarket interface, providing positional data, activity history and more. The subgraph can be hosted by anyone but is also hosted and made publicly available by a 3rd party provider, Goldsky.
Source
The Polymarket subgraph is entirely open source and can be found on the Polymarket Github.
Polymarket.polymarket-subgraph
Note: The available models/schemas can be found in the
schema.graphql
file.
Hosted Version
The subgraphs are hosted on goldsky, each with an accompanying GraphQL playground:
-
Orders subgraph: https://api.goldsky.com/api/public/project_clm8ibh0b003e2016di0w/subgraphs/orderbook-subgraph-prod/1.0.0/gn
-
Positions subgraph: https://api.goldsky.com/api/public/project_clm8ibh0b003e2016di0w/subgraphs/positions-subgraph-prod/1.0.0/gn
-
Activity subgraph: https://api.goldsky.com/api/public/project_clm8ibh0b003e2016di0w/subgraphs/activity-subgraph-prod/1.0.0/gn
-
Open Interest subgraph: https://api.goldsky.com/api/public/project_clm8ibh0b003e2016di0w/subgraphs/oi-subgraph-prod/1.0.0/gn
-
PNL subgraph: https://api.goldsky.com/api/public/project_clm8ibh0b003e2016di0w/subgraphs/pnl-subgraph-prod/0.1.0/gn