Aperiodic
MarketsLive
Pricing
Get Started

L2 — Order Book

Multi-level order book depth, liquidity, and imbalance.

Order book analytics aggregated across 5, 10, 20, and 25 levels — capturing depth, imbalance, and liquidity dynamics at each granularity without storing terabytes of raw snapshots.
Browse catalogAPI documentation

Shown: the median perpetual’s book depth across the top 25 levels, as a share of its 20:00–20:45 average, per venue, 18:00–01:00 UTC on 10 Oct 2025; minutes under half of normal take the strong tone, and the lowest of all, OKX’s 8.5% at 22:06, is orange · built with l2_liquidity 1m

L2 — Order Book Datasets

L2 Order Book Imbalance

Prime

Multi-depth (5, 10, 20, 25 levels) order book imbalance, ratio, and averages.

  • Imbalance (5 levels)·
  • Imbalance (20 levels)·
  • Imbalance (25 levels)·
  • Imbalance Ratio (5 levels)

L2 Order Book Liquidity

Prime

Total bid/ask depth aggregated over 5, 10, 20, 25 order book levels — instantaneous and interval-averaged.

  • Ask Aggregate (10 levels)·
  • Ask Aggregate (20 levels)·
  • Ask Aggregate (25 levels)·
  • Bid Aggregate (10 levels)

Highlighted Metrics

imbalance_5

Imbalance (5 levels)

Imbalance across five levels extends top-of-book pressure into the near-touch order book.

It reveals whether directional support is just a quote-level artifact or is backed by additional nearby depth.

imbalance_ratio_25

Imbalance Ratio (25 levels)

The twenty-five-level imbalance ratio normalizes deep-book pressure over a broader slice of resting liquidity.

It is useful for understanding the full displayed environment that larger orders would have to push through.

bid_ask_ratio_25

Bid/Ask Ratio (25 levels)

The twenty-five-level ratio extends that comparison deep enough to capture broader displayed inventory.

It is especially relevant for larger execution and for understanding whether apparent pressure near the touch is reinforced deeper in the ladder.

ask_agg_25_avg

Avg Ask Aggregate (25 levels)

Average Ask Aggregate across twenty-five levels smooths the deeper sell-side book over the interval.

That makes it a regime measure for how much overhead liquidity the market was consistently showing, not just flashing moment to moment.

bid_agg_25_avg

Avg Bid Aggregate (25 levels)

Average Bid Aggregate across twenty-five levels provides the broad matching view of displayed support.

Stronger readings indicate a deeper cushion of resting liquidity that can absorb pressure before the book thins out materially.

Market Microstructure Context

Order book imbalance

BID (heavy)ASK (thin)

Cont, Kukanov & Stoikov (2014) showed it clearly: order book imbalance predicts the direction of the next mid-price change, and the relationship is monotonic — stronger lean, larger expected move. The mechanism is straightforward. When one side is substantially thicker, the thinner side depletes first and the midpoint shifts. But the real insight is in the layers. L1 and L2 can tell contradictory stories, and the divergence between them is often more informative than either alone.

  • L1 imbalance — Best-bid versus best-ask quantity. A single snapshot is noisy; time-averaged imbalance over the interval is what actually predicts.
  • L2 imbalance — The same signal extended across 5, 10, 20, and 25 levels per side. Captures the full shape of supply and demand behind the frontier — L2 can be draining even while L1 looks stable.
  • L1-L2 divergence — Where the actionable signal lives. Thin L1 bids with deep L2 behind them is a market maker repositioning, not genuine weakness. Thick L1 bids with nothing behind them is a single concentrated quote — pull it and there is a gap.
  • Weighted midprice — Stoikov (2018) showed the quantity-weighted midprice — shifted proportional to size at each side — beats the simple midpoint as a predictor of the next transaction price.
Predicting Short-Term Crypto Returns with Market Microstructure
Interactive notebook

Use Cases

Deep liquidity analysis

Measure aggregate bid and ask depth at multiple levels to understand resilience and liquidity beyond the top-of-book.

Order book imbalance signals

Build predictive features from multi-level imbalance ratios that capture directional pressure more robustly than L1 alone.

Iceberg & hidden order detection

Detect large resting orders by monitoring depth anomalies and imbalance dynamics across book levels over time.

Market resilience measurement

Quantify how quickly liquidity replenishes after consumption by analyzing depth averages and their variability.

Cross-level depth feature engineering

Combine bid/ask depth at 5, 10, 20, 25 levels into composite signals for ML-based execution and alpha models.

Get started in minutes

curl -fsSL https://raw.githubusercontent.com/aperiodic-io/cli/main/install.sh | bash
github ↗
terminal
# 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"

# Fetch the preview slice as Parquet into ./data — no API key needed
aperiodic flow --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"
Preview · binance-futures · perpetual-BTC-USDT:USDT · 1h · 2024-01-01 → 2024-01-31
df.head() · 5 × 37
#timetaker_buy_volumetaker_sell_volumetaker_buy_counttaker_sell_countvolume_deltavolume_delta_notionalflow_entropyflow_toxicity_scoretaker_buy_sell_ratiotaker_buy_sell_count_ratiotaker_buy_sell_percentagetaker_buy_sell_count_percentagetaker_buy_small_order_volumetaker_buy_small_order_counttaker_buy_medium_order_volumetaker_buy_medium_order_counttaker_buy_large_order_volumetaker_buy_large_order_counttaker_sell_small_order_volumetaker_sell_small_order_counttaker_sell_medium_order_volumetaker_sell_medium_order_counttaker_sell_large_order_volumetaker_sell_large_order_counttaker_buy_small_order_percentagetaker_buy_medium_order_percentagetaker_buy_large_order_percentagetaker_sell_small_order_percentagetaker_sell_medium_order_percentagetaker_sell_large_order_percentagetaker_buy_small_order_count_percentagetaker_buy_medium_order_count_percentagetaker_buy_large_order_count_percentagetaker_sell_small_order_count_percentagetaker_sell_medium_order_count_percentagetaker_sell_large_order_count_percentage
12024-01-01 00:00:004687.976074218753771.50097656254650041778916.4749755859375388712680.68726718425750731.24300014972686771.11302602291107180.55416858196258540.526745080947876138008.609375268497904352641818910536017398117024.32812518978532792241711515127201571029.4388465881347662088.414062540338.3789062531.0285816192626952262.43920898437540173.05468750.0577204301953315730.56812900304794310.37415054440498350.045406673103570940.5785580873489380.37603524327278137
22024-01-01 01:00:004783.8378906254259.57324218754938640965524.2650146484375223910960.6914658546447754-0.51.12307918071746831.20556569099426270.52898597717285160.5466015934944153140995.4375283810853161283161931864321823277478.26562512409094397236051726176161612029.4732894897460942268.71411132812540383.148437518.1892089843752135.04882812540524.6250.0574656799435615540.57336086034774780.369173437356948850.0302697420120239260.5762236118316650.39350664615631104
32024-01-01 02:00:002141.2590332031252511.808105468752448528065-370.54901123046875-157790900.68997293710708620.94617903232574460.85247713327407840.87243896722793580.4601822495460510.4659371972084045481757.617187515945058392.51306686080624982542772.0781256856032806.5165781009242881080238.1820297241210942362.34497070312540200.937517.028402328491212401.778320312540179.93750.065101079642772670.53363281488418580.401266068220138550.0244076251983642580.59070014953613280.38489222526550293
42024-01-01 03:00:003501.1320800781254618.7480468753615748188-1117.615966796875-474773440.683644711971283-0.170257717370986940.75802618265151980.75033205747604370.431180268526077270.42867982387542725109771.179687521607630267.5201431407325121385478518.9765625125310414373292961854570081763931.3530521392822272179.3715820312540196.289062517.000055313110352254.8041992187540153.089843750.059739470481872560.55709820985794070.383162319660186770.0260023251175880430.60795217752456670.3660454750061035
52024-01-01 04:00:003155.4318847656253201.104003906253664031386-45.672000885009766-1877300.750.69312137365341190.0265556294471025470.985732376575471.1673995256423950.49640744924545290.5386176109313965150556.92187530427435109201351260489201346359707.238281259466590907187841288612721165647.713569641113282356.28881835937539946.6445312518.6520767211914062058.94799804687540255.25781250.083024017512798310.54953604936599730.367439955472946170.0301408264786005020.59848338365554810.37137576937675476

Ready to start building?

Get access to our full catalog of market microstructure data.

Get started free

Shown: minute lows of the 465 Binance perpetuals, 20:40–22:00 UTC on 10 Oct 2025, with BTC’s path traced · built with ohlcv 1m

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
  • Full Catalog
  • Live markets dashboard
  • Global Liquidity
  • Unusual activity
  • Order Flow
  • L1 — Top of Book
  • L2 — Order Book
  • Market Data
  • 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