Basic Prerequisites: 02 · The Order Queue.


1. Intuition & Practical Objective

Page 02 gave the mechanics; this page turns them into estimable models of fill probability. The practical objective: given a queue position , a flow rate, and a cancellations process, produce two numbers a trading system can act on - (i) and (ii) the expected time to fill. Along the way we connect the queue view to the survival/hazard view of the empirical literature (Lo–MacKinlay–Zhang 2002): a limit order “lives” until it fills or is cancelled, and its hazard is a function of the book state.

The organising idea: fill probability is a first-passage probability. In the pure-trade model the time to fill is negative-binomial; add cancellations and it speeds up in proportion to how far back you are; let the flow rate depend on the state and you have a queue-reactive model (page 04).


2. Mathematical Ground Truth & Derivations

2.1 Pure-trade fill probability (negative-binomial)

Trades are a Poisson process of rate . Discretise to ticks where a trade unit arrives with probability . The time to fill units is

Hence the fill-probability curve over a horizon :

where is the regularised incomplete beta function. Two features matter: it is steep in (position dominates), and the relative dispersion shrinks with - deep orders have timely fills that are comparatively predictable, front orders have noisy waits.

2.2 Adding cancellations (uniform)

Let cancels arrive with probability per tick and remove a uniformly random live order from total depth . A cancel is ahead of you with probability , so the effective per-tick outflow coefficient is

When is large (deep in the queue) and cancels help maximally; when you are near the front () cancels barely help. This position-dependent cancel benefit is the tractable signature of the real phenomenon.

2.3 The Cont–Kukanov fill function (random outflow)

The general statement (Cont & Kukanov 2017): for queue position ahead, order size , and random outflow with distribution ,

The fill ratio is the quantity a placement algorithm maximises subject to adverse-selection and fee costs. This is what we compute on page 06.

2.4 The survival / hazard view (Lo–MacKinlay–Zhang)

Write = time from submission to execution-or-cancel. The hazard is the instantaneous execution rate given the order is still alive. Lo–MacKinlay–Zhang (2002) estimate as a function of covariates (distance from the quote, spread, volatility, time of day) and find execution hazards that decay with survival time - an order still unfilled after a long spell is trading “against” the flow and is more likely to be cancelled than executed. The queue model predicts this: long survival with a large means either the flow died or the position is stuck, both of which raise the cancel-to-fill ratio.


3. Computational Implementation - closed form vs Monte Carlo

Stdlib only. Model A computes the negative-binomial fill probability by exact binomial summation and checks it against direct simulation. Model B adds uniform cancellations and shows how much they lift the fill probability.

The closed form and simulation agree to across the grid - the negative-binomial law is exactly the FIFO fill-time law. Then Model B shows how cancellations dominate: at position 25 in a 200-lot queue, raising the cancel rate from to takes the fill probability from to - a hundredfold change driven entirely by the front of the queue disappearing, not by any trade of your own. This is precisely why fill models that ignore cancels are wrong in the most expensive direction: the cancels that help your fill are the ones that flee when the market turns, i.e. the ones that precede adverse moves.


4. Failure Modes & First-Principles Breakdowns

  1. Ignoring cancellations. A trade-only fill model understates fill probability in normal conditions and massively overstates it in stressed conditions (when cancels vanish). Both directions are costly.
  2. Point estimates without dispersion. alone hides the variance. The variance of the wait drives inventory risk; a fill model that reports a mean but not a distribution cannot size a position safely.
  3. Calibrating on aggregate trade rate. Your fill rate is governed by the trade rate at your price level, not the stock’s average. Level-specific flow is the right input; using consolidated volume mis-times fills.
  4. Stationary flow assumption. Real arrival rates are time-varying and autocorrelated (clustering). A single mis-prices fills across the day - the gateway to the state-dependent intensities of page 04.

5. References

  • Lo, MacKinlay & Zhang (2002), J. Financial Economics 65(1), 31–71
  • Cont, Kukanov & Stoikov (2014), J. Financial Markets 17
  • Cont & Kukanov (2017)
  • Gould et al. (2013)

6. Connected Graph Bridges