Browse by type

OpenBook is a native desktop app, written in pure Rust, for reading market microstructure live on Binance (USD-M, COIN-M, spot), Bybit (linear, inverse, spot) and Hyperliquid (including trade.xyz RWA perps), or on all of them combined.
It needs no GPU shaders or web stack. The whole UI is egui meshes and one texture, so it runs on any machine with a window system: macOS, Linux and Windows.

l2Book socket channel only pushes every ~11 s, so its depth is polled over REST (every 0.5 s, spaced out to stay within half the per-IP rate limit when several markets are open, with backoff on errors). The bbo channel keeps the top of the book current between polls.OPENBOOK_DOH=off turns that off and OPENBOOK_DOH=force always uses it.egui_tiles) and layout profiles.Markets ▾ menu and it stays there while the rest follow the picker. OPENBOOK_MARKETS=btcusdt,ALL:BTC,HL:xyz:TSLA opens a list at startup (no prefix means Binance USD-M).ALL in the venue menu)BTC sums the BTC perps on Binance, Bybit and Hyperliquid; BTC+SPOT adds the spot books. Books are bucketed onto the coarsest venue tick and summed, and trades, liquidations and open interest are merged.You need Rust. The repository pins its toolchain in rust-toolchain.toml.
git clone https://github.com/DegenSugarBoo/OpenBook.git
cd OpenBook
cargo run --release
It connects to btcusdt on startup. Use the symbol picker in the header to switch symbols.
On Linux you need the usual windowing libraries (X11 or Wayland, plus libxkbcommon). Any GPU, or software rendering, that wgpu supports will do.
| Input | Action |
|---|---|
| Wheel | Time zoom, anchored at the cursor |
| ⌘/⇧ + wheel, or wheel on the price axis | Price zoom |
| Drag | Pan; dragging back to the right edge snaps to live |
| Drag an axis | Stretch that axis |
Double-click or L |
Back to live |
Space |
Pause or resume |
= / - |
Time zoom in / out |
[ / ] |
Lower / raise contrast |
T B I K |
Toggle trades, BBO, impact, book profile |
The ⓘ icon in the heatmap toolbar lists all of these.
| Pane | Controls |
|---|---|
| Ladder | Group buttons choose ticks per row; Σ toggles cumulative depth |
| Tape | Group sweeps toggle; optional minimum $ filter (applied after grouping) |
| Flow | Show or hide Normal bursts; minimum $ |
| Market impact | Order size in $ and side; the result is also drawn on the heatmap's price axis |
| Symbol picker | ↑ ↓ to move, Enter to connect, Esc to close |
src/
├── main.rs entry point and wiring
├── net/ Binance connectivity
│ ├── session.rs one select! loop per connection: sockets, resync, timers, backoff
│ ├── depth_sync.rs pure snapshot/diff bridging state machine (unit-tested)
│ ├── binance.rs endpoints, typed stream decoding, instruments
│ ├── binance_book.rs USD-M book rules over decoded frames (no I/O, replay-tested)
│ ├── http.rs shared REST client: snapshot, open interest, time, exchangeInfo
│ └── tickers.rs symbol catalog and miniTicker feed
├── market.rs venues, instruments, normalized feed events, the sink into SharedState
├── markets.rs open markets: one feed and state per (venue, symbol)
├── models.rs order book, trade and depth history, SharedState, ConnState
├── metrics.rs CVD, OFI, microprice, band depth, flow, liquidations, latency
├── micro.rs sweep engine: burst detection and absorbed/sweep/vacuum classification
├── heatmap_ring.rs ring texture renderer: bucketing, colour scale, strip uploads, mesh
├── workspace.rs dock tree, pane kinds, layout profile persistence
├── ui.rs app shell, header, panes, snapshot
└── ui/
├── heatmap_view.rs heatmap interaction, overlays, axes, crosshair
├── ladder_view.rs painted price ladder
├── tape_view.rs sweep-grouped time and sales
├── flow_view.rs sweep regimes, CVD chart, sweep timeline
├── stats_bar.rs metric chips
└── frame_probe.rs frame timing, snapshot and recording dev aids
Data flow.
SharedState behind a mutex.Arc and rebuilt only when their epoch changes.The heatmap keeps its own GPU texture and only ever uploads new columns.
More detail in the docs:
These figures are from an Apple M4 on live BTCUSDT. Full method and numbers are in docs/BENCHMARKS.md.
| Frame rate while live | 60 fps, one dropped frame in 200 s |
| Uncapped frame rate | ~440 fps live; whole-UI CPU 0.36 ms per frame (headless) |
| App code per frame | 1.0–1.3 ms p50, 1.8–2.6 ms p99 (combined book: 1.3 / 2.9 ms); varies with how busy the market is |
| Heatmap zoom frame | 0.021 ms, was 6.9 ms |
| Memory | ~200 MB, flat; was ~700 MB and growing |
Measure it yourself:
OPENBOOK_FRAME_STATS=1 cargo run --release # live frame stats every 10 s
cargo test --release heatmap_ring::bench -- --ignored --nocapture # renderer microbenchmark
cargo test --release frame_bench -- --ignored --nocapture # whole-UI frame benchmark
OPENBOOK_NO_VSYNC=1 OPENBOOK_FRAME_STATS=1 cargo run --release # uncapped fps
Screenshots:
OPENBOOK_WINDOW=1000x624 cargo run --release # window size in points
OPENBOOK_SNAPSHOT=out.ppm OPENBOOK_SNAPSHOT_SECS=20 cargo run --release # one frame, then quit
cargo test # unit tests
cargo test -- --ignored live_ # live tests against Binance (network)
cargo clippy --all-targets -- -D warnings
cargo fmt
CI runs fmt, clippy and tests on Linux, macOS and Windows.
browse all types & interfaces →
$ claude mcp add OpenBook \
-- python -m otcore.mcp_server <graph>