Metrics library · L1 & L2 order book
Top-of-book depth, both sides, BTC perps, last 24 hours
DELAYED 15 MIN…Updates by itself every 5 minutes
Top-of-book depth, both sides, latest
A dip on one venue only means less size quoted there.
The bid-ask spread and the dollars quoted at the best bid and ask.
Spread (absolute and bps), depth, dollar depth — instantaneous and interval-averaged.
The 5m bar from 14:00 to 14:05 UTC on 14 May 2025, Binance BTC-USDT perpetual, from the free preview.
Step 1
One tick, the contract's minimum price increment.
Step 2
On OKX, size is in contracts and is not multiplied by the contract size, so dollar depth there is contracts × price.
Step 3
The average spread is above one tick because the spread widened during some of the bar's 5,339 updates.
Step 4
BTC-USDT perpetual on Binance, 5m bars, 1 to 31 May 2025, from the free preview.
Hour of the day, UTC. Millions of USD.
One tick is $0.10, about 0.010 bps of the price. With the spread fixed at one tick, depth is what changes. Median top-of-book depth was $2.2M in the 10:00 UTC hour and $1.5M at 21:00.
A slippage model built on one daily average overstates depth in the thin hours and understates it in the thick ones.
DELAYED 15 MINto 14:40 UTCUpdates by itself every 5 minutes
Highest
spread is ask minus bid in quote currency, spread_bps the same in basis points of the mid. dollar_depth_bid and dollar_depth_ask are the dollars at the best quote on each side, total_dollar_depth their sum.
spread_depth_ratio divides the spread by the size at the touch. Higher means wider and thinner.
The _avg fields are the mean over every quote update in the interval. On the most liquid perps the last spread is almost always one tick, so use the average to see when it widened.
The bid-ask spread is universally understood as a transaction cost. Less appreciated: it's the market maker's real-time estimate of adverse selection risk, and its dynamics encode the informational state of the market.
Glosten & Milgrom (1985) proved that the bid-ask spread emerges endogenously in a market with asymmetric information. Even a competitive, zero-profit market maker must charge a spread because some fraction of incoming orders are from informed traders who know the asset's true value. The spread compensates for the expected losses to informed counterparties.
Huang & Stoll (1997) decomposed the spread empirically into three components:
Their estimation showed that adverse selection accounts for a substantial fraction (often 30–50%) of observed spreads in equity markets. In crypto markets, where informed participants can be algorithmic and fast, the adverse selection component is likely even larger.
Spread widening is a leading indicator. When market makers widen spreads, they're signaling increased uncertainty about fair value — either because they've observed toxic flow (Easley, López de Prado & O'Hara, 2012), or because volatility is elevated and their hedging lags reality.
Conversely, spread compression signals a market maker competition regime: multiple liquidity providers are confident in their fair-value estimates and competing for priority by narrowing quotes. This is the environment where mean-reversion strategies are most reliable and execution costs are lowest.
The L1 Liquidity dataset pairs spread metrics with depth at the best quote — because the two dimensions together define the true execution landscape. A tight spread with thin depth invites market impact; a tight spread with substantial depth is the holy grail of execution environments.
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_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"