The best bid and ask and the size at each, from every quote update, with the microprice.
Best bid and ask prices with quantities, midprice, quantity-weighted midprice, time/volume-weighted averages, and quote update frequency.
The 5m bar from 14:00 to 14:05 UTC on 14 May 2025, Binance BTC-USDT perpetual, from the free preview.
Step 1
The venue sends the best bid and ask each time either changes, 5,339 times in this bar. The plain fields hold the last quote.
Step 2
Each price is weighted by the size on the opposite side, so the microprice sits nearer the thinner side. The ask had a little more size here, so the microprice is slightly below the mid. The stored field rounds it to $103,805.65.
The $0.10 spread, enlarged.
Step 3
Like the trade TWAP, these weight every update equally, not by how long each quote stood.
Bid and ask at the close of each 5-minute bar, over the hour up to this one.
Step 4
BTC-USDT perpetual on Binance, 5m bars, 1 to 31 May 2025, from the free preview.
Bars by microprice lean at the close, most to the bid to most to the ask. Basis points.
Bars sorted by how far the microprice sat from the mid at the close. The middle eight tenths show no pattern. The tenth leaning hardest to the ask was followed by a 1.56 bps move up on average, the tenth leaning hardest to the bid by 1.15 bps down.
The book updated 15 times a second (4,548 quote updates in a median bar), and the microprice predicts over seconds. At 5 minutes only the strongest leans show.
bid_price, ask_price, bid_amount and ask_amount are the best quote and its size at the end of the interval. midprice is their average.
weighted_midprice weights each side by the size on the other, so it moves toward the side with less size. Above the mid means the ask is thinner.
quote_update_frequency counts best-quote updates in the interval, avg_update_interval the time between them in milliseconds. A venue that goes quiet shows here first.
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"