6. The Mathematics of Optimal Quoting
Avellaneda–Stoikov (2008): the two formulas that run half the market making bots on Earth — derived gently, then driven with sliders.
The setup
Avellaneda and Stoikov model a market maker over a horizon ending at time T (end of day, or market resolution). Three ingredients:
- The mid-price follows a Brownian motion with volatility σ: it diffuses randomly, no drift.
- If you quote at distance δ from the mid, fills arrive as a Poisson process with intensity λ(δ) = A·e−kδ — quote further away, get filled exponentially less often. The constant k measures how price-sensitive the flow is (a dense, competitive book has high k).
- You maximize expected exponential utility of final wealth with risk aversion γ — meaning variance of your inventory genuinely hurts you, not just losses.
Solving the resulting Hamilton–Jacobi–Bellman equation (a dynamic-programming equation: "act optimally now, assuming you'll act optimally forever after") yields two famous results.
Result 1 — The reservation price
Your personal fair value r is the market mid s, shifted against your inventory q. Long 10 contracts? Your private value sits below the mid — you'd rather sell. The shift grows with:
- γ — how much you hate risk;
- σ² — variance, not volatility: doubling σ quadruples the skew;
- (T−t) — how long you'll have to live with the position. Near the close (or a contract's resolution), the skew vanishes: there's no time left for the position to hurt you.
Result 2 — The optimal spread
Two terms, two jobs. The first is the risk premium — wider when volatile and when far from the horizon. The second is the competition term: when the book is dense and flow is price-sensitive (large k), the log shrinks and you must quote tighter to get filled at all. You then center this spread on the reservation price, not the mid — that asymmetry is what steers inventory home.
Where the competition term comes from: the fill-rate trade-off
The second half of the spread formula deserves its own picture, because it encodes the most fundamental tension in market making. Quote far from the mid and each fill is lucrative but rare; quote close and fills pour in worth almost nothing. With fill intensity λ(δ) = A·e−kδ, the expected profit rate from one quote is the product:
A hump with a single peak at exactly δ* = 1/k: the denser and more price-sensitive the book (large k), the tighter the optimal quote. This is the risk-neutral skeleton of the AS competition term; risk aversion (γ) then nudges the quote off this peak, trading a little expected profit for a lot less inventory variance.
Guéant–Lehalle–Fernandez-Tapia: making it production-grade
Raw AS has two practical problems: inventory is unbounded, and the formulas are asymptotic approximations. Guéant, Lehalle and Fernandez-Tapia (2013) re-solved the problem with a hard inventory limit |q| ≤ Q and showed the HJB system collapses into linear ordinary differential equations with clean closed-form approximations. The behavioral upshot: when inventory hits the bound, you simply stop quoting that side. GLFT is what you should actually implement: same intuition, bounded risk, cheap to compute. (Guéant later extended it to multi-asset market making — useful when quoting correlated markets like several tennis matches at once.)
What the model leaves out
- Prices aren't Brownian — they jump (Chapter 8 fixes this for event markets).
- Adverse selection isn't modeled — fills are assumed information-free Poisson arrivals. In reality you must bolt on toxicity monitoring (Chapter 7).
- Parameters aren't constants — σ, k, and even your effective γ shift by regime. The frontier (Chapter 15) is learning them online.
5. The Two Fears: Inventory Risk & Adverse Selection
Why does a spread exist at all? Two Nobel-grade answers: because holding things is risky (Ho–Stoll), and because some of your customers know more than you (Glosten–Milgrom, Kyle).
7. Microstructure Signals: Microprice, Queues, and Toxicity
The order book is constantly whispering where the price is about to go. Three signals every quoting engine should listen to.