Update Polymarket documentation (2026-02-19)

- Added new documentation URLs from llms.txt index
- Updated TARGET.md with 244 total documentation pages
- Scraped new pages for trading, concepts, and API reference sections
- Updated changelog and new index pages
This commit is contained in:
AI Agent
2026-02-19 14:31:02 +01:00
parent 81f77eff3c
commit b2a29fe51f
250 changed files with 33306 additions and 9659 deletions
+87 -7
View File
@@ -2,16 +2,96 @@
> Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt
> Use this file to discover all available pages before exploring further.
# null
# Subgraph
## Subgraph Overview
> Query onchain Polymarket data using GraphQL
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.
Polymarket's subgraphs provide indexed onchain data via GraphQL. Use them to query positions, volume, liquidity data, orders, activity, and market data.
## Source
## Available Subgraphs
The Polymarket subgraph is entirely open source and can be found on the Polymarket Github.
| Subgraph | Description | Endpoint |
| ----------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Positions** | User token balances | [GraphQL Playground](https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/positions-subgraph/0.0.7/gn) |
| **Orders** | Order book and trade events | [GraphQL Playground](https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/orderbook-subgraph/0.0.1/gn) |
| **Activity** | Splits, merges, redemptions | [GraphQL Playground](https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/activity-subgraph/0.0.4/gn) |
| **Open Interest** | Market and global OI | [GraphQL Playground](https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/oi-subgraph/0.0.6/gn) |
| **PNL** | User position P\&L | [GraphQL Playground](https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/pnl-subgraph/0.0.14/gn) |
**[Subgraph Github Repository](https://github.com/Polymarket/polymarket-subgraph)**
<Note>
Subgraphs are hosted by [Goldsky](https://goldsky.com). Each endpoint includes
an interactive GraphQL playground for exploring the schema.
</Note>
> Note: The available models/schemas can be found in the `schema.graphql` file.
## Querying
Send GraphQL queries via POST request to any subgraph endpoint.
```bash theme={null}
curl -X POST \
https://api.goldsky.com/api/public/project_cl6mb8i9h0003e201j6li0diw/subgraphs/orderbook-subgraph/0.0.1/gn \
-H "Content-Type: application/json" \
-d '{
"query": "query MyQuery { orderbooks { id tradesQuantity } }"
}'
```
## Schema Reference
### Positions
| Query | Description |
| ---------------------------------------- | ------------------------------ |
| `userBalance` / `userBalances` | User token balances |
| `netUserBalance` / `netUserBalances` | Aggregated net balances |
| `tokenIdCondition` / `tokenIdConditions` | Token ID to condition mappings |
| `condition` / `conditions` | Market conditions |
### Orders
| Query | Description |
| ---------------------------------------------- | ----------------------- |
| `marketData` / `marketDatas` | Market-level data |
| `orderFilledEvent` / `orderFilledEvents` | Order fill events |
| `ordersMatchedEvent` / `ordersMatchedEvents` | Order match events |
| `orderbook` / `orderbooks` | Orderbook state |
| `ordersMatchedGlobal` / `ordersMatchedGlobals` | Global match statistics |
### Activity
| Query | Description |
| ------------------------------------------------------ | -------------------- |
| `split` / `splits` | USDC to token splits |
| `merge` / `merges` | Token to USDC merges |
| `redemption` / `redemptions` | Position redemptions |
| `negRiskConversion` / `negRiskConversions` | Neg risk conversions |
| `negRiskEvent` / `negRiskEvents` | Neg risk event data |
| `fixedProductMarketMaker` / `fixedProductMarketMakers` | FPMM data |
| `position` / `positions` | Position records |
| `condition` / `conditions` | Market conditions |
### Open Interest
| Query | Description |
| -------------------------------------------- | ------------------------ |
| `condition` / `conditions` | Market conditions |
| `negRiskEvent` / `negRiskEvents` | Neg risk event data |
| `marketOpenInterest` / `marketOpenInterests` | Per-market open interest |
| `globalOpenInterest` / `globalOpenInterests` | Global open interest |
### PNL
| Query | Description |
| -------------------------------- | ------------------------------- |
| `userPosition` / `userPositions` | User position P\&L data |
| `negRiskEvent` / `negRiskEvents` | Neg risk event data |
| `condition` / `conditions` | Market conditions |
| `fpmm` / `fpmms` | Fixed product market maker data |
## Source Code
The subgraph is open source. Review the schema and mappings on GitHub:
<Card title="polymarket-subgraph" icon="github" href="https://github.com/Polymarket/polymarket-subgraph">
View source code, schema definitions, and deployment configuration.
</Card>