The VaR engine's get_symbol_volatility used hardcoded per-asset-class annual volatility values (e.g. 25% for equities, 80% for crypto) without any indication to operators that real market data was not being used. Now emits a tracing::warn on every static volatility lookup so operators see it in logs. Also adds a volatility_overrides HashMap<String, f64> field on VarEngine for manual per-symbol overrides until a real market data feed is integrated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
risk
Enterprise risk management for HFT.
Kill Switch
AtomicKillSwitch provides immediate trading cessation, coordinated via Redis. Supports local, remote, and Unix socket triggers.
Value at Risk
Four VaR methods plus Expected Shortfall:
- Historical Simulation
- Monte Carlo
- Parametric (variance-covariance)
- Expected Shortfall (CVaR)
Key Types
| Type | Purpose |
|---|---|
RiskEngine |
Central risk evaluation and enforcement |
AtomicKillSwitch |
Atomic trading halt with Redis coordination |
KellySizer |
Kelly criterion position sizing |
StressTester |
Extreme market scenario simulation |
ComplianceValidator |
SOX, MiFID II regulatory checks |
DrawdownMonitor |
Peak-to-trough equity tracking |
CircuitBreaker |
Threshold-based trading pauses |
CorrelationMonitor |
Cross-asset correlation tracking |
Config Presets
development_config()-- relaxed limits for local testingproduction_config()-- 5ms safety check timeout, strict position limits
Testing
SQLX_OFFLINE=true cargo test -p risk --lib # ~209 tests