最优报价后方5至25档的挂单量。
订单簿前5、10、20、25档的买单/卖单总深度,含瞬时值与区间均值。
2025年5月14日14:00至14:05 UTC的5分钟K线,Binance BTC-USDT永续合约,数据来自免费预览。
步骤 1
bid_agg_N 为前 N 档买单上挂出的 BTC 数量,ask_agg_N 为卖单的对应数值,因此二者均随 N 增大而增加。
步骤 2
相邻两档累计深度之差即为该区间的挂单量。在该订单簿中,前25档内90%以上的挂单量集中在前五档。
步骤 3
按整根K线内的平均值计算,卖单挂单量约为收盘时的两倍。每个快照只计一次。
步骤 4
Binance BTC-USDT永续合约,5分钟K线,2025年5月1日至31日,取自免费预览。
各深度范围内挂单BTC数量的中位数,按K线周期取均值. BTC.
按各K线周期取均值的深度中位数:最优档位19.2 BTC,前5档以内20.3 BTC,前25档以内25.8 BTC,约合$2.7M。买单与卖单基本对称。
由于每个最小价位上都有报价,该订单簿的25档仅覆盖0.24 bps的价格区间。规模超过最优报价的交易,将与其后薄得多的档位成交。
延迟15分钟至11:30 UTC每5分钟自动更新
bid_agg_N and ask_agg_N 为每一侧前N档内以基础资产计的挂单量,N为5、10、20或25。乘以价格即为美元金额。
成交最活跃的前 _avg 字段为区间内所有订单簿快照的均值,不带后缀的字段则取最后一个快照。建议优先使用均值,因为单个快照可能恰好捕捉到报价刷新途中的状态。
一档即一个价格步长,因此相同档数在不同合约上覆盖的价格距离各不相同。跨合约比较应使用美元和基点,而非档数。
从零讲解,详见 从第一性原理理解市场(我们的互动课程):
Top-of-book metrics capture only the frontier of the limit order book. The deeper levels — where the bulk of resting liquidity sits — tell you about market resilience: the ability to absorb large orders without significant price displacement.
Biais, Hillion & Spatt (1995) conducted one of the earliest empirical analyses of the full limit order book (on the Paris Bourse), demonstrating that the shape of the book — not just the top level — contains predictive information about future price dynamics. They showed that the distribution of depth across price levels reveals the strategic behavior of limit order traders, who place orders deeper in the book during periods of uncertainty and closer to the market when they want to trade.
Gould et al. (2013) provided a comprehensive review of the limit order book literature, establishing that book depth at multiple levels is a key state variable for models of price formation. Markets with deep, evenly distributed books are resilient — they can absorb large trades with minimal price impact. Markets with concentration at the top and sparse deeper levels are fragile.
We track order book state at four cumulative depth tiers: 5, 10, 20, and 25 price levels per side.
How stable is the total depth over an interval? If depth is stable, market makers are committed — they're not pulling quotes defensively. High depth volatility means liquidity providers are repricing rapidly, which Foucault, Kadan & Kandel (2005) modeled as the optimal response to changing information asymmetry: when adverse selection risk rises, limit order traders either cancel or reprice their quotes.
Depth volatility spikes often precede or accompany large directional moves. The mechanism: market makers detect toxic flow (through their own monitoring of order flow patterns) and begin pulling quotes before the move becomes visible in prices. The L2 depth drain is the leading indicator; the price move is the lagging consequence.
The most actionable signal from L2 data is its divergence from L1:
References:
# 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 l2_liquidity --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"所有交易所和永续合约,从1分钟到日线K线,均提供 Prime.
L2订单簿流动性 ,API文档中的说明:端点与参数 →