Aperiodic
MarketsLive
Pricing
Get Started

Metrics library · L1 & L2 order book

L1 imbalance

Get the data
BTC-USDT perpetual on Binance, 5m bars, 1 to 31 May 2025, from the free preview. The free delayed feed doesn't carry this dataset; paid plans stream it in real time.
How it's builtBTC, May 2025FieldsDownloadFAQ

Bid size against ask size at the best quote, at the bar's close and averaged through it.

Bid/ask imbalance, ratio, percentages — both instantaneous (last) and averaged over the interval.

Built from
L1 (Top of Book)
Fields
10
Intervals
1m to 1d; 15s and 30s on Prime
Plan
Prime
Venues
Binance, OKX, Hyperliquid
Live
Real time on paid plans

How it's built

One real 5-minute bar from the free preview, field by field.

The 5m bar from 14:00 to 14:05 UTC on 14 May 2025, Binance BTC-USDT perpetual, from the free preview.

  1. Step 1

    Compare size at the best bid and ask

    imbalance=7.266 − 7.712 BTC=-0.446 BTC
    imbalance_ratio=(bid − ask) / (bid + ask)=-0.0298
    bid_percentage=bid / (bid + ask)=48.5%

    imbalance_ratio runs from −1 (nothing on the bid) to 1 (nothing on the ask). At this bar's close the two sides were nearly even.

    best ask7.712 BTC$103,805.7
    best bid7.266 BTC$103,805.6
  2. Step 2

    Last quote or bar average

    imbalance_ratio_avg=mean over every quote update in the bar=-0.1203

    The last-quote value jumps from bar to bar. The average over the bar's updates moves less. Each update counts once, however long it stood.

    0.96-0.41
    13:0514:00
    imbalance_ratio, last quoteimbalance_ratio_avg
  3. Step 3

    The unbounded ratio

    bid_ask_ratio=bid / ask, last quote=0.942
    bid_ask_ratio_avg=mean of bid / ask over updates=56.3

    The average is 56.3, though the bid held 44.0% of the size on average. A few updates with a nearly empty ask make bid / ask very large, and the mean follows them. imbalance_ratio is bounded at −1 and 1, so it does not have this problem.

  4. Step 4

    The bar

    imbalance
    -0.446 BTC
    imbalance_ratio
    -0.0298
    bid_percentage
    48.5%
    bid_ask_ratio
    0.942
    imbalance_avg
    -3.177 BTC
    imbalance_ratio_avg
    -0.1203
    bid_percentage_avg
    44.0%
    bid_ask_ratio_avg
    56.3

Does top-of-book imbalance predict BTC's next bar?

BTC's top-of-book imbalance correlated 0.38 with the move in its own bar and 0.002 with the next.

BTC-USDT perpetual on Binance, 5m bars, 1 to 31 May 2025, from the free preview.

Mean price move in the same bar
-6.71
-5.61
-4.54
-3.39
-0.664
1.45
3.71
4.83
5.65
6.50
12345678910

Bars by average top-of-book imbalance, ask-heavy to bid-heavy. Basis points.

Bars sorted by their average imbalance: the most ask-heavy tenth fell 6.71 bps on average, the most bid-heavy tenth rose 6.50 bps. The book leaned with the move as it happened.

For the next bar, the value at the close did better than the average (0.055 against 0.002), because it is the latest information. It is also noisier: in 12% of bars it sat beyond ±0.9, with one side nearly empty at that instant.

How to read it

imbalance is bid size minus ask size at the best quote. imbalance_ratio scales it from -1 (all ask) to 1 (all bid). bid_percentage and ask_percentage are each side’s share.

The _avg fields are the mean over every quote update in the interval, each update counting once. The plain fields are the last quote. They differ most when quotes were being pulled and replaced.

bid_ask_ratio grows very large when one side is nearly empty. Use the ratio scaled to ±1 instead.

imbalance
Last best-bid quantity minus best-ask quantity in the interval
imbalance_ratio
Last normalized difference between best-bid and best-ask quantity
bid_ask_ratio
Last best-bid quantity divided by best-ask quantity
bid_percentage
Last share of top-of-book quantity resting on the bid side
ask_percentage
Last share of top-of-book quantity resting on the ask side
imbalance_avg
Average best-bid quantity minus best-ask quantity in the interval
imbalance_ratio_avg
Average normalized bid-ask quantity imbalance in the interval
bid_ask_ratio_avg
Average best-bid quantity divided by best-ask quantity in the interval
All 10 fieldsFewer fields
bid_percentage_avg
Average share of top-of-book quantity on the bid side
ask_percentage_avg
Average share of top-of-book quantity on the ask side
The research behind itHide the research

Order book imbalance is arguably the single most validated short-term predictive signal in the market microstructure literature. The intuition is immediate: if there's substantially more resting size on the bid than the ask, the next price move is more likely upward.

The Cont-Kukanov-Stoikov framework

Cont, Kukanov & Stoikov (2014) provided the definitive empirical analysis, showing that order book imbalance — defined as:

OBI=Qbid−QaskQbid+QaskOBI = \frac{Q_{bid} - Q_{ask}}{Q_{bid} + Q_{ask}}OBI=Qbid​+Qask​Qbid​−Qask​​

predicts the direction of the next mid-price change with statistically and economically significant accuracy across multiple equity markets. The signal is monotonic: stronger imbalance produces larger expected price moves, and the relationship is approximately linear.

Their insight was that the imbalance captures the queue dynamics of the limit order book: when one side has substantially more depth, the probability that the opposite side is depleted first (triggering a price change toward the deeper side) increases mechanically.

Instantaneous vs. time-averaged

A single snapshot of imbalance is noisy — market makers continuously refresh quotes, and a momentary asymmetry can be an artifact of staggered updates. Huang & Polak (2011) showed that time-averaged imbalance over longer windows provides a smoother, more predictive signal that captures the sustained directional tilt of the book rather than transient fluctuations.

We compute both:

  • Last imbalance — the snapshot at interval close
  • Average imbalance — the mean imbalance across all quote updates in the interval

The divergence between them — how much the closing snapshot differs from the average — itself carries information. A large divergence indicates recent quote instability, suggesting a potential regime change within the bar.

L1 vs. L2: depth matters

Top-of-book (L1) imbalance captures only the best bid and ask. But Cao, Chen & Griffin (2005) demonstrated that information about future price changes exists at deeper levels of the book. A thin top-of-book bid sitting in front of massive size at deeper levels is structurally different from a thin bid with nothing behind it.

We compute L2 imbalance at cumulative depth tiers: 5, 10, 20, and 25 price levels per side. This captures the full shape of supply-demand imbalance, not just the frontier.

The L1-L2 divergence is the most actionable signal. When L1 shows thin bids but L2 reveals deep bid-side support, the apparent weakness is a mirage — the top-of-book thinness is likely a market maker adjusting inventory, not a genuine absence of demand. Conversely, thick L1 bids with empty L2 behind them indicate a single concentrated quote — remove that one market maker and there's a price gap.


References:

  • Cont, R., Kukanov, A. & Stoikov, S. (2014). "The Price Impact of Order Book Events." Journal of Financial Econometrics, 12(1), 47–88.
  • Huang, R. & Polak, T. (2011). "Lobster: Limit Order Book Reconstruction System." Working Paper, Humboldt-Universität zu Berlin.
  • Cao, C., Chen, Z. & Griffin, J.M. (2005). "Informational Content of Option Volume Prior to Takeovers." Journal of Business, 78(3), 1073–1109.

Download the same month

No account needed. Prime adds every venue and perp, at 1-minute to daily bars.
# Install the Aperiodic CLI into ~/.local/bin
mkdir -p "$HOME/.local/bin"
curl -fsSL https://raw.githubusercontent.com/aperiodic-io/cli/main/install.sh | INSTALL_DIR="$HOME/.local/bin" bash
export PATH="$HOME/.local/bin:$PATH"

# Free preview — no API key required
aperiodic l1_imbalance --preview \
  --exchange binance-futures \
  --symbol perpetual-BTC-USDT:USDT \
  --interval 5m \
  --timestamp exchange \
  --start-date 2025-05-01 \
  --end-date 2025-05-31 \
  --output-dir ./data && echo "Saved to $PWD/data"

Questions

Related

L2 order book imbalanceBid against ask size, 5 to 25 levels deepL1 priceBest bid and ask, mid and micropriceL1 liquiditySpread and dollars at the touch
Aperiodic

Built from hundreds of terabytes of raw data and distilled into point-in-time metrics you can pull as parquet files. Plus the raw trades, quotes and derivatives data behind them.

Use Cases
  • Improve your backtest
  • Find new alpha
  • Execute smarter
Indices
  • All indices
  • Aperiodic Cost Index
  • Aperiodic Depth Index
  • Aperiodic Impact Index
Metrics
  • Metrics library
  • Data Catalog
  • Live markets dashboard
  • Global Liquidity
  • Unusual activity
  • Order Flow
  • L1 & L2
  • Derivatives
  • RWA
  • Raw Data
Developers
  • API Docs
  • Live WebSocket Feed
  • MCP Server
  • Notebooks
  • For AI Agents
  • Atlas Security Master
  • Pre-flight
  • Changelog
  • Roadmap
  • llms.txt
Learn
  • Replays
  • Microstructure Guide
  • Architecture
  • Research Blog
  • FAQ
Compare
  • All vendors
  • vs. Tardis
  • vs. CoinGlass
  • vs. Kaiko
  • vs. Amberdata
Company
  • Pricing
  • Contact
  • Book a call
  • Terms of Service
  • Privacy Policy
  • Licensing
  • SLA

© Copyright 2026 Aperiodic. All Rights Reserved.

Aperiodic Limited · Registered in Ireland · Company No. 815273 ·
136 Capel Street, Dublin D01 T2C9, Ireland

Shown: minute closes of 847 perpetuals, 20:30–22:30 UTC on 10 Oct 2025, IOTX in orange · built with ohlcv 1m