Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Guide
Derivatives pricing0 / 17
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Options on dividend-paying stocks, indices, currencies and futures14Implied volatility and the volatility smile15Stochastic volatility and the Heston model16Static replication: Breeden–Litzenberger and Carr–Madan17Exotic options: barriers, Asians and digitals
Portfolio & risk0 / 12
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08The Fama–French factor models09Value at Risk and expected shortfall10Systemic risk and contagion11Portfolio constraints and the no-short-sales frontier12Estimating expected returns and covariances
Fixed income0 / 10
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Non-parallel curve moves and key-rate durations06Bond futures and the cheapest-to-deliver07Interest rate swaps08Callable bonds and negative convexity09Credit risk: default probabilities and credit spreads10Real rates, inflation and inflation-linked bonds
Corporate finance0 / 10
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04Project risk: sensitivity, scenarios and Monte Carlo NPV05The weighted average cost of capital06Capital structure and the Modigliani–Miller theorems07Dividends, payout policy and the dividend discount model08Discounted cash flow valuation09Relative valuation with multiples10Real options: the value of flexibility
Probability and measure0 / 13
01Measuring the size of sets02σ-algebras and Borel sets03Lebesgue measure and null sets04Measurable functions05The Lebesgue integral06Convergence theorems07Probability spaces and Kolmogorov's axioms08Random variables and their distributions09Expectation, variance and inequalities10Independence and product measures11Modes of convergence and the law of large numbers12Conditional probability and conditional expectation13Measure theory in option pricing
Stochastic models0 / 17
01Random walks and Brownian motion02The law of large numbers and the central limit theorem03Probability spaces, σ-algebras and random variables04Filtrations, adapted processes and stopping times05Conditional expectation and martingales06Properties of Brownian motion07The reflection principle and first passage times08The Brownian bridge09The Itô integral10Itô's lemma11Kolmogorov equations and the Feynman–Kac formula12Change of measure and Girsanov's theorem13Monte Carlo option pricing14Simulating SDEs: the Euler–Maruyama scheme15Correlated Brownian motions and multi-asset models16Mean reversion: Ornstein–Uhlenbeck and Vasicek17Jumps and the Merton jump-diffusion model
Market microstructure0 / 11
01Market makers and liquidity02The limit order book03Queue position and fill probability04Adverse selection and informed trading05The Glosten–Milgrom model06Measuring and decomposing the bid–ask spread07Informed trading and Kyle's lambda08Price impact and optimal execution09Inventory risk and quote skewing10Optimal quoting: the Avellaneda–Stoikov model11Market making profit and loss attribution
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guides/Market microstructure/10

Optimal quoting: the Avellaneda–Stoikov model

Lesson 10 of 11 · 1 min read

"Inventory risk and quote skewing" argued that a market maker holding too much of an asset should lower both quotes, and that the spread should reflect the risk it carries. This lesson turns the argument into one rule. Avellaneda and Stoikov start from the utility function of "Risk aversion and the optimal complete portfolio", let the market maker maximise it, and obtain a reservation price, which sets the skew, and a spread, which sets the width. We derive the first from scratch and state the second with a sketch of where it comes from.

Set-up

The mid price follows the Brownian motion of "Random walks and Brownian motion" without drift: dSt=σ dWtdS_t = \sigma\,dW_tdSt​=σdWt​. The maker has cash xxx and an inventory of qqq shares (negative when short), and trades until a horizon TTT. At the end it is worth x+qSTx + qS_Tx+qST​, and it values that outcome with exponential utility:

U=−e−γ (x+qST),γ>0.U = -e^{-\gamma\,(x + q S_T)},\qquad \gamma > 0.U=−e−γ(x+qST​),γ>0.

The parameter γ\gammaγ is the maker's risk aversion. The maker chooses its quotes as distances from the mid: a bid at S−δbS - \delta^bS−δb and an ask at S+δaS + \delta^aS+δa. A quote at distance δ\deltaδ is filled at the rate λ(δ)=A e−kδ\lambda(\delta) = A\,e^{-k\delta}λ(δ)=Ae−kδ per unit of time, as in "Market makers and liquidity": the closer the quote, the more often it trades. A larger kkk means that fills thin out faster as the quote moves away.

The reservation price

Suppose the maker does not trade at all until TTT. With τ=T−t\tau = T - tτ=T−t time left, ST=S+στ ZS_T = S + \sigma\sqrt{\tau}\,ZST​=S+στ​Z with ZZZ standard normal, and since E[ecZ]=ec2/2E[e^{cZ}] = e^{c^2/2}E[ecZ]=ec2/2,

E[−e−γ(x+qST)]=−e−γ(x+qS)  eγ2q2σ2τ/2.E\bigl[-e^{-\gamma(x + qS_T)}\bigr] = -e^{-\gamma(x + qS)}\;e^{\gamma^2 q^2\sigma^2\tau/2}.E[−e−γ(x+qST​)]=−e−γ(x+qS)eγ2q2σ2τ/2.

The last factor is the penalty for the variance of the position. Now ask what price rbr^brb makes the maker indifferent to buying one more share. After the purchase, cash is x−rbx - r^bx−rb and inventory is q+1q+1q+1, so equal utility requires equal exponents:

−γ (x−rb+(q+1)S)+12γ2(q+1)2σ2τ=−γ (x+qS)+12γ2q2σ2τ.-\gamma\,(x - r^b + (q+1)S) + \tfrac12\gamma^2 (q+1)^2\sigma^2\tau = -\gamma\,(x + qS) + \tfrac12\gamma^2 q^2\sigma^2\tau.−γ(x−rb+(q+1)S)+21​γ2(q+1)2σ2τ=−γ(x+qS)+21​γ2q2σ2τ.

Since (q+1)2−q2=2q+1(q+1)^2 - q^2 = 2q + 1(q+1)2−q2=2q+1, this solves to the indifference bid below. The same steps for selling one share, with cash x+rax + r^ax+ra and inventory q−1q - 1q−1, give the indifference ask:

rb=S−(1+2q) γσ2τ2,ra=S+(1−2q) γσ2τ2.r^b = S - \frac{(1 + 2q)\,\gamma\sigma^2\tau}{2},\qquad r^a = S + \frac{(1 - 2q)\,\gamma\sigma^2\tau}{2}.rb=S−2(1+2q)γσ2τ​,ra=S+2(1−2q)γσ2τ​.

Their average is the reservation price:

r=S−q γ σ2 (T−t).r = S - q\,\gamma\,\sigma^2\,(T - t).r=S−qγσ2(T−t).

With no inventory the reservation price is the mid. A long maker (q>0q > 0q>0) values the asset below the mid, because every extra share adds variance to a position it already has too much of; a short maker values it above. The shift is proportional to the inventory, the risk aversion, the variance and the time left.

The optimal spread

The reservation price tells the maker where to centre its quotes. The spread is a separate decision, because each side now trades off two things: a quote far from the mid earns more per fill but fills less often. Writing the maker's value function and applying dynamic programming gives the Hamilton–Jacobi–Bellman equation of the problem. We do not derive it here. Avellaneda and Stoikov show that, to first order, the optimal distances are δa=ra−S+1γln⁡(1+γ/k)\delta^a = r^a - S + \tfrac1\gamma\ln(1 + \gamma/k)δa=ra−S+γ1​ln(1+γ/k) on the ask side and the mirror image on the bid side, and the total spread is

δa+δb=γ σ2 (T−t)+2γln⁡ ⁣(1+γk).\delta^a + \delta^b = \gamma\,\sigma^2\,(T - t) + \frac{2}{\gamma}\ln\!\Bigl(1 + \frac{\gamma}{k}\Bigr).δa+δb=γσ2(T−t)+γ2​ln(1+kγ​).

This is the paper's approximation, not an exact solution, but it is accurate in the range where the model is used. Each term has a meaning.

  • The first term, γσ2(T−t)\gamma\sigma^2(T-t)γσ2(T−t), is the price of inventory risk: it grows with risk aversion, with variance and with the time left to hold a position, and it vanishes at the horizon.
  • The second term, 2γln⁡(1+γ/k)\tfrac{2}{\gamma}\ln(1 + \gamma/k)γ2​ln(1+γ/k), comes from the fill rate. As γ→0\gamma \to 0γ→0 it tends to 2/k2/k2/k, which is the spread of a risk-neutral maker who just maximises the income 2δAe−kδ2\delta A e^{-k\delta}2δAe−kδ: the half-spread 1/k1/k1/k of "Adverse selection and informed trading" when every customer is noise.

Quotes

The maker centres the spread on the reservation price, not on the mid:

b=r−12(δa+δb),a=r+12(δa+δb).b = r - \tfrac12(\delta^a + \delta^b),\qquad a = r + \tfrac12(\delta^a + \delta^b).b=r−21​(δa+δb),a=r+21​(δa+δb).

A long maker therefore has both quotes below where a flat maker would put them: the ask is cheap and likely to sell, the bid is low and unlikely to buy, which is the skew of the previous lesson, now with a size. As the horizon approaches, T−t→0T - t \to 0T−t→0, the inventory term in the reservation price and the first term in the spread both shrink: the reservation price returns to the mid and the spread to its fill-rate term.

Worked example

Quotes at the middle of the day

  1. Take γ=0.1\gamma = 0.1γ=0.1, σ=2\sigma = 2σ=2, k=1.5k = 1.5k=1.5, mid S=100S = 100S=100, T−t=0.5T - t = 0.5T−t=0.5 and an inventory of q=6q = 6q=6 shares. The inventory shift is:

    qγσ2(T−t)=6⋅0.1⋅4⋅0.5\displaystyle q\gamma\sigma^2(T-t) = 6 \cdot 0.1 \cdot 4 \cdot 0.5qγσ2(T−t)=6⋅0.1⋅4⋅0.5=1.2
  2. The reservation price is the mid less the shift:

    r=100−1.2\displaystyle r = 100 - 1.2r=100−1.2=98.8
  3. The inventory-risk term of the spread is:

    γσ2(T−t)=0.1⋅4⋅0.5\displaystyle \gamma\sigma^2(T-t) = 0.1 \cdot 4 \cdot 0.5γσ2(T−t)=0.1⋅4⋅0.5=0.2
  4. The fill-rate term of the spread is:

    20.1ln⁡(1+0.1/1.5)=20⋅0.064539\displaystyle \tfrac{2}{0.1}\ln(1 + 0.1/1.5) = 20 \cdot 0.0645390.12​ln(1+0.1/1.5)=20⋅0.064539=1.2908
  5. The total spread is their sum:

    0.2+1.2908\displaystyle 0.2 + 1.29080.2+1.2908=1.4908
  6. The bid is half a spread below the reservation price:

    b=98.8−0.7454\displaystyle b = 98.8 - 0.7454b=98.8−0.7454=98.0546
  7. The ask is half a spread above it, well below the 100.75 a flat maker would post:

    a=98.8+0.7454\displaystyle a = 98.8 + 0.7454a=98.8+0.7454=99.5454
  8. At the close, T−t=0T - t = 0T−t=0, the spread is only the fill-rate term. With γ=0.5\gamma = 0.5γ=0.5 it is:

    20.5ln⁡(1+0.5/1.5)\displaystyle \tfrac{2}{0.5}\ln(1 + 0.5/1.5)0.52​ln(1+0.5/1.5)=1.1507

The effect of risk aversion

It is tempting to say that a more risk-averse maker always quotes wider. The two terms say otherwise. Early in the day the first term dominates and it grows with γ\gammaγ. Near the close it vanishes, and the second term, 2γln⁡(1+γ/k)\tfrac{2}{\gamma}\ln(1+\gamma/k)γ2​ln(1+γ/k), is decreasing in γ\gammaγ. At the close above, γ=0.1\gamma = 0.1γ=0.1 gives a spread of 1.2908 and γ=0.5\gamma = 0.5γ=0.5 gives 1.1507: the more risk-averse maker is tighter. A maker that fears inventory wants to trade, and near the end it has no time left to be hurt, so it quotes close to the mid to get fills.

The figure shows the quotes on a price column and the total spread against the time left for three values of γ\gammaγ. Set the inventory to 0 and move the day clock: the reservation price sits on the mid and the quotes are symmetric. Now drag the inventory to −10-10−10 and the quotes shift up. At the defaults (inventory 6, half-way through the day, γ=0.1\gamma = 0.1γ=0.1) the reservation price is 98.80, the spread 1.49, the bid 98.05 and the ask 99.55. At the start of the day the spread is 1.51 for γ=0.05\gamma = 0.05γ=0.05, 2.05 for γ=0.2\gamma = 0.2γ=0.2 and 4.27 for γ=0.8\gamma = 0.8γ=0.8. At the close the order reverses: 1.31, 1.25 and 1.07.

Reservation price and optimal quotesOpen in Avellaneda–Stoikov
6
-1010
0.50
01
0.10
-20
Ask 99.55Mid 100.00Reservation price 98.80Bid 98.05

Total spread against the time left (T − t) for three values of γ; the vertical line marks the current time.

γ = 0.05γ = 0.2γ = 0.8
Reservation price
98.80
Total spread
1.49
Bid
98.05
Ask
99.55

Symmetric and inventory strategies

Avellaneda and Stoikov compare the inventory strategy above with a symmetric one that always centres the same spread on the mid, ignoring inventory. In their simulations the symmetric maker earns slightly more on average, since it never gives up a fill to manage a position. But its inventory wanders freely, so its final profit varies much more from one day to the next. The inventory strategy gives up a little profit for a large reduction in variance, which is what a risk-averse maker with this utility function wants.

The model assumes a constant σ\sigmaσ, a smooth exponential fill rate and no informed customers. The last is a real simplification: with them the fill-rate term should be wider, as in "Adverse selection and informed trading".

Summary

  • The maker has exponential utility, a Brownian mid with volatility σ\sigmaσ and fills at rate Ae−kδA e^{-k\delta}Ae−kδ at distance δ\deltaδ from the mid.
  • The reservation price r=S−qγσ2(T−t)r = S - q\gamma\sigma^2(T-t)r=S−qγσ2(T−t) is the average of the prices at which the maker is indifferent to buying or selling one more share.
  • To first order the total spread is γσ2(T−t)+2γln⁡(1+γ/k)\gamma\sigma^2(T-t) + \tfrac{2}{\gamma}\ln(1+\gamma/k)γσ2(T−t)+γ2​ln(1+γ/k), an inventory-risk term plus a fill-rate term.
  • The quotes are r∓12r \mp \tfrac12r∓21​ of the spread: a long maker moves both below the mid, and both effects fade towards the close.
  • Higher risk aversion widens the spread early in the day and narrows it at the close, and the inventory strategy trades some mean profit for much lower variance.
Try itOpen the Avellaneda–Stoikov lab
2 questions on this lesson at the end of the series
Previous · 09Inventory risk and quote skewingNext · 11Market making profit and loss attribution
Connections

Optimal quoting: the Avellaneda–Stoikov model

Open the full graph
Builds on
07.09Inventory risk and quote skewing02.04Risk aversion and the optimal complete portfolio06.01Random walks and Brownian motion07.01Market makers and liquidity07.04Adverse selection and informed trading
Leads to
07.11Market making profit and loss attribution
See it in the knowledge graph
Labs for this lesson
Avellaneda–Stoikov