Skip to content
Alchemy Logo

l2Book stream

This API is in private preview. Target September 2026; timing is subject to change.

l2Book delivers aggregated price-level order book snapshots, one per block for each market whose book changed. This is ideal for order book displays, depth analysis, and pricing.

For the corresponding gRPC snapshot stream, see StreamL2Book. For the diff representation and bootstrap procedure, see l2BookDiff.

{"method":"subscribe","subscription":{"type":"l2Book","coins":["BTC","ETH"],"nSigFigs":5,"mantissa":2,"nLevels":20}}

Use marketTypes instead of coins to subscribe to all markets of selected types:

{"method":"subscribe","subscription":{"type":"l2Book","marketTypes":["spot"]}}

ParameterTypeRequiredSourceDescription
coinsstring[]NoAlchemy extensionMarkets to subscribe to. Omit to subscribe to every market of the types in marketTypes, which defaults to perpetuals. The native API takes a single coin per subscription; the plural array is an Alchemy extension.
marketTypesstring[]NoAlchemy extensionRestricts delivery by market type. Accepted values: perp, spot, outcome, or *. Defaults to ["perp"]. Rejected if combined with coins.
nSigFigsnumberNoFoundation nativeAggregate price levels to N significant figures. Accepted values: 2, 3, 4, 5.
mantissanumberNoFoundation nativeSnap prices to a mantissa step. Accepted values: 2 or 5. Valid only when nSigFigs is 5.
nLevelsnumberNoAlchemy extensionLevels per side: 1, 10, 20 (default), or 50.

The default never grows. New market types must be added to marketTypes explicitly, or pass ["*"] to opt in to future types automatically.

Aggregation rounds bids down and asks up. With nSigFigs: 5 and mantissa: 2, a bid of 70325 becomes 70324 and an ask of 70325 becomes 70326.

{"channel":"subscriptionResponse","data":{"subscriptionId":"sub_01","type":"l2Book"}}

{"channel":"l2Book","subscriptionId":"sub_01","blockHeight":123456,"blockTime":1780000000000,"data":{"coin":"BTC","time":1780000000000,"levels":[[{"px":"100000.0","sz":"1.25","n":3}],[{"px":"100001.0","sz":"0.80","n":2}]]}}

FieldTypeDescription
coinstringMarket symbol.
timeintegerBlock timestamp in milliseconds.
levelsarrayTwo-element tuple of [bids, asks]. Bids sorted descending, asks ascending.
levels[][].pxstringPrice, as a decimal string.
levels[][].szstringTotal size resting at this price level, as a decimal string.
levels[][].nintegerNumber of orders aggregated into this level.

  • Every message is a complete snapshot for the market it names
  • A market is sent only when its book changed in that block
  • Levels are aggregated: one level may represent many orders, and n reports how many
  • Order IDs and user addresses are not exposed on this stream — use l4BookUpdates for those

l2Bookl2BookDiffbbol4BookUpdates
DeliversComplete aggregated snapshotChanged aggregated levelsBest bid and ask onlyChanged individual orders
Client stateNone requiredMaintains a local bookNone requiredMaintains a local book
DetailAggregated levelsAggregated levelsTop of bookIndividual orders, with queue position
Use caseDisplays, periodic readsEfficient live bookPrice and spread trackingMarket making, queue analysis

{"method":"unsubscribe","subscription":{"type":"l2Book","coins":["BTC","ETH"]}}

Every message is a complete snapshot, so there is nothing to replay. After a disconnect, resubscribe and the next message re-establishes your state.

Was this page helpful?