aifinhub

Methodology · Playground · Last updated 2026-04-20

How Order Book Replay works

How the Order Book Replay Visualizer tool actually works — assumptions, algorithms, limitations.

Input format

Wide CSV. One row per L2 snapshot timestamp. Expected columns:

timestamp,bid_px1,bid_sz1,bid_px2,bid_sz2,...,ask_px1,ask_sz1,ask_px2,ask_sz2,...

Up to 20 levels per side are parsed. Missing or zero-size levels are skipped. The timestamp column may be timestamp, time, or ts, and may contain either unix epoch (seconds or milliseconds, auto-detected) or ISO-8601 strings.

Rendering model

  • Bids below the mid, asks above. Bar length ∝ size at that price level.
  • Dashed line is the mid price (best_bid + best_ask) / 2.
  • Spread shown absolute and in basis points: spread / mid × 10000.
  • Best bid / best ask prices are the first entries of the sorted level arrays (bids descending, asks ascending).

Privacy

Parsing and animation run entirely in the browser. Files never leave your device. The tool sets no cookies and makes no network calls after the initial page load.

Limitations

  1. Snapshot-only. The tool replays discrete snapshots, not an event-level message feed (add/modify/cancel). Inter-snapshot microstructure is invisible.
  2. Fixed-level CSV. Variable-depth per-row (e.g. different L2 depth every tick) is accepted but the rendering assumes each snapshot's declared levels are complete.
  3. No trade overlays. Prints / trades are not drawn on top of the book (future enhancement).
  4. Single venue. No consolidated-tape view; one CSV = one venue's book.
  5. Timestamp interpretation. Ambiguous numeric timestamps are assumed millis if > 1e12, else seconds. Feed producers should emit ISO-8601 for unambiguous times.
Planning estimates only — not financial, tax, or investment advice.