LLMQuant Newsletter

LLMQuant Newsletter

Optimal High-Frequency Market Making

Inside the Avellaneda-Stoikov Framework

LLMQuant's avatar
LLMQuant
Oct 28, 2025
∙ Paid

In modern financial markets, high-frequency trading (HFT) has become synonymous with speed, precision, and mathematical sophistication. Yet behind the flashing screens and algorithmic battles lies a foundational activity that keeps markets functioning smoothly: market making. Market makers stand ready to buy and sell securities continuously, ensuring that there’s always liquidity in the system. Their role is to narrow spreads, absorb shocks, and create orderly price discovery. And in the high-frequency era, this process has become almost entirely algorithmic.

This article explores one of the most influential models for algorithmic market making: the Avellaneda-Stoikov (A–S) framework. Building on the classic work of Ho and Stoll (1981), the A–S model provides a mathematical foundation for setting optimal bid and ask prices under uncertainty. The paper “Optimal High-Frequency Market Making” by Takahiro Fushimi, Christian González Rojas, and Molly Herman (Stanford, 2018) revisits and implements this model in a high-frequency setting, integrating it with an inventory control mechanism and a trading simulator. The results offer a practical look at how modern market-making algorithms balance profitability and inventory risk.


1. The Essence of Market Making

A market maker’s job is deceptively simple: continuously post buy (bid) and sell (ask) quotes for a security, hoping to profit from the spread between them. However, every trade they execute introduces a risk. If they buy too much inventory without selling, they’re exposed to price drops; if they sell too much, they risk missing upside. Managing this inventory risk is central to market-making profitability.

In traditional dealer models, such as Ho and Stoll’s, market makers adjust their bid and ask quotes based on inventory and market volatility, seeking to maximize expected utility over time. Avellaneda and Stoikov (2008) extended this framework into a stochastic control problem, making it suitable for modern electronic markets with limit order books. Their model assumes a market maker posting limit orders whose execution follows a Poisson process which is a probabilistic representation of the randomness of order fills.

The Stanford team implemented the Avellaneda–Stoikov model, but with a twist: they introduced a dynamic order size model to manage inventory risk more effectively. This approach allows a trader to continuously quote while adjusting position sizes rather than abruptly halting trading when inventory limits are reached, as in some previous models (e.g., Guéant et al., 2013). The result is a smoother, more realistic trading strategy that better reflects how professional firms operate.


2. The Avellaneda-Stoikov Pricing Model

At the heart of the A–S framework lies a utility optimization problem. The trader seeks to maximize the expected exponential utility of their wealth at a future time T:

\(u(s, x, q, t) = \max_{\delta_a, \delta_b} E_t[-e^{-\gamma (X_T + q_T S_T)}]\)

Here, γ represents risk aversion, X_T​ is the trader’s cash, q_T is​ the number of shares held, and S_T​ the terminal stock price. The bid and ask prices are defined as:

\(p_b = S_t - \delta_b, \quad p_a = S_t + \delta_a\)

The optimization must account for the randomness of both price movement and order execution. Avellaneda and Stoikov assume that the mid-price S_t​ follows a Brownian motion with volatility σ, and that order arrivals follow a Poisson process whose intensity decays exponentially with the quote’s distance from the mid-price:

\(\lambda(\delta) = A e^{-\kappa \delta}\)

This intuitively captures market behavior — the farther you quote from the current price, the less likely your order will be filled.

Solving this stochastic control problem yields two key expressions:

  1. The indifference price, reflecting the price at which the trader is indifferent to buying or selling given their inventory:

    \(r(s, t) = s - q \gamma \sigma^2 (T - t)\)

  2. The optimal spread, representing the distance between the bid and ask quotes:

    \(\delta_a + \delta_b = \gamma \sigma^2 (T - t) + \ln \left(1 + \frac{\gamma}{\kappa}\right)\)

Together, these formulas define how the market maker should quote in response to volatility, time, and risk tolerance. As time approaches the market close (t→T), the optimal spread narrows, encouraging the trader to unwind positions and minimize overnight exposure.

User's avatar

Continue reading this post for free, courtesy of LLMQuant.

Or purchase a paid subscription.
© 2026 LLMQuant · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture