top of page

Understanding High-Frequency Market Making from Classic Literature

This article primarily uses the Avellaneda & Stoikov (2008) model as a foundation to preliminarily explore some core concepts of high-frequency market making, supplemented by simulation explanations.

文章背景.png

1. What is a Market Maker?

A market maker is an ancient and widespread profession. Not only do modern financial institutions like Goldman Sachs and Morgan Stanley play the role of market makers across various markets, but even local street vendors selling vegetables effectively serve as "market makers" in their own way. In this light, market making is not something mysterious at all.

A market maker “doesn’t produce water” itself but acts as “the transporter of nature.” Liquidity is inherently abstract, but at the trading level, it manifests as smoother transaction flows—namely, narrower bid-ask spreads and deeper order books. In a more liquid market, a large order will have significantly less price impact, and prices tend to be more “resilient.”

In Crypto markets that trade 24/7, market making is essential to the overall ecosystem. At its core, market making is “a business of flow.” A typical high-frequency market maker usually posts very tight buy and sell quotes simultaneously. Through low buying and high selling, they aim to earn modest but frequent profits from the bid-ask spread, while continuously providing liquidity. Everything sounds great so far—but violent market swings can cause imbalances in the market maker’s inventory. Without a well-designed model for guidance, it becomes extremely difficult for a market maker to operate sustainably.

2. Simplified Description of the Avellaneda-Stoikov (AS) Model

The AS model makes the following assumptions:

The stock price follows an arithmetic Brownian motion: dSt = σ dWt

The market maker trades via limit orders, and order arrivals follow a Poisson process, with intensity depending on the quoted spread. Here’s an interesting detail: the AS model assumes that the stock price has no drift term, i.e., it performs a random walk. While this may sound counterintuitive, it’s actually quite reasonable in high-frequency market making, where short-term price directionality is extremely difficult to predict.

The essence of the AS model lies in several key formulas:

Reservation Price: r = s − q γ σ² (T − t), where s is the current mid-price, q is the current inventory, γ is the risk aversion coefficient, σ is the volatility, T−t is the remaining time horizon.

Optimal Spread: δask + δbid = γ σ² (T − t) + 2 γ ln(1 + γ⁄κ)

where δask and δbid are the optimal distances of the ask and bid prices from the reservation price, σ² is the price variance, T − t is the remaining time from the current moment to the end of the trading horizon (which can be set flexibly in crypto markets), and κ is the order arrival liquidity parameter.

As the saying goes, “There is no deal that can’t be made—only prices that don’t match.” This formula shows that the optimal spread comprises two parts: inventory risk compensation γ σ² (T − t), and liquidity compensation 2 γ ln(1 + γ⁄κ).

3. Numerical Examples

We use Python code to visualize the formulas of the AS model.

Reservation price: r=99.968000

Optimal bid quote: bid=99.314615

Optimal ask quote: ask=100.621385

Optimal spread δ∗=1.306770

After writing the calculation function above, we can generate a matrix with inventory levels as rows and volatility values as columns. Each element in the matrix corresponds to the tuple (reservation price, optimal bid quote, optimal ask quote, optimal spread): 

2D Matrix (Reservation Price)

sigma            0.3             0.4            0.5           0.6           0.7          0.8

inventory

-50.0         100.45      100.80      101.25      101.80      102.45      103.20

-40.0         100.36      100.64      101.00      101.44      101.96      102.56

-30.0         100.27      100.48      100.75      101.08      101.47      101.92

-20.0         100.18      100.32      100.50      100.72      100.98      101.28

-10.0         100.09      100.16      100.25      100.36      100.49      100.64

0.0            100.00      100.00      100.00      100.00      100.00      100.00

10.0           99.91        99.84        99.75        99.64        99.51        99.36

20.0           99.82        99.68        99.50        99.28        99.02        98.72

30.0           99.73        99.52        99.25        98.92        98.53        98.08 

40.0           99.64        99.36        99.00        98.56        98.04        97.44

50.0           99.55        99.20        98.75        98.20        97.55        96.80

2D Matrix (Optimal Bid Quote)

sigma            0.3            0.4            0.5            0.6            0.7            0.8

inventory

-50.0          99.80        100.15      100.59      101.14      101.78      102.52

-40.0          99.71         99.99       100.34      100.78      101.29      101.88

-30.0          99.62         99.83       100.09      100.42      100.80      101.24

-20.0          99.53         99.67       99.84        100.06      100.31      100.60

-10.0          99.44         99.51       99.59        99.70        99.82        99.96

0.0             99.35         99.35       99.34        99.34        99.33        99.32

10.0           99.26         99.19       99.09        98.98        98.84        98.68

20.0           99.17         99.03       98.84        98.62        98.35        98.04

30.0           99.08         98.87       98.59        98.26        97.86        97.40

40.0           98.99         98.71       98.34        97.90        97.37        96.76

50.0           98.90         98.55       98.09        97.54        96.88        96.12

2D Matrix (Optimal Ask Quote)

sigma            0.3            0.4            0.5            0.6            0.7            0.8

inventory

-50.0          101.10      101.45      101.91      102.46      103.12      103.88

-40.0          101.01      101.29      101.66      102.10      102.63      103.24

-30.0          100.92      101.13      101.41      101.74      102.14      102.60

-20.0          100.83      100.97      101.16      101.38      101.65      101.96

-10.0          100.74      100.81      100.91      101.02      101.16      101.32

0.0             100.65      100.65      100.66      100.66      100.67      100.68

10.0           100.56      100.49      100.41      100.30      100.18      100.04

20.0           100.47      100.33      100.16       99.94        99.69        99.40

30.0           100.38      100.17       99.91        99.58        99.20        98.76

40.0           100.29      100.01       99.66        99.22        98.71        98.12

50.0           100.20      99.85         99.41        98.86        98.22        97.48

2D Matrix (Optimal spread)

sigma            0.3            0.4            0.5            0.6            0.7            0.8

inventory

-50.0             1.3           1.31          1.32          1.33          1.34          1.35

-40.0             1.3           1.31          1.32          1.33          1.34          1.35

-30.0             1.3           1.31          1.32          1.33          1.34          1.35

-20.0             1.3           1.31          1.32          1.33          1.34          1.35

-10.0             1.3           1.31          1.32          1.33          1.34          1.35

0.0                1.3           1.31          1.32          1.33          1.34          1.35

10.0              1.3           1.31          1.32          1.33          1.34          1.35 

20.0              1.3           1.31          1.32          1.33          1.34          1.35 

30.0              1.3           1.31          1.32          1.33          1.34          1.35 

40.0              1.3           1.31          1.32          1.33          1.34          1.35 

50.0              1.3           1.31          1.32          1.33          1.34          1.35 

From the simulation matrix above, we can observe the following:

 

1. Reservation price (the public fair price as perceived by the market maker) increases with volatility and inventory level. When the inventory is significantly short and volatility is high, the reservation price increases. Similarly, when the inventory is significantly long and volatility is high, the reservation price decreases. This reflects the market maker’s aversion to both inventory risk and volatility risk. When the inventory is zero, the reservation price is immune to volatility.

 

2. Optimal bid quote, calculated as reservation price minus half the spread, also follows the same relationship with volatility and inventory. When the short inventory exposure is large and volatility is high, the optimal bid quote can exceed 100, which can be interpreted as a market order. Note that when the inventory is zero, the bid quote becomes less sensitive to volatility.

 

3. Optimal ask quote, calculated as reservation price plus half the spread, follows the same pattern. When the inventory is significantly long and volatility is high, the optimal ask quote may drop below 100, which can also be interpreted as a market order. Note that when the inventory is zero, the ask quote becomes less sensitive to volatility.

 

4. Optimal spread is not affected by the inventory level, but only by volatility. The higher the volatility, the wider the bid-ask spread.

4. Conclusion

This article, based on the Avellaneda & Stoikov (2008) model, introduces the basic principles of high-frequency market making, illustrates the model’s logic, and presents a data-driven simulation to demonstrate the quoting mechanics derived from the model.

bottom of page