Skip to main content
For any window [from, to] and bucket size step, returns one orderbook snapshot per bucket: top-of-book bid/ask, mid, spread, total resting orders, total maker count, and depth aggregated across the top-N levels per side. Each snapshot is built by the same engine as /v1/markets/:id/book/at/:ts — verified byte-for-byte against that endpoint.

Endpoint

Query parameters

If both from and limit are omitted, you get the last limit × step worth of buckets ending at now — sane default for a “show me depth over the last hour” call.

Response

Use cases

  • Spread / liquidity charts — render line charts of mid, spread, bids_top_size over a chosen window.
  • Volatility surveys — large spread values flag illiquid regimes; small spreads + thick top-of-book = healthy market.
  • Pre-resolution liquidity profiling — call this with step=1m against the final hour before settlement to see how liquidity behaves as expiry approaches.
  • Cross-market comparison — bulk-call across multiple outcome_ids to compare which is most liquid.

Examples

Performance

  • Each snapshot triggers one read query per requested side. Queries fan out at concurrency 8 against a 32-slot pool, so a single depth-history call cannot starve other API traffic.
  • 12 points (1h × 5m): ~1–2s typical
  • 60 points (1h × 1m): ~5s typical
  • 240 points (4h × 1m): ~25s typical
  • 500 points (cap): ~60s
For tight latency budgets, use larger step values. For exact instantaneous quotes use /v1/markets/:id/book (live, edge-cached 1s).

Errors

Notes

  • Snapshot at the exact returned t is reproducible by calling /v1/markets/:id/book/at/:t — same numbers.
  • Empty book (e.g. t < history_starts) returns null for best_bid/best_ask/mid/spread and zeros for size/count fields.
  • points_returned may be less than points_requested only when the window doesn’t fit limit buckets.