Rewrite 7 crate READMEs to reflect current architecture: correct model types (DQN/PPO/TFT/Mamba2), AtomicKillSwitch, real EnsembleConfig source from ml, actual data crate purpose, web-dashboard project details, ml_training_service ports. Fix 5 api_gateway/TLI docs: strip swarm agent framing, update service endpoints to api_gateway:50050, remove deleted dashboard references and hardcoded paths. Add missing web-gateway/README.md documenting 24 REST endpoints, WebSocket support, JWT auth, and 3-tier rate limiting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1.1 KiB
Markdown
41 lines
1.1 KiB
Markdown
# 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 testing
|
|
- `production_config()` -- 5ms safety check timeout, strict position limits
|
|
|
|
## Testing
|
|
|
|
```bash
|
|
SQLX_OFFLINE=true cargo test -p risk --lib # ~209 tests
|
|
```
|