MARKET MICROSTRUCTURE · L3 PRICE-TIME FIFO · MARKOUT ATTRIBUTION

Why Touch = Fill Fails: Order-Book Queue Position & Cancel-Latency Backtesting

In a Price-Time (FIFO) Central Limit Order Book, a passive limit order placed at price tick p with resting venue volume Q_ahead ahead of it only begins filling after cumulative aggressive contra-side volume at or through p exceeds Q_ahead. Backtesters that fill whenever low ≤ bid_price implicitly set Q_ahead = 0 — systematically selecting every profitable mean-reverting touch that you would never have filled in production, while still filling 100% of informed sweeps that blow straight through the entire level.

1. Incremental L2-to-L3 FIFO Queue Preservation

When Fera Terra ingests live or recorded L2 snapshots into its C++23 L3OrderBook:

  • Existing venue depth at price p retains its earlier monotonic sequence_num ahead of newly submitted bot quotes.
  • Subsequent venue size increases at p append behind resting bot orders so new market makers do not jump your queue priority.
  • Aggressive trade sweeps consume front-of-queue liquidity first, aging your exact remaining queue_ahead_lots tick by tick.

2. Cancellation Latency & Toxic Pick-Off Markouts

When fair value jumps and your bot issues a cancel at timestamp t_0, that order remains live and matchable on the venue book until t_0 + Δt_cancel (typically 60–220 ms over cloud RPC/REST). Fera Terra holds canceled quotes open inside the C++23 engine across your configured latency window and computes 1-second and 5-second post-fill markouts (M_1s, M_5s in bps) to isolate toxic cancel-lag snipes from healthy spread capture:

pip install feraterra
feraterra benchmark \
  --pack flash_crash_5sigma \
  --bot examples/feraterra_sample_mm_bot.py \
  --cancel-latency-ms 150 \
  --html-out markout_audit.html
Try Live C++23 Sandbox View Plans ($0 Hobby / $49 Indie / $129 Pro) All Engineering Guides

Related Microstructure Guides