This page catalogues every configurable option across the three crates
and shows which combinations are compatible. Use it to determine what
model, solver, and engine setup fits your use case.
The solver crate provides 9 pre-built optimal control models. Each
implements ControlProblem<N> for a specific state dimension and set of
dynamics; models solved on a diffusive grid also implement the FD-specific
PdeProblem<N> transport contract. All models are solved rigorously — they
discretize the exact HJB PDE without approximation. See
Rigor Reference for the full mapping of HJB
to method.
Model N State variables HJB solved FD BSDE Rigor
AvellanedaStoikov2 q, S CARA AS HJB Yes Yes Rigorous
AvellanedaDrift2 q, S CARA AS HJB + price drift Yes Yes Rigorous
AvellanedaImpact2 q, S CARA AS HJB + market impact Yes Yes Rigorous
AvellanedaHawkes2 q, lambda CARA AS HJB + unilateral Hawkes Yes Yes Rigorous
BilateralHawkes3 q, lambda+, lambda- CARA AS HJB + bilateral Hawkes Yes Yes Rigorous
BilateralHawkesOFI3 q, lambda+, lambda- CARA AS HJB + bilateral Hawkes + OFI Yes Yes Rigorous
Heston2 q, v CARA AS HJB + Heston vol Yes Yes Rigorous
HestonHawkes3 q, v, lambda CARA AS HJB + Heston + Hawkes Yes Yes Rigorous
AmericanPut1 S Optimal stopping HJB Yes No Rigorous
Condition Value at expiry Supported by
Zero\(V(T) = 0\) for all states All 9 models
LiquidationCost\(V(T) = -\lvert q \rvert \cdot half\_spread\) AvellanedaHawkes, BilateralHawkes, BilateralHawkesOFI, Heston
Models that do not expose with_terminal_condition have hardcoded terminal
values (usually zero, or a model-specific expression like -0.5*xi*q^2 for
AvellanedaImpact). To apply uniform terminal liquidation at the backtest
level, use run_backtest_with_liquidation from the engine.
Behaviour Models
Constant volatility AvellanedaStoikov, AvellanedaDrift, AvellanedaImpact
Stochastic volatility Heston, HestonHawkes
Mean-reverting intensity AvellanedaHawkes, BilateralHawkes, BilateralHawkesOFI, HestonHawkes
Jump diffusion on price (via market_model processes fed to engine, not via solver models)
Permanent market impact AvellanedaImpact, BilateralHawkesOFI
Order flow imbalance BilateralHawkesOFI (eta_ofi > 0)
Drifting mid-price AvellanedaDrift
Both numerical solvers accept any ControlProblem<N> implementation. The
grid-based PolicyIterationSolver additionally requires PdeProblem<N> for
the implicit, Crank-Nicolson, and Strang-ADI schemes; explicit Euler only
needs ControlProblem.
Solver Method Best for Time discretisation
PolicyIterationSolverFinite difference on a grid N <= 3, high accuracy Implicit, Explicit, Crank-Nicolson, Strang ADI
BsdeSolverLeast-squares Monte Carlo regression N >= 3, scales better with dimension Forward-backward with basis functions
Solver Scheme options Linear solver
PolicyIterationSolverImplicit (default: Crank-Nicolson), Explicit, StrangAdiSOR, Thomas (tridiagonal), LAPACK dgtsv
BsdeSolverPolynomial basis (Power, Hermite, Chebyshev, Laguerre), degree 1-6, scaling wrapper Custom regression (SVD via faer)
All strategies implement Strategy and consume Observation (filtered by
ObservationFilter) to emit OrderRequests.
Strategy Table dims Solution source HJB solved Rigor
AvellanedaStoikovExactStrategy2D Exact matrix ODE tables CARA AS HJB Rigorous
AvellanedaStoikovHestonStrategy3D Precomputed FDM Heston tables CARA AS HJB + Heston vol Rigorous
AvellanedaStoikovHawkesStrategy3D Precomputed FDM Hawkes tables CARA AS HJB + Hawkes Rigorous
AvellanedaStoikovBilateralHawkesStrategy4D Precomputed FDM BilateralHawkes tables CARA AS HJB + bilateral Hawkes Rigorous
AvellanedaStoikovBilateralHawkesOFIStrategy4D Precomputed FDM BilateralHawkesOFI tables CARA AS HJB + bilateral Hawkes + OFI Rigorous
AvellanedaStoikovStrategy— AS analytical formula None (inline approximation) Approximation
ConstantSymmetricStrategy— Fixed half-spread None Heuristic
KellyStrategy2D Online mu/sigma est. + AS formula None (CARA ansatz, no log-utility HJB) Heuristic
KellyRigorousStrategy3D Precomputed FDM Kelly tables Log-utility HJB (x-reduced) Rigorous
ZeroIntelligenceStrategy— Uniform random half-spread None Heuristic
RandomStrategy— Random side + price jitter None Heuristic
SignalEngineStrategy— MA / RSI / multi-signal voting None Heuristic
ExternalStrategy— Externally injected N/A N/A
Strategy Compatible solver model
AvellanedaStoikovStrategyAvellanedaStoikov, AvellanedaDrift
AvellanedaStoikovExactStrategyAvellanedaStoikov
AvellanedaStoikovHestonStrategyHeston
AvellanedaStoikovHawkesStrategyAvellanedaHawkes
AvellanedaStoikovBilateralHawkesStrategyBilateralHawkes
AvellanedaStoikovBilateralHawkesOFIStrategyBilateralHawkesOFI
ConstantSymmetricStrategy / ZI / Random / KellyAny (model-agnostic)
Two matcher implementations determine how limit orders get filled.
Matcher Fill mechanisms Hawkes support Features
SimpleMatcherAggressive crossing at BBO No Deterministic, zero configuration
StochasticMatcherAggressive + sweep + Poisson arrival Unilateral or bilateral Configurable k, a, alpha, beta
Mode Builder a_eff(t) Parameters exposed
No Hawkes default a (constant) —
Unilateral .with_hawkes(alpha, beta)a + excitation(t) hawkes_intensity
Bilateral .with_bilateral_hawkes(alpha, beta)Separate per side hawkes_buy_intensity, hawkes_sell_intensity
Source Processes Output Ground truth
SimulatedDataSource<P>GBM, Heston, Bates BBO + vol + drift + params Optional (filtered by ObservationFilter)
ParquetDataSourceFile replay BBO only None
Function Terminal liquidation Custom lookback Use case
run_backtestNo No (default 10) Default path
run_backtest_with_liquidationYes (\(\lvert q \rvert \cdot half\_spread\)) No Consistent with LiquidationCost terminal condition
run_backtest_lookbackNo Yes (custom steps) Custom adverse selection window
Return, annualised return, volatility, Sharpe, Sortino, max drawdown,
total trades, final equity, mean/max/min inventory, adverse selection (bps),
realised edge (bps), inventory variance, PnL spread, PnL directional,
fill buy/sell counts, mean hold time, terminal liquidation cost.
Mode Constructor Visible to strategy
Transparent transparent()BBO, portfolio, volatility, drift, all parameters
Opaque opaque()BBO, portfolio only
Partial Struct fields BBO, portfolio, selected parameters via whitelist
Field Purpose
Process GBM, Heston, or Bates (configurable via VecEnvProcess enum)
Matcher StochasticMatcher with bilateral Hawkes when \(hawkes\_alpha > 0\)
Strategy ExternalStrategy (actions injected per step)
State (5D GBM) [mid, inventory, lambda_buy, lambda_sell, time]
State (6D Heston/Bates) [mid, inventory, variance, lambda_buy, lambda_sell, time]
Action (2D) [bid_distance, ask_distance] from mid
Reward PnL or DiffSharpe, minus inventory penalty
Parallelism Sequential across N independent envs