OLIVER SCOTT
Projects / Trading · Microstructure

Market making under inventory risk

stochastic controlPoisson fillssimulation
AbstractA dealer quotes both sides of an asset and earns the spread, but every fill moves inventory and exposes it to price risk. I simulate the Avellaneda-Stoikov (2008) solution, which shades both quotes by current inventory and risk aversion γ, against a benchmark quoting the same average spread around the mid. Across 1,000 sessions the inventory-aware dealer keeps most of the profit at half the risk, matching the paper.
64.8mean P&L, inventory-aware (naive 68.5)
6.3P&L std (naive 13.6)
2.2mean |inventory| at close (naive 6.7)
1,000simulated sessions per configuration

01Model

mid: ds = σ dW reservation: r = s − q·γ·σ²·(T − t) total spread: δa + δb = γ·σ²·(T − t) + (2/γ)·ln(1 + γ/k) fill intensity: λ(δ) = A·exp(−k·δ)

Parameters follow the paper: σ = 2, A = 140, k = 1.5, T = 1, dt = 0.005, starting price 100. Fills are Bernoulli draws with probability λ·dt each step.

02Results

P&L histograms and inventory paths
Fig. 1 Left: the inventory-aware dealer's P&L distribution is far tighter. Right: its inventory is pulled back towards zero; the naive dealer's wanders.
γStrategyMeanStdMean/Std5th pct|q| at close
0.01inventory68.39.17.554.34.1
0.01symmetric69.014.14.949.36.9
0.1inventory64.86.310.254.42.2
0.1symmetric68.513.65.047.96.7
0.5inventory48.55.98.239.21.5
0.5symmetric59.912.05.041.05.3

Higher γ means more risk aversion: tighter inventory, lower mean, but a steadier ratio of mean to risk. The paper reports 65.0 ± 6.6 against 68.4 ± 13.4 at γ = 0.1; this simulation gives 64.8 ± 6.3 against 68.5 ± 13.6.

03What this model leaves out

  • Adverse selection: fills here are uninformed. Real fills cluster before the price moves against you.
  • Queue position and tick size: quotes are continuous; real books are discrete and first-come first-served.
  • Fees and rebates, which often decide whether a quoting strategy is profitable at all.

04What I'd do next

  • Add informed order flow and measure the extra spread needed to break even.
  • Replay a real order book and quote with queue position modelled.