Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Market Microstructure
Order Book
Market Making
LabMarket making desk
Avellaneda–Stoikov
Glosten–Milgrom
Kyle Model
Spread Estimation
Connected Guides
  • Inventory risk and quote skewing
  • Optimal quoting: the Avellaneda–Stoikov model

© 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.

Avellaneda–Stoikov

Optimal market making with inventory risk: a reservation price that leans against your position and a spread set by risk aversion and order arrival.

Random seed: 1

Parameters

Model
0.10
0.011
2.0
0.54
1.50
0.53
Fixed (as in the 2008 paper)

s₀ = 100, T = 1, A = 140, dt = 0.005, one share per fill; fill chance A·e^(−k·δ)·dt per step, capped at 1.

Inventory, quotes and policies
Inventorylong 6
-10-50+5+10

Reservation price: r = s − q·γ·σ²·(T − t)

r = 100 − 6·0.10·4·0.50 = 98.80

Total spread: γ·σ²·(T − t) + (2/γ)·ln(1 + γ/k)

δᵃ + δᵇ = 0.10·4·0.50 + (2/0.10)·ln(1 + 0.10/1.50) = 1.491

Quotes: bid 98.05 · ask 99.55

mid100.00ask99.55bid98.05reservation98.80

About this tool

The Avellaneda–Stoikov model answers a precise question: where should a risk-averse market maker place the bid and the ask? The answer has two parts. First, the centre of the quotes is not the mid price but a reservation price that moves away from it in proportion to the inventory: r = s − qγσ²(T − t), where q is the position, γ the risk aversion, σ the volatility and T − t the time left. Second, the total spread is γσ²(T − t) + (2/γ)·ln(1 + γ/k), where k says how fast order arrivals fall off with distance. This lab turns both formulas into something you can see move.

Frequently asked questions

What is the reservation price?

It is the price at which the market maker is indifferent between holding the current inventory and not holding it. With a long position the reservation price lies below the mid, because the maker would accept a little less to get rid of risk. Quoting around it instead of around the mid skews both quotes: with a long inventory the ask becomes more attractive and the bid less so, and the position tends to shrink.

Where does the optimal spread come from?

It has two terms. The term γσ²(T − t) is compensation for the risk of holding inventory until the end of the horizon. The term (2/γ)·ln(1 + γ/k) comes from the order arrival: when arrivals fall off quickly with distance (large k), quoting wide loses too many trades, so the spread is tighter. A very risk-averse maker quotes wider to trade less often.

What should I try in the lab?

Start with zero inventory and see the quotes sit symmetrically around the mid. Then push the inventory positive and watch both quotes slide down. Raise γ and the skew grows; shorten the time left and the skew fades because there is less time for the price to move. Finally draw your own policy and compare its P&L and inventory path with the model's on the same seed.

Is a higher risk aversion always safer?

It reduces inventory swings, but it is not free. A very large γ pushes the quotes wide and skews them hard, so the maker trades less and gives away edge on almost every fill it does get. The common misconception is that zero inventory is the goal; the model actually trades a little inventory risk for spread income, and the best γ depends on how you score the result.

Learn the theory

  • Inventory risk and quote skewing — How a maker's position turns price moves into P&L, why that risk grows with position and time, and how shading both quotes pulls inventory back to zero.
  • Optimal quoting: the Avellaneda–Stoikov model — Exponential utility, fills that fall off with distance from the mid, the reservation price, the optimal spread, and how risk aversion and time shape quotes.