AS-MMAvellaneda–Stoikov market making simulator

Browser port of my model.py. A market maker quoting with the Avellaneda–Stoikov (2008) solution runs against a naive fixed-spread quoter on the same mid-price path and the same random order arrivals. Change the parameters and the whole thing reruns, including a 300-path Monte Carlo.

# reservation price, optimal spread, fill intensity
r  = s − q·γ·σ²·(T−t)
δ* = γ·σ²·(T−t) + (2/γ)·ln(1 + γ/k)
λ(δ) = A·exp(−k·δ)
Parameters
mid-price vol
CARA coefficient
fill decay vs. distance
base arrival rate
max |q|
Single path
strategyfinal PnLSharpemax drawdowntradesinventory σ
Mid, reservation price and A-S quotes

Reservation price shifts off the mid with inventory; the quote band tightens as t → T.

Inventory
PnL (mark-to-market)
Monte Carlo 300 paths, current parameters