基于每次报价更新的最优买价、卖价及各自挂单量,并附微观价格。
最优买价与卖价及对应数量、中间价、数量加权中间价、时间/成交量加权均值,以及报价更新频率。
2025年5月14日14:00至14:05 UTC的5分钟K线,Binance BTC-USDT永续合约,数据来自免费预览。
步骤 1
交易所在最优买价或卖价任一变化时推送报价,本K线内共 5,339 次。普通字段保存最后一笔报价。
步骤 2
每个价格按对侧数量加权,因此微价格更靠近较薄的一侧。此处卖价一侧数量略多,因此微价格略低于中间价。存储字段将其取整为 $103,805.65.
$0.10 买卖价差(放大显示)。
步骤 3
与成交TWAP一样,这些字段对每次更新赋予相同权重,而不是按每笔报价持续的时长加权。
截至本K线的一小时内,每根5分钟K线收盘时的买价和卖价。
步骤 4
Binance BTC-USDT永续合约,5分钟K线,2025年5月1日至31日,取自免费预览。
收盘时按微观价格偏向分组的K线,从最偏向买价到最偏向卖价. 个基点。
按收盘时微观价格偏离中间价的程度对K线排序。中间八个十分位没有呈现规律。最偏向卖价的十分位随后平均上涨1.56 bps,最偏向买价的十分位平均下跌1.15 bps。
订单簿每秒更新15次(K线中位数含4,548次报价更新),微观价格的预测时效以秒计。在5分钟级别上,只有最强的偏向才会显现。
bid_price, ask_price, bid_amount and ask_amount 为区间结束时的最优报价及其数量。 midprice 为两者的平均值。
weighted_midprice 以对侧数量为各侧加权,因此会向数量较少的一侧移动。高于中间价意味着卖方更薄。
quote_update_frequency 统计区间内最优报价的更新次数, avg_update_interval 为两次更新之间的间隔(毫秒)。交易所一旦转入沉寂,最先体现在这里。
从零讲解,详见 从第一性原理理解市场(我们的互动课程):
L1 data — the best bid and best ask at any moment — appears deceptively simple. Four numbers: two prices, two quantities. But the derived metrics reveal the real-time behavior of market makers and the microstructure of price formation in ways that trade data alone cannot capture.
The standard midprice, (bid + ask) / 2, treats both sides equally. But Stoikov (2018) showed that the quantity-weighted midprice — which shifts the midpoint proportional to the size available at each side — is a significantly better predictor of the next transaction price. If the bid carries 10× the size of the ask, fair value isn't halfway between them; it's closer to the ask, reflecting the imbalance in immediately available liquidity.
We compute both the standard and weighted midprice, plus their time-series counterparts:
A bid that was consistently improving versus one that was stable then collapsed looks identical in OHLC but produces strikingly different TWAP trajectories.
How many times the best bid/ask changes per interval is one of the most informative L1 metrics — and one of the least studied outside HFT firms.
Hasbrouck & Saar (2013) documented the rise of "low-latency trading" through quote update patterns, showing that high-frequency quoting activity contains predictive information about future price moves. The intuition:
The extreme case — quote update frequency spikes massively but price barely moves — can indicate quote stuffing: the potentially manipulative practice of flooding the book with rapid-fire quote updates to create artificial latency and confuse competing algorithms. Egginton, Van Ness & Van Ness (2016) documented this phenomenon and its effects on market quality.
The average update interval (time between consecutive quote changes) completes the picture. When this metric compresses during a session, the market is entering a high-information regime — market makers are processing new information faster.
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 l1_price --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线,均提供 Pro.
L1价格 ,API文档中的说明:端点与参数 →