Real-time BTC/USD orderbook visualizer built in Rust. Connects to Kraken WebSocket v2.
- Live orderbook with CRC32 checksum validation
- Time-travel slider (replay history)
- Depth chart
- Heatmap showing liquidity over time
cargo run --release- Ownership and borrowing
- Structs and enums for data modeling
- Pattern matching with
match - Error handling with
Resultand?operator - Async/await with tokio
- Channels (
mpsc) for async to sync communication - Iterators (
.iter(),.enumerate()) - Type conversions and trait bounds (
ToPrimitive)
- How orderbooks work (bids/asks, price levels)
- Snapshot + delta updates pattern
- CRC32 checksum for data integrity
- Desync detection and recovery (resubscribe on mismatch)
- Cumulative depth calculation
im::OrdMap- persistent data structure with structural sharing- Why cheap clones matter for time-travel/history
- Ring buffer concept for bounded memory
- egui immediate mode UI (rebuilt every frame)
- Custom drawing with
Painter - Coordinate mapping (price to Y-pixel)
- Color intensity from quantity values
- Heatmap concept: X=time, Y=price, Color=liquidity

