A high-performance, Rust desktop app for visualizing Binance Futures market microstructure in real time. It streams live depth + trade data, renders a Bookmap-style depth heatmap, and includes dockable analytics panes for order flow and execution impact.

@depth@100ms, @aggTrade)eframe windows (macOS/Linux/Windows)# Clone the repo
git clone https://github.com/<your-username>/cli_ob.git
cd cli_ob
# Build (release mode recommended)
cargo build --release
# Run
cargo run --release
# Compile check
cargo check
# Lint (warnings denied)
cargo clippy -- -D warnings
# Format
cargo fmt
# Tests
cargo test
On startup, the app auto-connects to btcusdt and opens the default workspace layout.
| Area | Interaction |
|---|---|
| Header | Enter symbol in picker, then Connect |
| Symbol picker | ArrowUp / ArrowDown navigate, Enter select/connect, Esc close |
| Layout menu | Toggle pane visibility, save/load layout profiles, reset layout |
| Heatmap | Mouse wheel zoom (price/time), drag pan, double-click reset view |
| Trades tape | Configure row cap and minimum notional filter |
| Market impact | Edit notional and switch Buy/Sell side |
src/
├── main.rs # Entry point + WS orchestration + snapshot sync + reconnect logic
├── models.rs # Core data models (OrderBook, trade/depth history, shared state, WS/REST types)
├── ui.rs # egui/eframe UI, pane rendering, heatmap image build, snapshot cloning
├── micro.rs # Fill:Kill burst logic, rolling KPIs, cumulative series math
└── workspace.rs # Dock layout tree, pane definitions, profile persistence + migration
Binance WS/REST ──► background tokio runtime (std::thread)
│
├─ depth updates ─► order book apply + depth event history
├─ agg trades ─► trade history + micro metrics (Fill:Kill)
└─ miniTicker ─► symbol picker live catalog rows
UI thread (egui) ──► clone_snapshot() ──► pane rendering + heatmap texture updates
spawn_ws_task) connects to Binance depth/trade streams.SharedState (OrderBook, EventDepthHistory, TradeHistory, MicroMetrics) behind Arc<Mutex<_>>.| Crate | Purpose |
|---|---|
eframe / egui |
Native GUI framework and rendering |
egui_tiles |
Dockable pane layout/workspace management |
tokio |
Async runtime for WS/HTTP background tasks |
tokio-tungstenite |
WebSocket connectivity |
reqwest |
Binance REST API calls (snapshot, exchange info, time, ticker snapshot) |
serde / serde_json |
JSON deserialization |
ordered-float |
Ordered f64 keys for BTreeMap price levels |
futures-util |
Stream utilities |
dhat (optional feature) |
Heap profiling support |
This project is licensed under the MIT License.
$ claude mcp add OpenBook \
-- python -m otcore.mcp_server <graph>