
example
code debugger
Prompt
Make the best cutting edge arbitrage engine outline here is the current one. ONYX State-of-the-Art Arbitrage Engine Technical Specification: The system uses Graph-Theoretic Formulation with Bellman-Ford-Moore and SPFA optimization for detecting all arbitrage cycles across 1000+ assets and 50+ venues, extended to Probabilistic Graphs where edge weights are random variables incorporating fill probability. Market Microstructure integration includes Order Book Imbalance (OFI) Model, Micro-Price Calculation, and VPIN for toxicity-adjusted execution probability. Machine Learning uses Hybrid Transformer+LSTM architecture with 200 engineered features (price, order book, cross-venue, flow, temporal, sentiment) achieving 34% better entry timing and 41% more arbitrage captures. Statistical Arbitrage employs State-Space Models with Conditional Factor Models and Kalman Filter for online estimation that adapts to regime changes automatically. Optimal Execution uses Almgren-Chriss Model extended for triangular arbitrage with Dynamic Programming and Reinforcement Learning (PPO/SAC) for learned execution policies. Latency Arbitrage incorporates adverse selection modeling with toxicity-adjusted fill probabilities. Event-Driven Architecture achieves <2ms end-to-end latency using lock-free ring buffers and cache-line aligned data structures. Regime Detection uses Hidden Markov Models to identify low/high volatility, trending, and mean-reverting regimes with adaptive parameter tuning. Gold-Currency arbitrage sources data from fawazahmed0/exchange-api, GoldAPI.io, and Metals-API implementing triangular, cross-exchange latency, gold-silver ratio, and futures-spot basis strategies. Oil Supply Chain module tracks tankers via AISStream.io, MarineTraffic API, and Spire Maritime with real-time flow calculations, EIA/IEA/OPEC reserve monitoring with seasonal anomaly detection, and Geopolitical Risk Index combining chokepoint disruptions, political stability, sanctions, and conflict events. Event Impact uses Causal Inference via Synthetic Control Method and Bayesian Structural Time Series plus Historical Analogue Matching with k-nearest neighbors. Risk Management implements fractional Kelly Criterion position sizing, volatility targeting, DCC-GARCH for dynamic correlation monitoring, and circuit breakers (hard: 3% daily loss, 5% drawdown, 3x vol spike; soft: 20% concentration, 0.7 correlation). Performance targets: Sharpe >2.5, Sortino >3.0, Calmar >3.0, Profit Factor >2.0, Win Rate >55%, Expected Value >5 bps per signal, ML Hit Rate >65%, Capacity >$100M AUM.