Introduction
Market microstructure studies how trading actually happens: how orders interact, how liquidity is supplied, and how prices absorb information in real time. It explains why two markets with the same headline price can offer very different trading conditions once spread, depth, queue position, and price impact matter.
Think of the order book as two lines at a checkout: one side wants to buy, the other wants to sell. The price is set by whoever is at the front of each line. When buyers start piling up faster than sellers, the price moves up — and you can see that coming before it happens.
The spread is the gap between what buyers offer and what sellers ask. Market makers set it wide when they’re nervous — like a store charging more for something they’re not sure they can restock. A widening spread is an early warning that something is off, before prices visibly react.
Depth is how many people are standing in line behind the front. A long line means a big order won’t shift the price much. A short line means one large trade can send the price flying. A book that looks full at the top but empty underneath is the most dangerous — it feels safe until it isn’t.
Every trade has a buyer and a seller, but one of them pushed — they were in a hurry. Order flow tracks who is pushing and how hard. When a lot of urgent buyers show up at the same time prices are swinging wildly, that’s when being a market maker gets expensive and dangerous.
Every trade nudges the price. Bigger trades nudge more. Impact measures how much price moves per dollar traded. In thin markets that nudge is large, so investors demand higher returns to take the risk of getting in and out. That’s why less liquid assets often have higher expected returns.
In fast markets, milliseconds matter. When quotes are updating furiously but the price barely moves, someone may be flooding the system with fake orders to slow down competitors. Clustering of trades in time also signals urgency that average bars completely hide.
These metrics form a dependency chain, not a checklist. Volatility sets the regime. Spread and depth define resting liquidity within it. Imbalance and flow describe the pressure being applied. Impact and slippage measure what happens when pressure meets supply. No single number is diagnostic on its own — the signal is always in the combination, and the combination changes with the regime.
The spread is the price of immediacy — what the market maker charges to bear adverse selection risk right now. Huang & Stoll (1997) decomposed it into adverse selection, inventory, and order processing costs, which is why a widening spread is diagnostic, not just expensive. But the average hides the regime change: a bar with mean spread of 2 bps that was 0.5 bps for 55 seconds and 8 bps for 5 seconds tells a fundamentally different story than a steady 2 bps. Bollerslev & Melvin (1994) showed spread volatility itself predicts future return volatility — the instability of the spread matters as much as its level.
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.
Not all trades carry the same information. Barclay & Warner (1993) found that medium-sized orders — not the largest — account for a disproportionate share of cumulative price impact. Informed traders deliberately size down to avoid detection. This means aggregate volume alone is insufficient: you need to decompose flow by direction, size, and concentration to understand what it is actually telling you.
Kyle’s lambda and Amihud illiquidity approach the same question from opposite ends: how much does trading move the price? Lambda measures information content per unit of signed flow; Amihud measures return per dollar of volume. Where they agree, the market is behaving consistently. Where they diverge is where the diagnosis gets interesting — rising Amihud without rising lambda points to exogenous volatility, not informed flow. Rising lambda alone means someone in the order flow knows something the quote does not yet reflect.
In crypto perpetual futures, funding rate, basis, and open interest are the primary indicators of leverage positioning and directional crowding. When funding, basis, and open interest all point the same direction, the market is building a position that will eventually need to unwind.
Once the concepts are clear, the next step is to study the actual metric families: order flow composition, top-of-book liquidity, multi-level depth, price impact, and derivatives state variables. Each dataset page includes the academic background, what we measure, and why it matters for research.
/api/v1/data/flow
Trades
Requires timestamp=true
taker_buy_volumeTaker Buy VolumeTotal buy-side traded quantity in the intervaltaker_sell_volumeTaker Sell VolumeTotal sell-side traded quantity in the intervaltaker_buy_countTaker Buy CountNumber of buy-side trades in the intervaltaker_sell_countTaker Sell CountNumber of sell-side trades in the intervalvolume_deltaVolume DeltaBuy-side traded quantity minus sell-side traded quantityvolume_delta_notionalVolume Delta NotionalBuy-side traded notional minus sell-side traded notionalflow_entropyFlow EntropyEntropy of the buy-versus-sell quantity split in the intervalflow_toxicity_scoreFlow Toxicity ScorePast-normalized signed notional flow multiplied by past-normalized short-horizon realized volatilitytaker_buy_sell_ratioBuy/Sell RatioBuy-side traded quantity divided by sell-side traded quantitytaker_buy_sell_count_ratioBuy/Sell Count RatioBuy-side trade count divided by sell-side trade counttaker_buy_sell_percentageTaker Buy %Share of traded quantity that came from buy-side tradestaker_buy_sell_count_percentageTaker Buy Count %Share of trades that were buy-side tradestaker_buy_small_order_volumeBuy Small Order VolumeTotal buy-side notional from small trades under $100taker_buy_small_order_countBuy Small Order CountNumber of buy-side trades under $100taker_buy_medium_order_volumeBuy Medium Order VolumeTotal buy-side notional from medium trades from $100 to under $1,000taker_buy_medium_order_countBuy Medium Order CountNumber of buy-side trades from $100 to under $1,000taker_buy_large_order_volumeBuy Large Order VolumeTotal buy-side notional from large trades of at least $1,000taker_buy_large_order_countBuy Large Order CountNumber of buy-side trades of at least $1,000taker_sell_small_order_volumeSell Small Order VolumeTotal sell-side notional from small trades under $100taker_sell_small_order_countSell Small Order CountNumber of sell-side trades under $100taker_sell_medium_order_volumeSell Medium Order VolumeTotal sell-side notional from medium trades from $100 to under $1,000taker_sell_medium_order_countSell Medium Order CountNumber of sell-side trades from $100 to under $1,000taker_sell_large_order_volumeSell Large Order VolumeTotal sell-side notional from large trades of at least $1,000taker_sell_large_order_countSell Large Order CountNumber of sell-side trades of at least $1,000taker_buy_small_order_percentageBuy Small Order %Ratio of small buy-side trade notional to total buy-side traded quantitytaker_buy_medium_order_percentageBuy Medium Order %Ratio of medium buy-side trade notional to total buy-side traded quantitytaker_buy_large_order_percentageBuy Large Order %Ratio of large buy-side trade notional to total buy-side traded quantitytaker_buy_small_order_count_percentageBuy Small Count %Share of buy-side trades that were small tradestaker_buy_medium_order_count_percentageBuy Medium Count %Share of buy-side trades that were medium tradestaker_buy_large_order_count_percentageBuy Large Count %Share of buy-side trades that were large tradestaker_sell_small_order_percentageSell Small Order %Ratio of small sell-side trade notional to total sell-side traded quantitytaker_sell_medium_order_percentageSell Medium Order %Ratio of medium sell-side trade notional to total sell-side traded quantitytaker_sell_large_order_percentageSell Large Order %Ratio of large sell-side trade notional to total sell-side traded quantitytaker_sell_small_order_count_percentageSell Small Count %Share of sell-side trades that were small tradestaker_sell_medium_order_count_percentageSell Medium Count %Share of sell-side trades that were medium tradestaker_sell_large_order_count_percentageSell Large Count %Share of sell-side trades that were large tradesfrom datetime import datefrom aperiodic import get_metricsdf = get_metrics( api_key="YOUR_API_KEY", metric="flow", exchange="binance-futures", symbol="perpetual-BTC-USDT:USDT", interval="1d", start_date=date(2024, 1, 1), end_date=date(2024, 3, 1),)print(df.head())timestampreqstringTimestamp source. 'exchange' uses the exchange-reported timestamp, 'true' uses actual arrival time at our servers.
exchangetrueintervalreqstringAggregation time interval for the data.
1m5m15m30m1h4h1dexchangereqstringSource exchange for the data.
binance-futuresokx-perpshyperliquid-perpssymbolreqstringTrading pair symbol in the format of Atlas' universal symbology: https://github.com/aperiodic-io/atlas
start_datereqstring<date>Start date for the data range (YYYY-MM-DD format). Data is partitioned by year and month.
end_datereqstring<date>End date for the data range (YYYY-MM-DD format). Must be greater than or equal to start_date.
Successful response with download URLs for each monthly file
filesobject[]requiredArray of file information for each month in the requested date range
yearintegerrequiredYear of the data file
monthintegerrequiredMonth of the data file (1-12)
urlstring<uri>requiredPresigned URL for direct file download (valid for 5 minutes). URLs are served from dataset-specific subdomains, e.g. ohlcv.aperiodic.io, trade-metrics.aperiodic.io, l1-metrics.aperiodic.io, l2-metrics.aperiodic.io, derivative-metrics.aperiodic.io.
{
"files": [
{
"year": 2024,
"month": 1,
"url": "https://ohlcv.aperiodic.io/binance-futures/1h/BTCUSDT/2024-01.parquet?X-Amz-Expires=300&..."
},
{
"year": 2024,
"month": 2,
"url": "https://ohlcv.aperiodic.io/binance-futures/1h/BTCUSDT/2024-02.parquet?X-Amz-Expires=300&..."
}
]
}
/api/v1/data/flow?timestamp=exchange&interval=1m&exchange=binance-futures