Orderbook Imbalance Signals: A Statistical Primer for Crypto Quants
By Imbalance Labs Research
What Is Orderbook Imbalance?
Orderbook Imbalance (OBI) is one of the most powerful short-term predictive signals in market microstructure. It measures the relative strength of buying pressure versus selling pressure by comparing bid-side and ask-side volume at one or more depth levels.
The simplest formulation is the Level-1 Orderbook Imbalance Ratio:
OBI = bid_volume_level_1 / (bid_volume_level_1 + ask_volume_level_1) Range: [0, 1] OBI > 0.5 → More bid pressure (bullish signal) OBI < 0.5 → More ask pressure (bearish signal) OBI ≈ 0.5 → Balanced book
When OBI deviates significantly from 0.5, it suggests a directional pressure that often precedes short-term price movements. This works particularly well on decentralized exchanges like Hyperliquid, where the absence of spoofing means the visible depth represents genuine committed capital.
Computing Imbalance from L2 Snapshots
Using our 47-column schema, computing OBI is straightforward. Here's the Python implementation:
import pandas as pd
# Load ETH orderbook depth data
df = pd.read_parquet('eth_l2_depth_5m.parquet')
# Level-1 Orderbook Imbalance
df['obi_l1'] = df['bid_volume_level_1'] / (
df['bid_volume_level_1'] + df['ask_volume_level_1']
)
# Z-score for signal strength (20-period lookback)
df['obi_zscore'] = (
(df['obi_l1'] - df['obi_l1'].rolling(20).mean())
/ df['obi_l1'].rolling(20).std()
)
# Forward return for signal evaluation
df['fwd_return_5m'] = df['close_price'].pct_change(1).shift(-1)
# Correlation between OBI z-score and forward returns
corr = df[['obi_zscore', 'fwd_return_5m']].dropna().corr()
print(f"OBI → 5m forward return correlation:\n{corr}")The same computation in DuckDB:
-- Compute OBI and forward returns with DuckDB
SELECT
timestamp_utc,
close_price,
bid_volume_level_1 / (bid_volume_level_1 + ask_volume_level_1) AS obi_l1,
LEAD(close_price) OVER (ORDER BY timestamp_utc) / close_price - 1 AS fwd_return
FROM read_parquet('eth_l2_depth_5m.parquet')
ORDER BY timestamp_utc;Multi-Level Depth Signals
Level-1 OBI captures the immediate pressure at the top of the book. But professional quant desks use multi-level weighted imbalance for a more complete picture of market sentiment:
# Weighted Multi-Level Orderbook Imbalance
# Closer levels get exponentially higher weight
def weighted_obi(row, n_levels=10, alpha=0.7):
"""
Compute depth-weighted OBI with exponential decay.
alpha < 1 means closer levels matter more.
"""
bid_weighted = sum(
(alpha ** i) * row[f'bid_volume_level_{i+1}']
for i in range(n_levels)
)
ask_weighted = sum(
(alpha ** i) * row[f'ask_volume_level_{i+1}']
for i in range(n_levels)
)
return bid_weighted / (bid_weighted + ask_weighted)
df['obi_weighted'] = df.apply(weighted_obi, axis=1)The exponential decay parameter α controls how much you weight deeper levels. With α = 0.7, Level 1 gets weight 1.0, Level 2 gets 0.7, Level 3 gets 0.49, and so on. This naturally captures the fact that liquidity closer to the mid-price is more informative for near-term price prediction.
Statistical Properties
Research on our ETH dataset and SOL dataset reveals several key statistical properties of OBI signals:
- Mean-reversion at 5m horizon: Extreme OBI values (z-score > 2) tend to mean-revert within 1-3 bars, suggesting a contrarian strategy at short horizons.
- Momentum at 1h horizon: Persistent imbalance over 12+ consecutive bars (1 hour) is predictive of continuation, not reversal.
- Cross-asset correlation: OBI signals for BTC tend to lead altcoin OBI by 1-2 bars, creating a lead-lag structure exploitable for pairs trading.
- Regime dependence: OBI signal strength varies significantly between trending and ranging markets. Combining with a volatility filter (ATR-based) improves Sharpe by ~30%.
From Signal to Strategy
Converting OBI signals into a profitable strategy requires careful consideration of transaction costs, execution mechanics, and position sizing. Key considerations:
- Use the weighted OBI z-score as an entry trigger, not raw OBI values
- Apply the slippage estimation technique from our slippage article to model realistic execution costs
- Scale position size inversely with bid-ask spread distance (
bid_distance_level_1) - Reduce exposure when total depth (sum of all 10 levels) falls below a threshold
Try the Signals Yourself
Download our free 7-day sample and compute OBI signals on real Hyperliquid orderbook data.