Cont-Stoikov (2010) Order Book Lab
Simulate Rama Cont, Sasha Stoikov, and Rishi Talreja's (2010) stochastic model for limit order book dynamics. Model Markovian queue depletion, 2D first-passage price move absorption probabilities $p_1(x, y)$, and equilibrium depth distributions.
1. Birth-Death Queue Transitions & Depletion Time
At each price queue, limit orders arrive at rate $\lambda$, market orders execute at rate $\mu$, and resting orders cancel at state-dependent rate $\theta q$. Expected queue depletion time $E[\tau \mid q_0]$ satisfies:
Because cancellation intensity $\theta q$ scales with depth, large queues erode via cancellation rather than market orders, driving sub-linear depletion time growth.
2. Price Move Absorption Probability $p_1(x, y)$
Given bid depth $x$ and ask depth $y$, the probability that the next mid-price move is an increase (+1 tick) satisfies the 2D discrete harmonic equation:
Boundary conditions: $p_1(x, 0) = 1$ and $p_1(0, y) = 0$. When $\lambda = \theta = 0$, this yields the exact Order Book Imbalance (OBI) baseline $p_1(x, y) = \frac{x}{x + y}$.
Large-Cap Equity (Liquid / Heavy Queues): High limit order replenishment (lambda = 12.0/s) and balanced market order flow (mu = 8.0/s), typical of SPY or Apple order books.
Sensitivity Grid 1: Bid Depth $x$ vs Ask Depth $y$ → Price Increase Probability $p_1(x, y)$
Shows the transition surface of the probability of an immediate upward mid-price jump across queue combinations:
Sensitivity Grid 2: Market Order Rate $\mu$ vs Cancellation $\theta$ → Depletion Time ($q_0 = 10$)
Demonstrates queue resilience and expected seconds to depletion under varying execution and cancellation intensities:
Guéant-Tapia-Manziadi Lab
Closed-form market making, Cole-Hopf HJB linearization, tridiagonal matrix exponentials, and exact inventory bounds.
Explore Guéant LabCartea-Jaimungal Lab
Optimal high-frequency quoting with short-term predictive alpha drift signals, OU processes, and inventory risk control.
Explore Cartea LabOrder Flow Imbalance Lab
Cont-Kukanov-Stoikov (2014) limit order book event decomposition, multi-level OFI regressions, and market depth resilience.
Explore OFI LabCont-de Larrard (2013) Lab
Heavy-traffic diffusion limit, conformal harmonic exit probabilities $\frac{2}{\pi}\arctan(q_b / q_a)$, and micro-volatility $\sigma^2 = \frac{\pi\mu\delta^2}{4D^2}$.
Explore Diffusion Lab