Eliminate ~4,260 clippy deny-level errors that blocked workspace-wide clippy runs. Errors cascaded: upstream crate failures (ctrader-openapi, risk-data) hid thousands of downstream errors in ml, tli, backtesting. Key changes: - ctrader-openapi: fix shadow_unrelated/shadow_reuse (renamed vars) - risk-data/risk: replace non-ASCII em dashes with ASCII equivalents - tli: allow deny lints on prost-generated proto code, fix shadows - trading_engine: fix let_underscore_must_use, wildcard matches, shadows - broker_gateway_service: allow dead_code on unused redis_client field - ml (4030 errors): remove local deny overrides for unwrap/expect/indexing (workspace warn level sufficient), add crate-level allows for non-safety mass-violation lints (non_ascii_literal, shadow_*, str_to_string, etc.), batch-fix em dashes, unseparated literal suffixes, format_push_string, wildcard matches, impl_trait_in_params, mutex_atomic, and more - backtesting: replace unwrap() on first()/last() with match destructure - tests: simplify loop-that-never-loops, fix mutex unwrap Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
adaptive-strategy
Adaptive trading strategy framework combining ensemble ML models, execution algorithms, market microstructure analysis, and risk management.
Overview
AdaptiveStrategy is the top-level type. It wraps an EnsembleCoordinator in Arc<RwLock> and coordinates predictions from four model types -- DQN, PPO, TFT, and Mamba2 -- loaded via InferenceAdapterBridge from the ml crate.
EnsembleConfig is re-exported from ml (not defined in this crate).
Modules
- config -- Strategy configuration, seeded IDs (
default-production,development,aggressive) - ensemble --
EnsembleCoordinator, model weighting, signal aggregation - execution -- TWAP, VWAP, Implementation Shortfall, POV, Arrival Price algorithms
- microstructure -- Order book analysis, trade flow classification, price impact modeling
- regime -- Market regime detection (HMM, threshold, ML-based)
- risk -- Position sizing (Kelly, risk parity, vol targeting), portfolio limits, drawdown monitoring
Features
| Cargo feature | Description |
|---|---|
postgres |
Hot-reload strategy config from PostgreSQL |
Usage
use adaptive_strategy::{AdaptiveStrategy, StrategyConfig};
let config = StrategyConfig::default();
let strategy = AdaptiveStrategy::new(config).await?;
Testing
SQLX_OFFLINE=true cargo test -p adaptive-strategy --lib
Dependencies
Core: tokio, candle-core, serde, tracing, chrono
ML models provided by the ml crate.