Skip to content

Commit 44298c4

Browse files
committed
chore: update README.md
1 parent f522889 commit 44298c4

2 files changed

Lines changed: 39 additions & 25 deletions

File tree

README.md

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,57 @@
11
# BINANCE PERP L3 Order Book Estimator
22

3-
![Demo GIF](demo.gif)
3+
![Demo GIF](demo2.gif)
44

5-
This project is a real-time visualization tool for the Binance perpetual swap order book. The tool uses L2 data's change in time to naively estimate a L3 order book microstructure. we can change to more complex model to estimate the L3 book later.
5+
This project is a high-performance real-time visualization tool for the Binance perpetual swap order book. It leverages **Execution-Aware Queue Dynamics (EAQD)** to estimate a Level 3 (L3) order book microstructure from Level 2 (L2) events and real-time trade streams, providing deep insights into order queue seniority and market participant behavior.
66

7-
## Features
7+
## Key Features
88

9-
* **Real-time Data**: Streams order book data using Binance's WebSocket API.
10-
* **Bid/Ask Visualization**: Displays the current bids and asks for the binance perpetual swap.
11-
* **Order Queue Estimation**: Estimates the order queue at each price level using L2 data.
12-
* **Dynamic Bar Coloring**: Bid and ask bars are dynamically colored based on the age of the order.
13-
* **K-Means Cluster**: Auto classification for different market participants
9+
* **Real-time Data Architecture**: Low-latency streaming of order book depth and trade events via Binance WebSocket API.
10+
* **Advanced L3 Estimation**: Moves beyond naive estimation to account for execution priority, cancellation behavior, and market regime.
11+
* **Microstructure Metrics Panel**: Dedicated real-time dashboard for high-resolution microstructure health indicators.
12+
* **Order-to-Trade Ratio (OTR)**: Tracks liquidity provision intensity at Top-1 and Top-20 levels.
13+
* **Cancellation-to-Trade Ratio (CTR)**: Monitors cancellation/spoofing velocity across sides.
14+
* **Dynamic Heatmap Visualization**: Standardized depth heatmap using Z-score normalization with interactive controls.
15+
* **Interactive Analytics**: Sweep/Liquidity-Cost windows with right-click drag-to-zoom and multi-axis rendering.
16+
* **K-Means Clustering**: Real-time classification of market participants based on order size and arrival patterns.
1417

15-
## Usage
16-
17-
#### From Source
18+
## Technical Core
1819

19-
To try out the project, ensure you have Rust installed. You can install it from [https://www.rust-lang.org](https://www.rust-lang.org).
20+
The estimator utilizes several proprietary techniques to maintain a ground-truth-aligned L3 view:
2021

21-
1. Clone the repository:
22+
### 1. Execution-Aware Queue Dynamics (EAQD)
23+
Refined logic for inflow and outflow handling. Unlike static models, EAQD understands the difference between fills (FIFO consumption) and cancellations (LIFO/Priority-based reduction).
2224

23-
```bash
24-
git clone https://github.com/OctopusTakopi/binance_l3_est.git
25-
cd binance_l3_est
26-
```
25+
### 2. Deep Depth Fragmentation (DWF)
26+
Also known as Statistical Order Flow Profiling (SOFP). This system fragments large L2 liquidity additions into multiple virtual orders based on a rolling distribution of market trade sizes, preventing the "giant single order" bias in naive estimators.
2727

28-
2. Run the project with a trading pair of your choice:
28+
### 3. Marker-Triggered Queue Refining (MTQR)
29+
Integrates the `@trade` stream as a synchronization pulse. When a trade occurs at a specific price, MTQR validates the maker's size against our estimated queue. If a trade exceeds our front-of-queue estimate, the model "snaps" to the ground truth and adjusts seniority accordingly.
2930

30-
```bash
31-
cargo run -r
32-
```
31+
### 4. Seniority Decay & Priority Reset
32+
Handles partial fills and order modifications. Partial fills retain their queue position, while modifications that increase size or change price trigger a priority reset, accurately reflecting exchange matching engine logic.
3333

34-
#### From Release Binary
34+
## Usage
3535

36-
Visit the [Releases page](https://github.com/OctopusTakopi/binance_l3_est/releases) and download the latest binary release.
36+
#### From Source
3737

38-
The chart dynamically updates as new WebSocket messages are received, and the bars for bids and asks are color-coded based on the order age, in K-means mode it based on the order size.
38+
Ensure you have Rust installed ([rust-lang.org](https://www.rust-lang.org)).
3939

40-
> **Note:** Allow enough time for the estimator to start working as it processes the historical L2 data.
40+
1. Clone the repository:
41+
```bash
42+
git clone https://github.com/OctopusTakopi/binance_l3_est.git
43+
cd binance_l3_est
44+
```
45+
46+
2. Run the project:
47+
```bash
48+
cargo run -r
49+
```
50+
51+
#### UI Controls
52+
* **Microstructure Toggle**: Use the UI panel to enable/disable the OTR/CTR dashboard.
53+
* **Heatmap Z-Score**: Adjust the standardization slider to highlight liquidity outliers.
54+
* **Zoom**: Right-click and drag on the liquidity charts to inspect specific price ranges.
4155

4256
## License
4357

demo2.gif

13.8 MB
Loading

0 commit comments

Comments
 (0)