API & Developers

API Orderbook Reconstruction Guide for Historical Snapshots

Reconstruct historical order books from snapshot data to replay Polymarket markets and compare them with Binance spot and futures depth.

Orderbook reconstruction means rebuilding the visible bid and ask ladder at historical moments. Snapshot-based reconstruction is straightforward because each snapshot is a complete point-in-time state.

Snapshot Reconstruction Workflow

  1. Fetch snapshots for the market and time range.
  2. Sort by timestamp.
  3. Normalize price and size fields.
  4. Store bid and ask levels in a consistent structure.
  5. Replay each snapshot into spread, depth, and fill simulation logic.

Snapshots vs Deltas

Delta streams require perfect sequencing and recovery logic. Historical snapshots are heavier, but easier to replay and audit because each snapshot can stand alone.

Related Resources