Analytical Solutions

Closed-form and semi-analytical solutions for benchmark validation.

Avellaneda-Stoikov

The canonical market making model with constant order arrival intensity. The optimal bid and ask quotes have closed-form expressions as functions of inventory, time remaining, and model parameters.

The reservation price (indifference price) is:

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

The optimal half-spread is:

$$\delta(t) = \frac{\gamma \sigma^2 (T-t)}{2} + \frac{1}{\gamma} \ln\left(1 + \frac{\gamma}{k}\right)$$

Use as baseline

The analytical solution serves two purposes in the framework:

  1. Validation: compare finite-difference and BSDE numerical solutions against the known analytical result to verify correctness.
  2. Strategy in the engine: the solution is wrapped as a Strategy in the engine crate and can be backtested against simulated markets. Implemented as AvellanedaStoikovStrategy with optional online volatility estimation.

Limitations

The analytical solution assumes:

  • Constant volatility.
  • Constant order arrival intensity.
  • Linear inventory penalty.

For models with stochastic volatility, self-exciting intensities, or non-linear penalties, use the numerical solvers (finite difference or BSDE) instead.