RepositoryRust
DegenSugarBoo

DegenSugarBoo/OpenBook

Real-time Crypto Futures depth heatmap in Rust (egui/eframe) with live order flow and trade tape.

212stars
60forks
0issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: orderbook

#1 Repository of the week

2
TINIX TRENDING·Topic: market-microstructure

#2 Repository of the week

4
TINIX TRENDING·Topic: egui

#4 Repository of the week

OpenBook : Real-Time Crypto Order Book GUI

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.

Preview of the app showing the heatmap, order book, trade tape, and market impact panes


Features

  • Real-time Binance Futures streaming via WebSocket (@depth@100ms, @aggTrade)
  • Order book sync engine with REST snapshot + contiguous diff-depth update handling
  • Bookmap-style depth heatmap with event-driven history replay (checkpoint + delta model)
  • Live trade tape with side coloring, min-notional filter, and adjustable row cap
  • Market impact estimator for configurable notional and buy/sell side
  • Fill:Kill analytics pane with event chart, cumulative chart, ratio states, and overfill highlighting
  • Dockable multi-pane workspace (Heatmap, Order Book, Market Impact, Fill:Kill, Trades Tape)
  • Layout profiles with save/load/save-as/rename/delete and automatic migration from legacy layout formats
  • Symbol picker with searchable USDT perpetual catalog + live 24h mini-ticker data
  • Adaptive rendering cadence (higher FPS during interaction, lower FPS when idle)
  • Performance overlay for frame timing and heatmap rebuild metrics

Getting Started

Prerequisites

  • Rust (stable toolchain)
  • Desktop environment capable of running native eframe windows (macOS/Linux/Windows)

Build & Run

# 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

Dev Commands

# 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.

Controls

AreaInteraction
HeaderEnter symbol in picker, then Connect
Symbol pickerArrowUp / ArrowDown navigate, Enter select/connect, Esc close
Layout menuToggle pane visibility, save/load layout profiles, reset layout
HeatmapMouse wheel zoom (price/time), drag pan, double-click reset view
Trades tapeConfigure row cap and minimum notional filter
Market impactEdit notional and switch Buy/Sell side

Architecture

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

Data Flow

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
  1. Connection task (spawn_ws_task) connects to Binance depth/trade streams.
  2. Snapshot sync fetches REST depth snapshot, bridges buffered WS diffs, then enforces contiguous updates.
  3. State updates mutate SharedState (OrderBook, EventDepthHistory, TradeHistory, MicroMetrics) behind Arc<Mutex<_>>.
  4. UI frame loop clones immutable snapshot data and renders panes; heatmap texture rebuilds only when render inputs change.

Dependencies

CratePurpose
eframe / eguiNative GUI framework and rendering
egui_tilesDockable pane layout/workspace management
tokioAsync runtime for WS/HTTP background tasks
tokio-tungsteniteWebSocket connectivity
reqwestBinance REST API calls (snapshot, exchange info, time, ticker snapshot)
serde / serde_jsonJSON deserialization
ordered-floatOrdered f64 keys for BTreeMap price levels
futures-utilStream utilities
dhat (optional feature)Heap profiling support

Known Issues

  • Advanced zoom/pan ergonomics can still be improved for dense books.
  • Hover detail and visual ergonomics are still being iterated.
  • Memory bloat issues still persist,on active markets memory usage climbs to ~600MB on my device
  • Depth updated sometimes lag when a burst order appears,which I really cant help with cause trades data is realtime,while depth data has a 100ms update interval

License

This project is licensed under the MIT License.

Similar Projects

Discover other similar projects and AI models.

RepositoryRust
AsthaMishra/matching-engine

From-scratch limit order book + matching engine in Rust. ~100 ns book ops replaying 104M operations from real NASDAQ ITCH 5.0 data; 143-fill sweeps in 2 µs. Binary OUCH order entry, 10 µs order-to-ack.

50
Aug 14, 2026
Dataset
mileswangs/polymarket-btc-updown-5m-orderbook-tick-data

Polymarket BTC Up/Down 5m Order Book Tick Data (L2) with Chainlink TWAP Everything you need to research Polymarket BTC Up/Down 5m markets in one dataset: tick-level L2 order books, on-chain trades, and the Chainlink price they settle on. 14 consecutive days (2026-08-08 to 2026-08-21), all 4,032 BTC Up/Down 5m markets. Every order book update as Polymarket sent it, every trade and on-chain fill, plus Chainlink Data Streams and the 60s TWAP that decides each market. Collected… See the full description on the dataset page: https://huggingface.co/datasets/mileswangs/polymarket-btc-updown-5m-orderbook-tick-data.

♥0
15.2k
Dec 1, 2026
RepositoryPython
microsoft/markitdown

Python tool for converting files and office documents to Markdown.

199.6k
Dec 3, 2026
RepositoryTypeScript
microsoft/vscode

Visual Studio Code

195.9k
Nov 30, 2026
RepositoryRust
emilk/egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native

32.6k
Dec 2, 2026
RepositoryRust
anefzaoui/misterdownloadmanager

misterdownloadmanager: The ultimate open-source, clean-room download manager written from scratch in pure Rust for Windows, Mac, and Linux

21.0k
Dec 3, 2026
RepositoryRust
tangency-labs/solidcraft

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

19.7k
Dec 3, 2026
RepositoryRust
crmne/spotifast

Spotify, native and fast. One lightweight Rust app for your whole library, local playback, and Spotify Connect on Linux, macOS, and Windows.

11.0k
Dec 1, 2026
RepositoryRust
crmne/zapfast

ZapFast: a fast, native WhatsApp client in Rust and egui

5.5k
Dec 3, 2026