Avellaneda–Stoikov
∞structuralThe canonical inventory-aware market-making model (2008). It quotes around a reservation price that skews away from your inventory, trading the spread you earn against inventory risk over a finite horizon, governed by risk aversion γ.
See it move
What to notice. Crank γ down toward zero: the spread collapses, fills come fast, and the reservation price stops skewing, so inventory random-walks away and the P&L lurches. Market making is an inventory-risk problem, not a spread-capture freebie.
What is the Avellaneda–Stoikov model?
Avellaneda–Stoikov (2008) is the canonical model for optimal market-making quotes under inventory risk. It frames quoting as a stochastic-control problem: a maker with finite risk-aversion choosing bid and ask offsets to maximise the expected utility of terminal wealth over a session. The solution is a pair of closed-form quotes that lean against inventory and widen with risk and volatility.
A market maker has two jobs in tension: earn the spread (quote tight, fill often) and not get stuck holding a big position (quote in a way that flattens you). A–S writes that tension down as a utility-maximisation problem and solves it. The answer is not "quote a fixed spread around the mid"; it is "quote around a private fair value that drifts away from your inventory, at a spread that depends on how risk-averse you are and how the market is behaving".
The setup, named and dated: Marco Avellaneda and Sasha Stoikov, "High-frequency trading in a limit order book" (2008), building on the dealer-inventory tradition of Ho & Stoll (1981). A risk-averse maker (exponential / CARA utility, risk-aversion ) quotes on an asset whose mid follows arithmetic Brownian motion with volatility ; orders arrive and fill its quotes with an intensity that decays in the distance of the quote from the mid; the session runs to a terminal time . What it delivers is a reservation price (your inventory-adjusted fair value) and an optimal half-spread, both in closed form, so you can compute exactly where to quote at any inventory and any time-to-close. That closed form is what makes it teachable and the standard reference; see the market-making hub for where it sits.
What is the reservation price?
The reservation price is the maker's private, inventory-adjusted fair value: the price at which it is indifferent to holding its current position. It sits below the mid when the maker is long and above it when short, by an amount that grows with inventory, volatility, risk-aversion and time remaining.
If you are long, you would rather sell than buy, so your "fair value" for quoting purposes is shaded down: you will happily sell a touch cheaper to get flat, and you are reluctant to buy more. The reservation price encodes exactly that lean. At zero inventory it equals the mid; the more inventory you carry, the further it leans.
Here is the mid (efficient) price, the signed inventory in lots, the risk-aversion, the variance per unit time, and the time left in the session. The shift is linear in inventory and scales with the remaining variance : early in a volatile session you skew hard for a given position; as the inventory term vanishes and : no time left for the position to hurt you, so no reason to lean.
You then quote symmetrically around , not around . So a long book () places both quotes lower than a flat book would: its ask is keener to get lifted, flattening the position. This is the principled form of inventory skew.
What is the optimal spread?
The optimal total spread has two parts: an inventory-risk term that widens the spread when risk, volatility or time-to-close are high, and a fill-rate term that sets how far out to quote given how fast fills decay with distance.
The spread you charge is your compensation for two distinct things. First, for the price risk of the inventory you will accumulate: that is the part, which shrinks to zero at the close. Second, for the trade-off between filling often (quote tight) and earning per fill (quote wide): that is the part, which depends on how steeply fill probability falls off with distance (governed by ).
The bid and ask are placed symmetrically around the reservation price , each at half this total from . Because itself leans with inventory, the quotes on the book are asymmetric around the mid even though they are symmetric around :
Crank and watch the trade: the inventory term widens, fills collapse, the model refuses to accumulate a position, and the terminal-P&L distribution narrows (less variance) while its mean edges down. You bought safety with spread. That is the whole lesson, and the simulator above makes it tactile.
What is the fill intensity λ(δ)?
The model's assumption about how often your quote gets hit is that the further from the mid you quote, the less often you fill, decaying exponentially. A quote sitting right at the touch gets hit constantly; a quote five ticks back almost never. The exponential captures that decay, and it is what turns "where do I quote" into an optimisation rather than a guess.
Empirically, the probability that a market order reaches a given depth in the book falls off roughly exponentially, and A–S adopt that as the arrival model. is calibrated from data (how fast does fill probability decay with distance) and from overall trade frequency. High (fills die quickly with distance) forces you to quote tight, so the fill-rate term shrinks; the parameter scales overall flow and cancels out of the optimal offsets, affecting only the realised fill count. In a real implementation these are the parameters you fit per instrument and per regime, and where 2026 production books replace the static exponential with a learned, state-dependent fill model.
This intensity is the link to the rest of these guides: the same flow that fills you is the flow you must classify as informed-or-noise (adverse selection), and the imbalance in it is what OFI and the microprice read to sharpen the fair value you centre on.
Show the derivation: the HJB problem behind it
A–S solve a Hamilton–Jacobi–Bellman equation for the maker's value function. They maximise the expected exponential utility of terminal wealth (cash plus inventory marked at the mid) over the bid/ask offsets, given the arithmetic-Brownian mid and the exponential fill intensities. A small-inventory / frozen-utility approximation collapses the PDE to the closed-form reservation price and spread above.
▸ Show the derivation optional
State and controls. Wealth in cash , inventory , and the mid following arithmetic Brownian motion. The maker chooses quote offsets (bid distance below mid) and (ask distance above mid). A buy order fills the bid at rate (raising , lowering cash); a sell fills the ask at rate (lowering , raising cash).
Objective. Maximise the expected exponential (CARA) utility of terminal mark-to-market wealth, with risk-aversion .
The HJB equation. The value function satisfies a PDE: the time-decay and diffusion of the value, plus the best the maker can do by choosing each offset against its fill rate, sum to zero.
with terminal condition .
The ansatz. Guess a separable form. The exponential utility makes the cash dimension separable; is the "indifference value" of holding units.
Defining the reservation bid/ask as the prices at which the maker is indifferent to one more fill yields the reservation price as the midpoint of the reservation quotes.
The two optimisations. Maximising each over its offset gives the optimal offsets; summing them and substituting the intensities yields the total spread. The frozen-inventory / linear approximation (treating as small relative to the horizon) is what makes the offsets independent of and the formulae exact.
What is approximated, honestly. The clean closed form relies on small inventory, an arithmetic (not geometric) Brownian mid, a single risk factor, frozen , the exponential fill law, and ignoring the discreteness of inventory. The full PDE has no such tidy solution; production work solves it numerically or learns the policy. Cite: Avellaneda & Stoikov (2008); Guéant, Lehalle & Fernandez-Tapia (2013) for the rigorous asymptotic treatment; Cartea, Jaimungal & Penalva (2015) for the textbook derivation.
How far is this from a real market maker?
Far enough to respect. A–S is a single-asset, single-period, frozen-volatility, exponential-fill, fee-free, competition-free toy. A production market maker in 2026 adds multi-asset hedging, regime-switching or stochastic volatility, learned and state-dependent fill intensities, fees and rebates, latency and queueing, jump and gap risk, and live toxicity detection. The model gives the shape of the answer, not the answer.
The honest gap, itemised. One asset, no hedging: real books quote many correlated instruments and hedge inventory in the most liquid one; A–S says nothing about the cross-asset problem. Frozen , no jumps: volatility is treated as constant, but in reality it clusters and gaps (see fat tails and irregular time), and a single jump through your quotes can dwarf a day of spread. Exponential fills, no competition: the intensity ignores the queue (price-time priority), other makers, and the fact that the flow that fills you is partly informed. A–S does not model adverse selection directly, which is the Market Making II family's job. No fees, rebates or latency: real P&L lives or dies on the maker-taker schedule, the rebate, and whether your re-quote reaches the engine before the price moves (the other side of latency arbitrage).
What to do with it anyway: use A–S as the scaffolding (the reservation-price-and-skew structure is right) and extend it. Most serious crypto and prediction-market quoting bots are recognisably A–S underneath, with a better fair value (microprice), a toxicity gate (VPIN), fee terms, and a learned fill model bolted on. That is the build path the datasets and tools support. What AI changes: the inputs sharpen (learned , learned , learned fair value) but the control structure A–S derives is the thing you are parameterising, not replacing (see what AI changes for HFT).
Worked example
A single A–S quote computation, as of a 2026 worked snapshot. Parameters: mid , risk-aversion , volatility (per ), fill-decay , session , current time so .
Flat book, . The reservation price equals the mid (no inventory to lean against): . The total spread is:
So you quote bid ≈ 99.155 / ask ≈ 100.845, symmetric around the mid.
Long inventory, . The reservation price leans down: . Your private fair value has moved 2.00 below the mid because you are long and want to sell. The total spread is unchanged (it does not depend on in the closed form), so you quote symmetrically around : bid ≈ 97.155 / ask ≈ 98.845. Both quotes are now below the mid: your ask at 98.845 sits below the mid of 100.00, so it is very likely to be lifted, flattening you. That is the model preferentially selling to shed inventory. (Whether you would literally quote an ask below the mid in practice is exactly the kind of edge case the closed-form toy produces and a real implementation clamps, a good thing to notice.)
Near the close, , so . The reservation price is now . The lean has almost vanished: with little time left, the inventory cannot hurt you much, so the model stops skewing and re-centres on the mid.
Raising risk-aversion to (flat book). The inventory term now dominates; the spread balloons, fills collapse, and over a Monte-Carlo batch the terminal-P&L histogram narrows sharply while its mean falls. You bought variance reduction with foregone spread; tune it live in the simulator above.
The numbers are illustrative and synthetic; in practice , , and are calibrated per instrument and regime, and the closed form is clamped and extended. Educational only, not investment advice; no P&L is promised.