Skip to content
Projects / Phase 4.3 · JD to Projects

Queue-Position and Latency-Aware Order-Book Simulator (C++)

Which passive-fill model and latency assumption should the research simulator certify for Coinbase BTC-USD, and which upstream claims (MM, EX, OB, OM) survive it?

Headline result

A C++ order-level book engine that scores 14 passive-fill models against exact queue position on 1.87 million virtual orders. The queue-back model had the lowest error (bias −0.08 pp, no false fills); the touch rule overstated fills by 7.5 pp and showed a joining maker losing USD 72 a session instead of USD 113.

Figures

  • BTC ahead of a virtual bid over 30 seconds: whole L2 level, L3 truth and three queue models.
    The queue-back fill model tracks exact (L3) queue position, while the proportional rule credits cancellations and moves the order forward too early.
  • True probability of a first fill within 60 s for a best-level order, by latency from 0 to 1,000 ms.
    Latency costs little below 100 ms; at 1 s the fill probability drops from 86.1% to 82.7%, and 4.0 pp in the busiest quarter.
  • Fill-conditional mark-out at 1, 10 and 60 seconds after a passive fill, truth against four fill models.
    A real passive fill is followed by a 0.6 bp adverse move within 10 s; the touch rule makes fills look 22% less toxic.
  • Joining market maker’s P&L error split into fill rate, timing, adverse selection and inventory, touch rule against the queue-back model.
    The touch rule’s large errors partly cancel to USD 41 per session; the queue-back model is off by only USD 3.2.

Data used

  • Coinbase BTC-USD order-level feed via Tardis.dev: 24 six-hour sessions, 265m events, Jan 2021 to Sep 2026
  • Coinbase BTC-USD L2 books via Tardis.dev as an independent check: 69 first-of-month sessions, Jan 2021 to Sep 2026

Built from HFT Quant Developer job descriptions

The role asks for

  • Low-latency C++ engineering
  • Market microstructure knowledge
  • Exchange simulation and backtesting
  • Fill and execution modelling
  • Python and statistics
  • Owning production research tools

This project uses

  • Order-level (L3) book engine in C++
  • Exact queue-position reconstruction
  • Scoring 14 fill models against truth
  • Latency and mark-out analysis
  • Market-maker P&L error decomposition
  • Deterministic, allocation-free hot path

Members open the full write-up, notebook, tested code and data in the project reader.