Quant Memo
Advanced

Stochastic Control Formulations Of Market Making

Market making can be posed as a control problem: pick bid and ask quotes every instant to maximize expected profit while penalizing the risk of holding inventory when the price moves against you.

Prerequisites: Order Book Mechanics, Inventory Management for Market Makers

A market maker who just quotes the mid on both sides, tight and symmetric, will accumulate inventory whenever flow is one-sided — and the moment it accumulates, every further tick of adverse price movement multiplies the loss. Widening the quotes reduces fills but doesn't stop the drift. The question a market maker actually needs answered is: given how much inventory I'm holding right now, where should I place my bid and my ask? That is a control problem — a decision that gets remade continuously as the state (inventory, time left, volatility) changes — and stochastic control is the machinery built to answer it.

Think of it like steering a boat with a current. If you're dead center in the channel, you point straight ahead. If you've drifted toward one bank, you angle the rudder to correct, even if it costs you some forward speed. The market maker's "position in the channel" is inventory; the "rudder angle" is how asymmetric the two quotes are.

The classic formulation (Avellaneda–Stoikov) sets up a value function V(x,q,t)V(x, q, t) — the maximum expected utility of wealth xx, holding qq shares of inventory, with tt time left before the trading session ends. It solves a Hamilton-Jacobi-Bellman (HJB) equation, which is just the continuous-time version of "the best decision now equals the immediate reward plus the best possible future, discounted for risk." Under exponential utility with risk-aversion parameter γ\gamma, the solution collapses to two clean numbers: a reservation price

r(q,t)=mqγσ2(Tt)r(q, t) = m - q\,\gamma\,\sigma^2 (T - t)

where mm is the mid, σ\sigma the price volatility, and TtT-t the time remaining. In words: your personal fair value sits below the market mid by an amount proportional to how much inventory you're long, how volatile the asset is, and how much time is left for that inventory to hurt you. A market maker sitting long shades their reservation price down (they want to sell); short, they shade it up. And an optimal spread around that reservation price,

δb+δa=γσ2(Tt)+2γln ⁣(1+γk)\delta^b + \delta^a = \gamma \sigma^2 (T-t) + \frac{2}{\gamma}\ln\!\left(1 + \frac{\gamma}{k}\right)

where kk measures how fast fill probability decays as you quote further from the touch. In words: total spread has two pieces — a risk piece that grows with volatility and time remaining, and a liquidity piece that depends on how competitive the order flow is.

Worked example. Suppose σ=0.02\sigma = 0.02 (2% daily vol equivalent, scaled to the trading horizon), γ=0.1\gamma = 0.1, Tt=1T - t = 1 (one full day left), k=1.5k = 1.5, and mid m=100m = 100. The risk-aversion term in the spread is γσ2(Tt)=0.1×0.0004×1=0.00004\gamma\sigma^2(T-t) = 0.1 \times 0.0004 \times 1 = 0.00004. The liquidity term is 20.1ln(1+0.1/1.5)=20×ln(1.0667)=20×0.0645=1.29\frac{2}{0.1}\ln(1 + 0.1/1.5) = 20 \times \ln(1.0667) = 20 \times 0.0645 = 1.29. Total optimal spread ≈ 1.29 (dominated by the liquidity term at this vol level). Now suppose the market maker is long q=5q = 5 shares: the reservation price is r=1005×0.1×0.0004×1=1000.0002=99.9998r = 100 - 5 \times 0.1 \times 0.0004 \times 1 = 100 - 0.0002 = 99.9998 — barely shaded here because volatility is low, but the mechanism is the point: quotes get centered below the market mid, and the ask gets pulled in to encourage selling out of the long position.

Second example, larger position. Same parameters but q=500q = 500 (a much bigger long). Reservation price: r=100500×0.1×0.0004×1=1000.02=99.98r = 100 - 500 \times 0.1 \times 0.0004 \times 1 = 100 - 0.02 = 99.98. Now the shading is visible: two full cents below mid. With a half-spread of about 0.645 either side of rr, the bid sits near 99.34 and the ask near 100.62 — both quotes have shifted down relative to a flat symmetric quote at 99.36/100.64, making a sell more likely than a buy at every price level.

inventory q (long →) price mid reservation price r(q) ask quote bid quote
As inventory grows long (moving right), the reservation price and both quotes drift below the mid, biasing the market maker toward selling and back toward zero inventory.

What this means in practice

A quoting engine built on this framework doesn't ask "what's the mid" and stop there — it asks "what's the mid, and how much do I already own, and how much time do I have to unwind it." The output is a bid and ask that move continuously as the inventory clock ticks, tightening near the close (less time for inventory to hurt you, less need to shade) and widening early in the session when there's more time for volatility to bite. This is the mathematical form of what a discretionary market maker does by instinct: skew quotes to work off an unwanted position.

The control isn't "what's a good spread" — it's "what's my reservation price given my inventory, time left, and risk aversion," with the spread built symmetrically around that, not around the market mid.

The classic confusion

It's tempting to read r(q,t)=mqγσ2(Tt)r(q,t) = m - q\gamma\sigma^2(T-t) and conclude that a market maker should always shade toward flat inventory as hard as possible. But γ\gamma (risk aversion) and kk (fill-rate sensitivity) are calibrated parameters, not physical constants — set γ\gamma too high and the model prescribes quotes so defensive that fill rates collapse and the desk earns nothing; set it too low and inventory swings become large and volatility risk dominates. The formula gives the shape of the optimal policy, not a number you can plug in without fitting γ\gamma and kk to the actual market you're trading, which is where most of the real engineering effort goes.

The Avellaneda-Stoikov closed form only holds under specific assumptions — constant volatility, symmetric fill-rate functions, terminal-time inventory penalty — and real desks extend it with running inventory penalties, adverse-selection terms, and numerically solved HJB equations when the assumptions break. See The Avellaneda-Stoikov Model for the full derivation and Skewing Quotes To Manage Inventory for how the reservation-price idea gets implemented on a live desk.

Related concepts

Practice in interviews

Further reading

  • Avellaneda & Stoikov (2008), High-frequency Trading in a Limit Order Book
  • Guéant, Lehalle & Fernandez-Tapia (2013), Dealing with the Inventory Risk
ShareTwitterLinkedIn