market_model

The simulation layer. Provides stochastic processes, the SimulationRunner, model-agnostic strategies, and synthetic order book generation.

What is currently available

8 stochastic processes, all implementing Simulatable:

Processdim()State typeDescription
GeometricBrownianMotion1f64Log-normal asset prices
OrnsteinUhlenbeck1f64Mean-reverting diffusion
CoxIngersollRoss1f64Non-negative mean-reverting diffusion
HestonProcess2(price, variance)Stochastic volatility with correlation
JumpDiffusion1f64GBM with compound Poisson jumps
BatesProcess2(price, variance)Heston with jumps on the price
HawkesProcess0intensity f64Self-exciting point process with configurable kernel
RoughOrnsteinUhlenbeck1RoughOUStateFractional OU via multi-factor Markovian approximation

3 strategy types implementing PriceStrategy:

StrategyDescription
MaCrossoverLong when fast MA above slow MA
RsiStrategyLong on oversold, short on overbought
BuyAndHold / AlwaysFlatBaselines (always long / never trade)

Simulation runner with:

  • Pre-generated random normals (no RNG in the hot loop)
  • SOA (structure-of-arrays) output layout for cache efficiency
  • rayon parallel path execution
  • Deterministic seeding for reproducibility
  • Criterion benchmarks for GBM and Heston at multiple path counts

Order book stubs (order_book/ module): placeholder traits for OrderFlowProcess and OrderBook. L1 BBO generation is available through the engine's SimulatedDataSource. Full L3 generation with Hawkes order flow is planned.

What is not yet available

  • L2 or L3 order book depth simulation (L1 BBO generation only)
  • Order flow processes (Poisson, Hawkes bilateral)
  • GPU-accelerated path simulation
  • Multi-asset correlation matrix support in the runner