Files
foxhunt/trading_engine/Cargo.toml
jgrusewski 86f7f1fa76 fix: comprehensive audit — real brokers, deployment fixes, production safety
Codebase audit identified 23 findings across 4 dimensions (production safety,
code health, deployment readiness, test quality). This commit fixes all of them.

Broker execution layer (was entirely stubbed):
- Real IBKR TWS client via ibapi crate (950+ lines, feature-gated)
- ICMarkets ctrader-openapi now always-on (removed feature flag)
- Real broker routing with health monitoring and exponential backoff reconnect
- Validated against live IB Gateway Docker (6/6 connectivity tests pass)

Deployment blockers:
- Fixed 6 broken Dockerfiles (removed COPY foxhunt-deploy)
- Created foxhunt K8s namespace, secret templates, migration job
- Added liveness probes to all 7 K8s services
- IB Gateway manifest (ghcr.io/gnzsnz/ib-gateway:stable)
- IBKR credentials in Scaleway Secret Manager via Terragrunt
- Fixed port collisions and mismatches across services

Production safety (9 critical + 6 high/medium fixes):
- Asset-class-specific VaR volatility (not flat 2%)
- Real parametric VaR with z-score 95th percentile
- Kyle's lambda regression (100-bar rolling window)
- Per-feature running statistics from historical data
- VWAP-based slippage reference, regime duration tracking
- Real Databento JSON parsing for OHLCV/Trade/Quote

Code health:
- Removed #![allow(dead_code)] from ml, data, config
- Fixed log:: → tracing:: in 4 production files
- Removed dead workspace deps (ratatui, crossterm)

Verified: cargo check --workspace (0 errors), trading_engine 330 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 00:32:10 +01:00

153 lines
3.6 KiB
TOML

[package]
name = "trading_engine"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
publish.workspace = true
keywords.workspace = true
categories.workspace = true
description = "Core performance infrastructure for Foxhunt HFT system"
[dependencies]
# Internal workspace crates
common = { path = "../common" }
ctrader-openapi = { workspace = true }
ibapi = { workspace = true, optional = true }
# Core workspace dependencies - USE WORKSPACE DEFAULTS
tokio = { workspace = true, features = ["process"] }
serde.workspace = true
serde_json.workspace = true
uuid.workspace = true
thiserror.workspace = true
anyhow.workspace = true
tracing.workspace = true
async-trait.workspace = true
# Financial and numerical types - USE WORKSPACE DEFAULTS
rust_decimal.workspace = true
chrono.workspace = true
# High-performance data structures
dashmap.workspace = true
crossbeam-queue.workspace = true
crossbeam-utils.workspace = true
# Memory safety and concurrent data structures
once_cell.workspace = true
# System-level dependencies for CPU affinity and performance
libc.workspace = true
num_cpus.workspace = true
# Validation and text processing
regex.workspace = true
cron = "0.12"
# OpenTelemetry removed - not used in HFT performance code
# Database integration and persistence layer - OPTIMIZED
sqlx = { workspace = true, optional = true }
redis.workspace = true
influxdb = { version = "0.7", optional = true }
clickhouse = { version = "0.11", optional = true }
# Metrics and monitoring
prometheus.workspace = true
# OpenTelemetry REMOVED - too heavy for HFT, use simple logging instead
# opentelemetry.workspace = true
# opentelemetry-otlp.workspace = true
# opentelemetry_sdk.workspace = true
# Performance monitoring - USE WORKSPACE
hdrhistogram.workspace = true
parking_lot.workspace = true
# Utilities
lazy_static.workspace = true
lru = "0.12"
hostname = "0.4"
md5 = "0.7"
log = "0.4"
# SIMD optimization (conditional)
wide = { version = "0.7", features = ["serde"], optional = true }
# Compression for event storage
flate2.workspace = true
# Encryption for audit trails (SOX/MiFID II compliance)
aes-gcm = "0.10"
chacha20poly1305 = "0.10"
zeroize = "1.7"
rand = "0.8"
# Networking
reqwest = { workspace = true }
url = { workspace = true }
sha2 = { workspace = true }
# AWS SDK removed - using S3 through storage crate
tokio-util = { version = "0.7", features = ["io"], optional = true }
[dev-dependencies]
proptest.workspace = true
futures.workspace = true
criterion = { version = "0.5", features = ["html_reports", "async_tokio"] }
hdrhistogram = "7.5"
wiremock = "0.6"
rust_decimal_macros = "1.35"
serial_test = "3.0"
tempfile = "3.13"
[features]
default = ["serde", "simd", "std", "brokers", "persistence"]
profiling = []
serde = []
simd = ["wide"]
packed-simd = ["simd"]
avx2 = ["simd"]
avx512 = ["simd", "avx2"]
std = []
persistence = ["sqlx"]
database-conversions = ["sqlx"]
brokers = ["interactive-brokers"]
interactive-brokers = ["dep:ibapi"]
paper-trading = []
benchmarks = []
influxdb-support = ["influxdb"]
clickhouse-support = ["clickhouse"]
s3-archival = ["tokio-util"]
python = []
unstable = []
[build-dependencies]
autocfg = "1.1"
[lints]
workspace = true
# Configuration for documentation
[package.metadata.docs.rs]
features = ["simd", "avx2", "database-conversions"]
rustdoc-args = ["--cfg", "docsrs"]
[[bench]]
name = "e2e_performance"
harness = false
[[bench]]
name = "e2e_latency"
harness = false
[[bench]]
name = "comprehensive_performance"
harness = false