- Added comprehensive bounds checking to prevent buffer overruns in multicall parsing - Implemented graduated validation system (Strict/Moderate/Permissive) to reduce false positives - Added LRU caching system for address validation with 10-minute TTL - Enhanced ABI decoder with missing Universal Router and Arbitrum-specific DEX signatures - Fixed duplicate function declarations and import conflicts across multiple files - Added error recovery mechanisms with multiple fallback strategies - Updated tests to handle new validation behavior for suspicious addresses - Fixed parser test expectations for improved validation system - Applied gofmt formatting fixes to ensure code style compliance - Fixed mutex copying issues in monitoring package by introducing MetricsSnapshot - Resolved critical security vulnerabilities in heuristic address extraction - Progress: Updated TODO audit from 10% to 35% complete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1.7 KiB
1.7 KiB
Simulation Tools Enhancement Plan
Goal
Align the profitability replay harness and embedded simulation helpers with production requirements: real historical data, accurate fee/slippage modelling, and automated validation in CI.
Tasks
-
Historical Data Ingestion
- Define vector schema for real opportunities (timestamp, DEX, expected vs. realized profit, route data).
- Build extraction pipeline from historical archive/DB to
tools/simulation/vectors/(with sanitised examples). - Add versioning/checksums for vectors used in CI.
-
Simulation Accuracy
- Replace hard-coded fees/reserves (
tools/simulation/main.go) with per-exchange metadata. - Model slippage, gas costs, and failed trades using observed distributions.
- Introduce configuration for latency, backrunning competition, gas spikes.
- Replace hard-coded fees/reserves (
-
Integration with Arbitrage Pipeline
- Provide CLI option to replay directly against
ArbitrageService/ executor in dry-run mode. - Emit metrics for hit rate and net profit and compare against Prometheus data.
- Provide CLI option to replay directly against
-
CI Automation
- Add
make simulate-profitto staging/audit workflows with artifact retention. - Set thresholds (e.g., net profit >0, hit rate >50%) to fail CI when regressions occur.
- Add
-
Documentation & Runbooks
- Update
docs/5_development/TESTING_BENCHMARKING.mdanddocs/6_operations/DEPLOYMENT_GUIDE.mdwith guidance on capturing vectors and interpreting reports. - Provide runbook entry for simulation dashboards and alerting.
- Update
References
tools/simulation/main.goscripts/run_profit_simulation.shpkg/arbitragesimulation helper functions