Algorithmic Market Making Closed-Form HJB Linearization Guéant, Tapia & Manziadi (2012)

Guéant-Tapia-Manziadi (2012) Market Making Lab

Simulate Olivier Guéant, Charles-Albert Tapia, and Olivier Manziadi's (2012) closed-form solution to the Avellaneda-Stoikov market making problem. Model exact tridiagonal matrix exponential linearization, hard inventory bounds $[-Q, +Q]$, and non-linear optimal bid-ask quoting.

Theoretical Foundations: Exact HJB Linearization via Matrix Exponentials
1. Cole-Hopf Ansatz & Tridiagonal Linear System

Avellaneda & Stoikov's coupled nonlinear Hamilton-Jacobi-Bellman PDE is linearized using the ansatz $u(x, q, s, t) = -\exp(-\gamma(x + q s)) v_q(t)^{-\gamma/\kappa}$. The vector $v(\tau) = (v_{-Q}(\tau), \dots, v_Q(\tau))^T$ with $\tau = T - t$ satisfies:

$$\frac{dv}{d\tau} = M v(\tau), \quad v(0) = \mathbf{1}, \quad v(\tau) = \exp(M \tau) \mathbf{1}$$

Where $M_{i,i} = -\frac{1}{2}\kappa\gamma\sigma^2 q_i^2$ on the diagonal, and $M_{i,i\pm 1} = C = \frac{A}{1+\gamma/\kappa}(1+\frac{\gamma}{\kappa})^{-\kappa/\gamma}$ on the off-diagonals.

2. Exact Closed-Form Optimal Half-Spreads

From the exact solution $v(\tau)$, the dealer quotes optimal bid and ask offsets without heuristic asymptotic approximations:

$$\delta_b^*(t, q) = \frac{1}{\kappa}\ln\left(1 + \frac{\gamma}{\kappa}\right) + \frac{1}{\gamma}\ln\left(\frac{v_q(\tau)}{v_{q+1}(\tau)}\right), \quad \delta_a^*(t, q) = \frac{1}{\kappa}\ln\left(1 + \frac{\gamma}{\kappa}\right) + \frac{1}{\gamma}\ln\left(\frac{v_q(\tau)}{v_{q-1}(\tau)}\right)$$

At limits $q = Q$ and $q = -Q$, quotes naturally retreat to $+\infty$, eliminating the need for ad-hoc inventory clipping rules.

Model Parameters

HFT Equities Market Maker: Tight order book queue liquidity (kappa = 1.5, A = 140) and moderate risk aversion (gamma = 0.10) with inventory limits +/-5 shares.

Zero-Inv Spread $(q=0)$ $0.088 Balanced MM
Half-Spread $\delta^*(0)$ $0.044 Base: $0.043
Session Wealth MTM +$0.00 Sharpe: 0.00
Total Fills / Trades 0 Final $q$: 0
Matrix $M$: 11×11
Asymptotic Spread: $0.088
Inventory Bounds: [-5, +5]
Exact Solution: Matrix Exp
Dual 5×5 Microstructure Sensitivity Grids
Sensitivity Grid 1: Inventory $q$ vs Risk Aversion $\gamma$ → Total Spread $(\delta_a^* + \delta_b^*)$

Shows how optimal total quoted spread expands non-linearly as dealer risk aversion and inventory accumulation intensify:

Sensitivity Grid 2: Liquidity $\kappa$ vs Volatility $\sigma$ → Half-Spread at Zero Inventory $\delta^*(q=0)$

Quantifies baseline quoting half-spread across order book depth elasticity and asset price uncertainty:

Market Microstructure Mastery: Guéant, Tapia & Manziadi (2012)
Related Market Microstructure & Stochastic Modeling Simulators
Cartea-Jaimungal (2014) Market Making Lab

Optimal high-frequency quoting with short-term predictive alpha drift signals, Ornstein-Uhlenbeck processes, and inventory risk control.

Explore Cartea-Jaimungal Lab
Avellaneda-Stoikov Market Making Lab

Classical stochastic optimal control, Poisson fill intensities, reservation price skewing, and inventory risk control.

Explore Avellaneda-Stoikov Lab
Cont-Stoikov (2010) Order Book Lab

Markovian queue depletion, birth-death depth dynamics, 2D harmonic absorption, and order book imbalance.

Explore Cont-Stoikov Lab
Frequently Asked Questions: Guéant-Tapia-Manziadi (2012) Market Making Model

The Guéant, Tapia, and Manziadi (2012) model is the definitive analytical solution to the classical Avellaneda-Stoikov (2008) market making problem. By introducing a Cole-Hopf style exponential change of variables, it transforms the coupled nonlinear Hamilton-Jacobi-Bellman (HJB) system of partial differential equations into a linear system of ordinary differential equations solvable in exact closed form via matrix exponential.

The model uses the value function ansatz $u(x, q, s, t) = -\exp(-\gamma(x + qs)) v_q(t)^{-\gamma / \kappa}$. Substituting this ansatz into the nonlinear HJB equation eliminates the power and exponential terms, reducing the optimal control problem to a tridiagonal linear ODE system $v'(\tau) = M v(\tau)$, where $\tau = T - t$ and $M$ is a symmetric tridiagonal transition matrix of dimension $(2Q+1)\times(2Q+1)$.

The exact optimal quoting offsets are given by $\delta_b^*(t, q) = \frac{1}{\kappa} \ln\left(1 + \frac{\gamma}{\kappa}\right) + \frac{1}{\gamma} \ln\left(\frac{v_q(\tau)}{v_{q+1}(\tau)}\right)$ for buying ($q < Q$), and $\delta_a^*(t, q) = \frac{1}{\kappa} \ln\left(1 + \frac{\gamma}{\kappa}\right) + \frac{1}{\gamma} \ln\left(\frac{v_q(\tau)}{v_{q-1}(\tau)}\right)$ for selling ($q > -Q$), where $v(\tau) = \exp(M \tau) \mathbf{1}$.

Unlike heuristic models that artificially clip quotes when inventory limits are breached, Guéant's framework restricts the inventory state space to $\{-Q, \dots, Q\}$. At $q = Q$, the transition to $q+1$ is impossible, mathematically setting $\delta_b^*(t, Q) = +\infty$ (automatically cancelling bids). Similarly, at $q = -Q$, $\delta_a^*(t, -Q) = +\infty$ (automatically cancelling asks).

As trading time approaches expiry ($t \to T$, $\tau \to 0$), the dealer has less time to passively liquidate accumulated inventory. Consequently, the value function ratio $v_q / v_{q-1}$ shifts aggressively, causing the dealer to tighten quotes on the exit side to dump inventory and widen quotes on the entry side to avoid acquiring additional risk.