Basic Prerequisites: 02 - Order Types and 03 - Exchanges & Venues.


1. Intuition & Practical Objective

Every mechanism on the previous pages has a way to fail, and the failures are not exotic - they are what a production trading system actually spends its engineering effort defending against. This page makes three of them quantitative, each tied to a first principle:

  1. Order-type misuse - the same order size is cheap or ruinous depending on the type: a market order walks the book (convex slippage), an FOK is rejected under partial liquidity, an iceberg reload forfeits queue priority.
  2. Hidden liquidity - concealed size does not disappear; it changes the fill probability. Icebergs reload behind newer orders, and dark/midpoint orders have low hit-rates and adverse selection.
  3. Latency as a cost - a resting quote is a free option written to anyone faster; the expected pick-off loss grows like in the latency .

The practical objective: attach a dollar number to each failure, then state the defense. Every number below is re-executed and reproduced.

The one-sentence essence. “The three structural ways an order fails are: you sent the wrong type (paying convex slippage or getting rejected), your hidden size ranked behind the visible queue, or the world moved before your packet arrived.”


2. Mathematical Ground Truth & Derivations

Order-type misuse: convex slippage. From page 02, the market-order average price is convex and piecewise-linear in ; the marginal cost per share rises at each level boundary. The slippage is

So doubling the size more than doubles the slippage once the best level is exhausted - size and type must be co-chosen.

Iceberg queue priority. In a FIFO book, queue position is assigned by arrival time. When an iceberg’s visible tip empties, the engine reloads the next tranche - and the reload is a new arrival, appended behind everything already queued. If a competitor order arrived after the iceberg’s original placement, then after the first reload the order becomes

so the iceberg now ranks behind . Its hidden size is therefore far less likely to fill than if it had shown all of it at the start.

Latency pick-off. Suppose a quote’s reference price diffuses with per-millisecond scale and the quoter needs ms to refresh. Between the price move and the refresh, a fast trader lifts the stale side; the expected adverse move over is

so the expected pick-off loss on resting shares is - sublinear in latency (a 100× latency cut buys ~10× less loss), which is why the arms race has diminishing returns but never stops.

Hidden liquidity as fill probability. The probability a midpoint/dark order fills, , is low (no displayed counterparty) but its conditional cost when it does fill is high (the counterparty chose to cross). The expected cost is

a trade-off that no static “always dark” or “always lit” rule resolves.


3. Computational Implementation - three failures, three dollar numbers

Simulate the iceberg priority loss, the latency pick-off, and the dark hit-rate. Standard library only; re-executed and reproduced.

Read the numbers. (1) The iceberg arrived first yet filled only 100 of 500 shares - its competitor, who arrived later, took 400 of 400 - because the reloaded tranche went to the back of the FIFO queue. Concealing size bought anonymity at the cost of ~80% of the intended fill. (2) Pick-off loss scales as : going from 0.1 ms to 5 ms of staleness raises the expected loss from 22.36 on a single 500-share quote - a penalty for a latency, the signature of Brownian scaling and the reason microsecond engineering pays but has diminishing returns. (3) A midpoint dark order meets a counterparty only about 35% of the time - the missing 65% is pure opportunity cost, the price of not being seen.


4. Failure Modes & First-Principles Breakdowns

  1. Type mismatch is a structural, not operational, error. No amount of smart routing fixes an FOK that cannot fill or a market order too large for the level. The defense is inside the order-generation logic: size the child to the visible level, choose the type from whether partial fills are acceptable, and never let urgency silently mean “market order for the whole parent.”
  2. Anonymity is not free. Every concealment mechanism (iceberg reload, dark, midpoint peg) trades queue priority or fill probability for information hiding. The correct question is not “hide or not” but “what is , and what is the adverse selection conditional on filling?”
  3. Latency costs are real but bounded by Brownian scaling. Pick-off loss means a firm cannot buy immunity by being slightly faster - only by being dramatically faster (better scaling), or by not posting quotes it cannot defend. This is the economic engine behind the whole low-latency tier (Low-Latency Systems Architecture).
  4. The failures compound. A large order split into naive icebergs on a latent book, executed by a slow system through a fee-blind SOR, experiences queue loss latency loss fee loss simultaneously. Defense is layered, never a single fix.

5. References

  • Hasbrouck, Joel - Empirical Market Microstructure (2007)
  • Hasbrouck & Saar - “Low-latency trading,” JFM 16(4), 2013. Empirically measures the low-latency trader: order lifetimes and cancel rates that make latency a first-order cost.
  • Biais, Foucault & Moinas - “Equilibrium fast trading,” JFE 116(2), 2015. *When investing in speed is privately profitable but socially wasteful
  • Foucault, Pagano & Röell - Market Liquidity (2013)
  • Harris, Larry - Trading and Exchanges (2003). Practitioner treatment of order-type risk and queue position.

6. Connected Graph Bridges