Basic Prerequisites: Probability Theory (Poisson arrivals, geometric/negative-binomial waiting times).
1. Intuition & Practical Objective
This page builds the why of queue position and fill probability with no prior trading-systems knowledge needed. The objective is one idea: a passive order is not filled because its price is good - it is filled because enough volume leaves the front of the queue in front of it. Your fill odds are governed by your queue position, and queue position is the one thing a passive trader actually controls.
Start with the dumbest question: I posted a buy limit order at the best bid. There are trades printing at the bid. Why am I not filled? Because the exchange matches by price, then by time. Everyone who arrived at that price before you is ahead of you, and the matching engine consumes the front of the queue first. A trade of 2,000 shares when 8,000 shares are ahead of you fills other people, not you.
Three steps:
-
You are in a line, not at a price. Posting at the touch earns you a position in a queue. If 50 orders are ahead of you, you need 50 orders’ worth of trades (or cancellations) to clear before your turn. The price you posted at is a selector for which queue you join - the queue itself is what determines when (or whether) you fill.
-
Fill probability falls with queue position and rises with flow. More volume from the front, or more cancellations ahead of you, means faster fills. Deeper queues ahead mean slower fills. Two traders at the same price can have wildly different fill rates purely because one arrived early (front of queue) and one arrived late (back).
-
The fill you get is the fill you don’t want (adverse selection). If you are deep in the queue and the market crashes, cancellations evaporate the front of the line and you are suddenly filled - at the moment the price is about to move against you. If the market rallies, the front of the queue is still there and you sit unfilled while the price runs away. Passive fills are negatively selected: you get filled when you would rather not be.
Why it matters. This asymmetry is the entire economic reason market makers must earn the spread: the spread is compensation for being systematically filled at bad times. A strategy that models fills as “any trade at my price” will book phantom profits and blow up in production.
2. Mathematical Ground Truth & Derivations
Setting. A FIFO queue at your price. Let = the number of shares ahead of you. Let trades arrive as a Poisson process of rate (each trade consumes shares from the front). You fill when cumulative traded volume reaches .
Pure-trade model (the minimal one). Discretise time into ticks; each tick a trade unit arrives with probability . The number of trade units by time is , so
i.e. the time to fill is negative-binomial, , and its mean is the clean rule of thumb
Wait longer, don’t wait smarter. Because the trade process is memoryless, the per-tick fill hazard once you are next in line is just - waiting a long time without filling tells you nothing except that was large. Survival is a statement about the queue, not about “luck.”
Cancellations flatter the estimate. Real queues also shrink from cancellations. If a cancel arrives with probability per tick and removes a uniformly random live order from a total depth , then
so cancellations count toward your fill only in proportion to how far back you are. This is why fills are faster than trade volume alone suggests - and why they are adverse: cancels surge exactly when the market turns.
Adverse selection, in one line. Over a fixed horizon , conditioned on being filled,
Fills coincide with aggressive flow in one direction; that same flow pushes the mid against your position.
3. Computational Implementation - queue position is fill probability
Stdlib only. First we show the negative-binomial rule of thumb: fill probability collapses as the queue ahead grows, and the mean wait is exactly . Then we show the adverse-selection asymmetry directly.
Read the table: at queue position 1 you always fill; at position 10 (mean wait 200 ticks, exactly the horizon) you fill about half the time; at position 25 you essentially never fill in the window. The mean-wait column is the whole game - position divided by flow. And the adverse-selection block makes the asymmetry concrete: filled orders sit on average ticks below the starting mid, unfilled orders ticks above it. The fills you want (price running your way) are exactly the ones that don’t happen.
4. Failure Modes & First-Principles Breakdowns
- “A trade printed at my price, so I filled.” False under price-time priority. You fill only when cumulative volume exceeds the queue ahead of you. Treating prints as fills overstates the fill rate (measured vs the true on the failure-modes page) and manufactures fictitious P&L.
- Confusing price with queue. Two orders at the same price have different fill probabilities. Modelling fill probability as a function of price alone - instead of - is the structural error that sinks naive market-making backtests.
- Ignoring adverse selection. If fills were random, a passive strategy’s edge would be the spread. Because , the real edge is the spread minus the expected post-fill drift. A strategy calibrated on fills-without-drift is systematically optimistic.
- Latency blindness. The queue you observe is stale. By the time your cancel/post reaches the matching engine, the front of the line has moved. This is the seed of every failure mode in 05 · Failure Modes.
5. References
- Cont, Stoikov & Talreja (2010)
- Gould et al. (2013)
- Foucault, Pagano & Roell, Market Liquidity
6. Connected Graph Bridges
- Base: Probability Theory · Market Microstructure & Order Types
- Continue: 02 · The Order Queue · Index Hub
- Economics bridge: Adverse Selection & Glosten–Milgrom