sgd9.orderbook → v2.orderbook). Returns lifetime counters maintained by the subgraph itself rather than re-aggregated from individual fills — a separate, cheaper path than /clobv2/markets/{token_id}/volume, which does the GROUP BY on fills.
v2-exclusive: the subgraph maintains this rollup only for v2 markets.
Request
Authentication
Paid tier required. See/clobv2/trades for auth formats.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token_id | string | Yes | Outcome token ID (uint256 as decimal string). |
Parameter validation
token_id: 1-78 digits,^[0-9]+$.
Response
When the token has a v2 orderbook row (found):Response fields
| Field | Type | Description |
|---|---|---|
token_id | string | Echoes the path parameter. |
source | string | Always "onchain-v2". |
found | boolean | true if the subgraph has a rollup row for this token; false otherwise (all other fields absent). |
trades | string (numeric) | Total fills counted by the subgraph. |
buys / sells | string (numeric) | Buy and sell counters. |
notional_usdc | string (numeric) | Total USDC that changed hands (buy + sell). |
buy_usdc / sell_usdc | string (numeric) | USDC split by side. |
scaled_notional_usdc | string (numeric) | The subgraph also emits a scaled variant — this is the raw on-chain amount divided by an extra 1e6. Prefer notional_usdc for dollar-denominated analytics. |
question / slug / event_title / outcome / image / condition_id | string | null | Enriched from the metadata layer. |
BigInt type.
Examples
Error responses
| Status | Body | When |
|---|---|---|
400 | {"error": "invalid token_id ..."} | Path param isn’t a positive integer string. |
401 | {"error": "missing API key ..."} | No key or bad key. |
402 | {"error": "paid plan required ..."} | Free tier. |
429 | {"error": "rate limit exceeded", "reset_at": <unix>} | Rate limit hit. |
5xx | {"error": "temporary_data_provider_error"} | Temporary data provider issue. Retry with backoff. |
Notes
- Values may be slightly behind the per-fill aggregation at
/clobv2/markets/{token_id}/volumebecause the subgraph has a small processing lag after a new fill; for most tokens they reconcile within a second or two. scaled_notional_usdcis the subgraph’s own parallel counter and is divided by an extra 1e6 compared tonotional_usdc. It’s present for feature parity with the raw subgraph; most integrators should ignore it.found: falseis a valid response (not a 404). It means the v2 subgraph hasn’t observed any fills touching this token yet.

