Before we start: our Black Friday offer ends tonight, 1 December midnight. Up to 50% off.
Order-book imbalance is one of the most common short-horizon features in microstructure models. We tested two things on crypto perpetuals: whether it predicts the next 5-minute return, and whether it matters if you read it at the bar close or as an average over the bar.
It does, weakly, and only at the close. On the BTC-USDT perpetual on Binance, over two years of 5-minute bars (December 2024 to November 2026, about 210,000 bars), the top decile of closing imbalance had a 52.6% hit rate on the next bar, against 46.6% for the bottom decile and 49.7% unconditionally. Hit rate here is the share of next-bar returns above zero. Mean forward returns rise almost monotonically across deciles, from -0.7 to +0.6 bps.
The bar-average reading has no predictive power: its correlation with the next bar’s return is zero to three decimals, against 0.026 at the close.
Caveat: the D10-D1 spread is about 1.3 bps, below a taker’s round-trip fees. It is an input for timing and models, not a standalone strategy.
This is the first post in a series where we take one metric we serve and test it on real data.
Definition
Imbalance = (bid size - ask size) / (bid size + ask size), summed over the top N levels of each side. It ranges from -1 (asks only) to +1 (bids only). The mid moves when the queue at the best price depletes on one side, so relative queue size is a proxy for which side goes first. Gould and Bonart (2016) show this for queue imbalance at the best quotes in large-tick stocks.
Our l2_imbalance dataset has it at 5, 10, 20 and 25 levels; l1_imbalance has the best bid and ask. I use the top 5 levels below.
Close vs bar average
Each bar has two readings: imbalance_ratio_5, the value at the bar’s last quote update, and imbalance_ratio_5_avg, the time average over every update inside the bar. Within five minutes traders add and cancel orders many times, so the average moves far less: its standard deviation is a quarter of the close’s (0.15 vs 0.59 over the sample).
Sorted into deciles, only the closing value orders forward returns:
A correlation of 0.026 over about 210,000 observations is roughly 12 standard errors from zero.
Depth adds little. The correlation ranges from 0.025 to 0.027 between the best bid and ask alone and the top 25 levels, and the D10-D1 spread stays between 1.2 and 1.4 bps.
Stability over time
To check for decay, I re-estimated the deciles every month and compared the top decile’s hit rate with that month’s unconditional hit rate.
The excess was positive in 23 of 24 months. The exception, February 2026, was -0.1 pp. The second year was weaker than the first: a top-decile hit rate of 52.1% against 53.2%.
Across assets and venues
We ran the same test on BTC, ETH and SOL on Binance, OKX and Hyperliquid. Hyperliquid data starts in January 2025, so it covers 23 months.
BTC and ETH show a positive excess in all but one or two months on every venue. Hyperliquid has the strongest effect for all three assets: for BTC, a 54.5% hit rate in the top decile against 44.0% in the bottom. SOL on Binance and OKX is the exception, with an excess of about 1 pp that is positive in only 14 and 17 of 24 months.
We have no explanation for the venue differences yet. Candidates we want to test: book depth relative to typical trade size, fee structure, and the share of flow from market makers.
Use
At about 1.3 bps on Binance and 2 to 3 bps on Hyperliquid before costs, it does not pay for itself as a taker strategy. Where it is useful:
Execution: delay aggressive buys while the book is ask-heavy, and cross when it turns bid-heavy.
Market making: skew quotes towards the heavier side.
Modelling: one feature among many, at a horizon of seconds to minutes.
Limitations
5-minute bars only.
Close-to-close returns on the last trade, with no fees, spread or queue position.
The second year was weaker than the first, so the effect may be decaying.
Five depths, two readings and nine markets is a multiple-testing risk. All closing readings agree, and every bar average is flat.
No look-ahead: the closing value is available before the next bar starts.
About 21,000 bars per decile, so a 52.6% hit rate is about 7.5 standard errors from 50%.
Past results don’t predict future returns. None of this is investment advice.
Reproduce
pip install "aperiodic[polars]"from datetime import date
import polars as pl
from aperiodic import get_metrics
# Two years of BTC-USDT on Binance needs an API key (APERIODIC_API_KEY).
# Without a key, add preview=True and use 1 to 31 May 2025.
kw = dict(timestamp="exchange", interval="5m", exchange="binance-futures",
symbol="perpetual-BTC-USDT:USDT",
start_date=date(2024, 12, 1), end_date=date(2026, 11, 30))
book = get_metrics(metric="l2_imbalance", **kw)
ohlcv = get_metrics(metric="ohlcv", **kw)
# Deciles of imbalance at bar close, and the next bar's log return
print(book.join(ohlcv, on="time").sort("time")
.with_columns(next_bps=(pl.col("close").log().diff() * 1e4).shift(-1))
.drop_nulls(["imbalance_ratio_5", "next_bps"])
.with_columns(group=(pl.col("imbalance_ratio_5").rank() * 10 / pl.len()).floor().clip(0, 9))
.group_by("group").agg(pl.col("next_bps").mean(), (pl.col("next_bps") > 0).mean().alias("up"))
.sort("group"))
The top decile prints about 0.62 bps and a 0.53 hit rate. Replacing imbalance_ratio_5 with imbalance_ratio_5_avg removes the pattern. The no-key preview covers one month, May 2025, which was the strongest month in the sample (+7.0 pp), so expect a larger effect there.
Two years of 5-minute l2_imbalance for one market downloads in about 15 seconds. Coverage: every perp on Binance (from 2020), OKX (from 2019) and Hyperliquid (from 2025), 1-minute to daily bars, historical and live. Both readings are available at L1 and at 5, 10, 20 and 25 levels, with exchange or arrival timestamps, so a backtest only sees what a trader could have seen at the time. Column definitions are on the catalog page.
Black Friday pricing ends tonight at 23:59 UTC: two years of Pro, Prime or Prime Commercial for the price of one, 35% off a first year, or 30% off the first three months, applied at checkout with no code.
If you need help with data, feel free to DM me!









