{} matches every token bucket on every chain.
Subscribe on an open stream connection. See WebSocket streams for connections, frames and reconnection, and Filtering streams for how keys, lists and ranges combine.
Filters
Token and pool buckets
Withoutpools, the buckets are token buckets, and each one aggregates every pool the token trades in. With pools, the buckets are the named pools’ buckets.
tokensandpoolseach cover every chain in their address family thatchainsincludes.- Omit a list to match every address. An empty list is rejected.
poolsrejects the zero address.- A pool bucket has no liquidity value, so it never matches
liquidityUsdorliquidityNative.
Bucket values
changePctandrangePctare computed from the bucket in the subscription’smetricanddenomination. A bucket with a zero open never matches either key.- An omitted
timeframesmatches every timeframe.
Token state
token tests the latest state of the bucket’s token, as on spot.trades. A token has a state only after it changes while a subscription with a token key is open, and the state expires after 15 minutes without a change.
Options
These options are top-level fields of the subscribe frame, alongsidefilters, not inside it.
Sends only each bucket’s final state instead of every update. Cannot be combined with
throttleMs.Minimum interval between updates of one series, in milliseconds, from 0 to 60,000. The first update in an interval is sent immediately. Later updates in the same interval are merged into the newest, which is sent when the interval ends.
0 sends every update.Closed buckets
WithclosedOnly: true, a bucket’s final state is sent 2 seconds after the bucket ends, or as soon as a newer bucket of the same series opens.
- A bucket whose final state does not match the filter is not sent.
- A late change to a bucket that was already sent is sent again, as a correction.
- One subscription tracks at most 10,000 open buckets. Beyond that, new series are not sent, so narrow the filter with
tokensortimeframes.
Message format
Each update’sdata is the current state of one bucket, in the same shape that OHLCV candles returns, plus the four fields that identify its series. An open bucket is sent again on every trade, so key each candle on chain, token, pool, timeframe and time: replace a candle with the same key, and append a new one.
Candle values are JSON numbers, not decimal strings. See Candles are numbers.
To load history from before the stream starts, read candles with the same
timeframe, metric and denomination from OHLCV candles.
Errors
Unsupported filters
spot.candles rejects the following filters. Use the replacement in the right column instead.