Basic Prerequisites: 04 · Queue-Reactive Models and Low-Latency Systems Architecture.
1. Intuition & Practical Objective
The queue models are correct and still get desks killed, because the way a desk mis-specifies fills is systematic. This page names the four failures that realise the most money in practice, each in first-principles terms, and shows the number each one costs:
- The standing-queue delusion - booking fills that never happened.
- Latency pick-off - your quote is stale by the time the taker arrives.
- Adverse selection at the fill - the fills you get are the ones you don’t want.
- The cost of refreshing - cancel-and-reinsert is not free; it resets queue position.
The discipline this page installs: never trust a fill assumption you have not expressed as a queue condition and priced for its post-fill drift.
2. Mathematical Ground Truth & Derivations
2.1 Standing-queue delusion (the fill-accounting error)
A naive execution backtest marks a passive order filled whenever a trade prints at its price. The correct condition is cumulative volume exceeding the queue ahead:
Since is often a large fraction of a full day’s volume at the level, the naive rule massively over-attributes fills. The gap is not a small calibration error - it is the difference between a strategy that looks profitable and one that is flat or losing.
2.2 Latency and stale-quote pick-off
You observe the book, decide to cancel, and send the cancel - all with round-trip latency . If the fair price moves against your resting quote within , a fast taker picks you off before your cancel lands: you are filled at a now-stale price. Modelling the pre-cancel move rate ,
The loss is linear in latency for small - which is why colocation and kernel bypass are economic necessities, not vanity.
2.3 Adverse selection: the sign of the conditional drift
Conditioned on a passive fill, the subsequent mid change is negative:
A passive strategy’s true per-fill edge is
so the spread must exceed the adverse-selection drift for the quote to be profitable. Markets where it does not (very liquid, high-rebate venues) are precisely where fast, well-placed queues (or rebates) are required to survive.
2.4 The cost of refreshing
Cancelling to reprice drops you to the back of the new queue. If the surviving queue at the re-joined price is a fraction of the original depth, your new position is
which for any is worse than the you had at the front of the old queue. Each refresh is a queue-position reset; over a day of frequent repricing, the accumulated position loss is a first-order cost that fee/rebate accounting often hides.
3. Computational Implementation - the four failures in numbers
Stdlib only. Each block quantifies one failure.
Read across: the naive backtest books a fill every time a trade prints () while the true FIFO fill rate is - a inflation of fills that are simply not yours. Latency converts into a near-linear pick-off tax on every fill. Refreshing always lands you behind a nonzero queue. And the adverse-selection block shows the sign: filled orders average $0.0119 against the mid while unfilled orders average + $0.0166 - the fills you got were the ones the market was about to punish.
4. Failure Modes & First-Principles Breakdowns (numbered)
- Fill-accounting error (the standing-queue delusion). Treating “trade printed at my price” as “I filled” violates the FIFO fill condition . Measured here: vs . Every downstream P&L number is then fictitious. Fix: model cumulative outflow against queue position.
- Latency pick-off. Stale quotes get filled by faster takers at the wrong moment; loss grows near-linearly at low latency then saturates ($0.025\to$0.9930.05\to10P\approx1-e^{-\rho\ell}$). Fix: cancel-ahead / quote-fade logic and genuine latency reduction (Low-Latency Systems Architecture).
- Adverse selection. : passive fills are negatively selected. Ignoring it overstates edge by the whole adverse-selection drift. Fix: price the conditional drift into the quote (rebate-adjusted effective spread), as Cont–Kukanov do with effective rebates .
- Refresh cost / queue-position risk. Cancel-and-reinsert resets you to the back of the new queue; each refresh is a position loss. Frequent repricing that “optimises price” can destroy fill quality. Fix: account for the expected position resets in the reprice decision.
- Phantom-liquidity cascades. When an aggressive sweep arrives, front-of-book cancels vanish simultaneously - the queue ahead of you disappears, and you are suddenly exposed exactly as the price moves. This is adverse selection amplified by correlated cancellations (Gould et al. document the cancel-to-trade ratio that makes this the norm).
5. References
- Cont & Kukanov (2017)
- Gould et al. (2013)
- Foucault, Pagano & Roell, Market Liquidity
- Hasbrouck, Empirical Market Microstructure
- Gatheral, J. - “No-dynamic-arbitrage and market impact,” Quantitative Finance 10(7) (2010)
6. Connected Graph Bridges
- Back: 04 · Queue-Reactive Models · Index Hub
- Forward: 06 · Advanced Extensions
- Practice: Low-Latency Systems Architecture · Hardware Acceleration & FPGA
- Economics: Adverse Selection & Glosten–Milgrom · Avellaneda–Stoikov & Optimal Quoting