Aperiodic
DataAlpha
CatalogOrder FlowL1 & L2Derivatives & Market Data
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.

L2 — Order Book Datasets

L2 Order Book Imbalance

Tier 3

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

Key fields

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

L2 Order Book Liquidity

Tier 3

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

Key fields

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

pip install aperiodic
pypi ↗
example.py
from datetime import date
from aperiodic import get_metrics

df = get_metrics(
    api_key="your-api-key",
    metric="flow",
    timestamp="exchange",
    interval="1h",
    exchange="binance-futures",
    symbol="perpetual-BTC-USDT:USDT",
    start_date=date(2024, 1, 1),
    end_date=date(2024, 1, 31),
)

print(df.head())

Use with AI Agents

Query L2 — Order Book datasets programmatically with our Python SDK and REST API — built for autonomous research workflows.

Get Started

Sign up and subscribe to get an API key. Start querying datasets in minutes.

Ready to start building?

Get access to our full catalog of market microstructure data.

Get started free
Get started
Aperiodic

Institutional-Grade Order Flow, Liquidity & Derivative Metrics — Turn market microstructure into actionable signals, alpha and analytics in minutes.

© Copyright 2026 Aperiodic. All Rights Reserved.

Product
  • Data Catalog
  • Pricing
  • API Docs
  • Notebooks
  • Roadmap
  • Changelog
  • FAQ
  • For AI Agents
Metrics
  • Order Flow
  • L1 — Top of Book
  • L2 — Order Book
  • Market Data
  • Derivatives
Channels
  • Research Insights
  • Microstructure Guide
  • Telegram
  • Twitter/X
  • LinkedIn
Company
  • Contact
  • Book a call
  • Terms of Service
  • Privacy Policy
  • LLM? Read this.

NOT INVESTMENT ADVICE

The Content is for informational purposes only, you should not construe any such information or other material as legal tax, investment, financial, or other advice. Nothing contained on our presentation constitutes a solicitation, recommendation, endorsement, or offer by Aperiodic or any third party service provider to buy or sell any securities or other financial instruments in this or in in any other jurisdiction in which such solicitation or offer would be unlawful under the securities laws of such jurisdiction.

All Content on this presentation is information of a general nature and does not address the circumstances of any particular individual or entity. Nothing in the presentation constitutes professional and/or financial advice, nor does any information on the Presentation constitute a comprehensive or complete statement of the matters discussed or the law relating thereto.

Aperiodic is not a fiduciary by virtue of any person's use of or access to the Presentation or Content. You alone assume the sole responsibility of evaluating the merits and risks associated with the use of any information or other Content on the Presentation before making any decisions based on such information or other Content. In exchange for using the Presentation, you agree not to hold Aperiodic, its affiliates or any third party service provider liable for any possible claim for damages arising from any decision you make based on information or other Content made available to you through the Presentation.

INVESTMENT RISKS

There are risks associated with investing in securities. Investing in stocks, bonds, exchange traded funds, mutual funds, and money market funds involve risk of loss. Loss of principal is possible. Some high risk investments may use leverage, which will accentuate gains & losses. Foreign investing involves special risks, including a greater volatility and political, economic and currency risks and differences in accounting methods. A security's or a firm's past investment performance is not a guarantee or predictor of future investment performance.