I've built a real-time triangular arbitrage detection system as my first Rust project and would love feedback from more experienced Rustaceans.
What it does: Connects to Kraken's WebSocket API, maintains live order books across 8 trading pairs using Arc<RwLock<T>>, and detects triangular arbitrage opportunities in real time, displaying everything via a ratatui TUI.
I'm particularly interested in feedback on:
- Whether my
Arc<RwLock<T>>usage and locking strategy is idiomatic - The task structure in
main.rs— spawning three independent Tokio tasks and coordinating shutdown - Error handling with
anyhow— is this appropriate, or should I be using typed errors? - Anything that feels un-idiomatic or that a Rust developer would raise an eyebrow at
GitHub: link
Thanks in advance — any level of feedback is welcome, from high-level architecture down to naming conventions.