Skip to main content
Returns the L2 orderbook as it was at any historical timestamp ts (microseconds since epoch). Reconstruction is exact — every order is replayed from the indexed event stream, not sampled from polled snapshots. Same response shape as the live /book endpoint, plus a history_starts anchor and an as_of timestamp.

Endpoint

:ts is a microsecond UNIX timestamp. ISO-string conversion: epoch_us = unix_seconds * 1_000_000.

Query parameters

Response

How it works

Every snapshot is a deterministic replay of the indexed event stream up to :ts. There is no sampling, no polling, no smoothing — if a fill happened one microsecond before your timestamp, the size is reflected; one microsecond after and it isn’t.

Use cases

  • Pre-trade replay — feed :ts = trade_time - 1µs to see exactly what book the trader saw before placing.
  • Slippage backtests — for any historical fill, compute realized vs theoretical at-time-of-decision.
  • Liquidity migration analysis — chart top-of-book depth over time without polling.
  • Forensics — investigate manipulation by reconstructing books around suspicious fills.

Examples

Notes

  • Cost: ~50–200ms per request depending on :ts and outcome activity. Costs grow with order activity in the window, not with how far back :ts is.
  • :ts in the future returns 400. :ts before history_starts returns an empty book with a warning. Both are intentional — no silent zeros.
  • resting_orders_count is the truth check — when reconstructing AT NOW, it matches the live book exactly (verified byte-for-byte against /v1/markets/:id/book).
  • For high-frequency replay across many timestamps, prefer one large query window via /v1/markets/:id/depth-history (coming soon) over many calls here.
  • This endpoint is rate-limited on your tier’s per-minute quota like all /v1/* routes — heavy backtests should respect the limit.