Turuant

Home / Insights

The mathematics of market making: inventory risk and quoting

On paper, a market maker's job is simple: quote on both the bid and the ask at the same time and earn the spread. In practice, the real question is this: where should you place your prices while inventory you do not want keeps building up?

The problem: the spread is income, inventory is risk

A market maker quoting symmetrically around the mid price earns the spread if two-way flow is balanced. But flow is rarely balanced. As the price rises, buyers lift your offer; as it falls, sellers hit your bid. The result is that inventory builds up just as the market moves against you. The spread you earn can look small next to the price risk your inventory carries.

A good quoting strategy therefore has to answer two questions together: how wide should the spread be, and where should the centre of your quotes move as inventory changes?

The Avellaneda–Stoikov framework

The 2008 paper by Marco Avellaneda and Sasha Stoikov gives a closed-form answer to this question. The model rests on the following assumptions:

  • The mid price s follows a random walk with volatility σ.
  • If your quote sits δ away from the mid price, the intensity of incoming orders decays as λ(δ) = A·e−kδ. The further away you quote, the fewer trades you get.
  • The market maker is risk averse, with risk aversion γ, trading horizon T and inventory q.

The reservation price

The model's first result is that quotes should be centred not on the mid price but on the reservation price:

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

If you are long (q > 0), the reservation price falls below the mid: you become more willing to sell and less willing to buy. The size of the shift is proportional to inventory, risk aversion, the square of volatility and the time remaining. In a volatile market, or early in the session, the same inventory calls for a much bigger shift.

The optimal spread

The second result is the total distance between the two quotes:

δᵃ + δᵇ = γ · σ² · (T − t) + (2 / γ) · ln(1 + γ / k)

The first term is the price of inventory risk; the spread widens as volatility and remaining time increase. The second term comes from the structure of order flow: if k is large, meaning flow is sensitive to price, the spread must be tighter, because moving even slightly away costs you trades.

The bid and ask are placed on either side of the reservation price, each half a spread away.

A numerical example

Consider an instrument with a mid price of 100 TRY. The parameters are illustrative: γ = 0.1, σ = 0.5 (TRY / √session), k = 15, and one session remaining. Inventory q is measured in units of, say, one thousand lots.

With these values the total spread is about 0.158 TRY and the half-spread about 0.079 TRY. The reservation price shifts by 0.025 TRY per unit of inventory.

Inventory (q)Reservation priceBidAsk
−5 (short)100.125100.046100.204
0100.00099.921100.079
+5 (long)99.87599.79699.954

The last row is the striking one: with five units of long inventory, the ask drops to 99.954 TRY, below the mid price. The model explicitly recommends giving up part of the spread to work the inventory down.

From model to market: what to watch for

1. The end-of-session horizon

The T − t term shrinks the inventory penalty as the session end approaches. For a market maker who does not carry positions overnight, that is the wrong way round; inventory has to be flat by the close. In practice a fixed horizon is used, or the inventory-bounded, infinite-horizon approach of Guéant, Lehalle and Fernandez-Tapia (2013) is preferred.

2. Tick size

The model assumes continuous prices, while exchanges trade in ticks. If the spread is only a few ticks wide, the shift in the reservation price is often less than one tick, and rounding erases what the model is telling you. In that case inventory is managed through quote size rather than price: quote larger on the side where you carry too much and smaller on the other.

3. Informed flow

In the model, orders arrive independently of price. In reality, some of the orders that hit your quotes come from participants who know where the price is going before you do. This adverse selection means the spread must be kept wider than the model suggests and order flow must be measured continuously.

4. Obligations

Liquidity provision and market-making agreements usually come with obligations such as a maximum spread, a minimum size and a minimum time on quote. If the model's spread is wider than allowed, the limit becomes binding. The optimisation then has to be rebuilt under that constraint, with inventory risk managed through size adjustments and hedging in a related instrument.

Conclusion

The Avellaneda–Stoikov model is not a trading strategy on its own, but it turns the core tension of market making, the trade-off between spread income and inventory risk, into something you can tune with a single parameter (γ). The work in the field is making that framework fit tick sizes, informed flow and obligations.

References

  • Avellaneda, M. and Stoikov, S. (2008). High-frequency trading in a limit order book. Quantitative Finance, 8(3), 217–224.
  • Guéant, O., Lehalle, C.-A. and Fernandez-Tapia, J. (2013). Dealing with the inventory risk: a solution to the market making problem. Mathematics and Financial Economics, 7(4), 477–507.

This article is for general information only and is not investment advice. Numerical examples are illustrative.

← Insights