Skip to content

Fields and functions

Every name a query may use. Generated from the catalogue the engine runs on — GET /v2/dql/catalogue serves the same thing as data, and a client should read it from there rather than carry a copy.

Each entry shows a query that reads it and the value the engine gave back, on the documentation fixture. The shape is the shape you will get; the numbers are invented.

Two columns are worth understanding before the tables:

  • scope — instrument names belong to the instrument, venue names to one venue’s listing of it. A venue-scoped name has to sit inside any(…), all(…), count(…) or an aggregate, because an instrument has several venues and the language will not silently pick one.
  • additive — whether summing it across venues means anything. sum refuses a field that is not additive: adding prices is a category error, not a small inaccuracy.
field scope layer type unit sampleable additive
instrument instrument reference code code — —
base instrument reference code code — —
venues_listed instrument reference number count — —
venues_answered instrument reference number count — —
venue venue reference code code — —
quote venue reference code code — —
tick_size venue reference number quote — —
lot_size venue reference number quantity — —
min_qty venue reference number quantity — —
last venue ticker number quote yes —
mark venue mark number quote yes —
index venue mark number quote yes —
basis venue mark number fraction yes —
funding venue funding number fraction yes —
funding_interval venue funding duration ms — —
funding_8h venue funding number fraction yes —
funding_short venue funding number fraction yes —
funding_short_8h venue funding number fraction yes —
funding_cap venue funding number fraction — —
funding_floor venue funding number fraction — —
funding_cap_8h venue funding number fraction — —
funding_floor_8h venue funding number fraction — —
funding_at_cap venue funding boolean — — —
time_to_funding venue funding duration ms — —
oi venue oi number quantity yes yes
bid venue book number quote yes —
ask venue book number quote yes —
mid venue book number quote yes —
spread venue book number fraction yes —
bid_size venue book number quantity yes yes
ask_size venue book number quantity yes yes
volume_24h venue stats number quantity yes yes
turnover_24h venue stats number quote yes yes
change_24h venue stats number fraction yes —

the market code, e.g. BTC-PERP

Instrument-scoped, layer reference, type code, unit code.

venues_listed >= 1 select instrument
{
"value": "BTC-PERP",
"from": "reference",
"as_of": "2026-09-23T12:00:05Z"
}

the base asset’s registry code, e.g. BTC

Instrument-scoped, layer reference, type code, unit code.

venues_listed >= 1 select base
{
"value": "BTC",
"from": "reference",
"as_of": "2026-09-23T12:00:05Z"
}

number of (selected) listings at T

Instrument-scoped, layer reference, type number, unit count.

venues_listed >= 1 select venues_listed
{
"value": 4,
"from": "reference",
"as_of": "2026-09-23T12:00:05Z"
}

number of (selected) listings whose mark is present at T

Instrument-scoped, layer reference, type number, unit count.

venues_listed >= 1 select venues_answered
{
"value": 4,
"from": "reference",
"as_of": "2026-09-23T12:00:05Z"
}

the venue’s public code

Venue-scoped, layer reference, type code, unit code.

venues_listed >= 1 select venue
{
"value": "BYBIT-PERP",
"venue": "BYBIT-PERP",
"layer": "reference",
"venue_ts": null,
"received_at": "2026-09-23T00:00:00Z",
"age_ms": 43205000,
"status": "present"
}

the listing’s quote currency

Venue-scoped, layer reference, type code, unit code.

venues_listed >= 1 select quote
{
"value": "USDT",
"venue": "BYBIT-PERP",
"layer": "reference",
"venue_ts": null,
"received_at": "2026-09-23T00:00:00Z",
"age_ms": 43205000,
"status": "present"
}

minimum price increment of the listing

Venue-scoped, layer reference, type number, unit quote.

venues_listed >= 1 select tick_size
{
"value": 0.1,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "reference",
"venue_ts": null,
"received_at": "2026-09-23T00:00:00Z",
"age_ms": 43205000,
"status": "present"
}

minimum quantity increment

Venue-scoped, layer reference, type number, unit quantity.

venues_listed >= 1 select lot_size
{
"value": 0.001,
"unit": "base",
"venue": "BYBIT-PERP",
"layer": "reference",
"venue_ts": null,
"received_at": "2026-09-23T00:00:00Z",
"age_ms": 43205000,
"status": "present"
}

minimum order quantity

Venue-scoped, layer reference, type number, unit quantity.

venues_listed >= 1 select min_qty
{
"value": 0.001,
"unit": "base",
"venue": "BYBIT-PERP",
"layer": "reference",
"venue_ts": null,
"received_at": "2026-09-23T00:00:00Z",
"age_ms": 43205000,
"status": "present"
}

last trade price

Venue-scoped, layer ticker, type number, unit quote, readable as a series.

venues_listed >= 1 select last
{
"value": 86988,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "ticker",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

venue mark price

Venue-scoped, layer mark, type number, unit quote, readable as a series.

venues_listed >= 1 select mark
{
"value": 86990,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "mark",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

venue index price

Venue-scoped, layer mark, type number, unit quote, readable as a series.

venues_listed >= 1 select index
{
"value": 86950,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "mark",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

(mark − index) / index

Venue-scoped, layer mark, type number, unit fraction, readable as a series.

venues_listed >= 1 select basis
{
"value": 0.000460034503,
"unit": "fraction",
"venue": "BYBIT-PERP",
"layer": "mark",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

published rate for the next settlement, per interval

Venue-scoped, layer funding, type number, unit fraction, readable as a series.

venues_listed >= 1 select funding
{
"value": 0.000013,
"unit": "fraction",
"venue": "HYPERLIQUID",
"layer": "funding",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

settlement interval as published

Venue-scoped, layer funding, type duration, unit ms.

venues_listed >= 1 select funding_interval
{
"value": 3600000,
"unit": "ms",
"venue": "HYPERLIQUID",
"layer": "funding",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

funding × 8h / funding_interval, the registry’s; null without one (no comparison)

Venue-scoped, layer funding, type number, unit fraction, readable as a series.

venues_listed >= 1 select funding_8h
{
"value": 0.000104,
"unit": "fraction",
"venue": "HYPERLIQUID",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

rate the short side pays, positive when the short pays

Venue-scoped, layer funding, type number, unit fraction, readable as a series.

venues_listed >= 1 select funding_short
{
"value": -0.000013,
"unit": "fraction",
"venue": "HYPERLIQUID",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

funding_short × 8h / funding_interval, the registry’s; null without one

Venue-scoped, layer funding, type number, unit fraction, readable as a series.

venues_listed >= 1 select funding_short_8h
{
"value": -0.000104,
"unit": "fraction",
"venue": "HYPERLIQUID",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

highest funding rate the venue allows, as published, per the listing’s interval; the cap in force at the funding value’s time

Venue-scoped, layer funding, type number, unit fraction.

venues_listed >= 1 select funding_cap
{
"value": 0.005,
"unit": "fraction",
"venue": "KRAKEN-FUTURES",
"layer": "funding",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

lowest funding rate the venue allows, as published, per the listing’s interval; the floor in force at the funding value’s time

Venue-scoped, layer funding, type number, unit fraction.

venues_listed >= 1 select funding_floor
{
"value": -0.005,
"unit": "fraction",
"venue": "KRAKEN-FUTURES",
"layer": "funding",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

funding_cap × 8h / funding_interval, the registry’s; null without one

Venue-scoped, layer funding, type number, unit fraction.

venues_listed >= 1 select funding_cap_8h
{
"value": 0.04,
"unit": "fraction",
"venue": "KRAKEN-FUTURES",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

funding_floor × 8h / funding_interval, the registry’s; null without one

Venue-scoped, layer funding, type number, unit fraction.

venues_listed >= 1 select funding_floor_8h
{
"value": -0.04,
"unit": "fraction",
"venue": "KRAKEN-FUTURES",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

funding sits on the cap or the floor in force at its time (funding >= funding_cap or funding <= funding_floor); null when no cap was observed by then

Venue-scoped, layer funding, type boolean.

venues_listed >= 1 select funding_at_cap
{
"value": false,
"venue": "KRAKEN-FUTURES",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

next_funding_at − T

Venue-scoped, layer funding, type duration, unit ms.

venues_listed >= 1 select time_to_funding
{
"value": 3600000,
"unit": "ms",
"venue": "HYPERLIQUID",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:05:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

open interest

Venue-scoped, layer oi, type number, unit quantity, readable as a series, additive across venues.

venues_listed >= 1 select oi
{
"value": 60800,
"unit": "base",
"venue": "BYBIT-PERP",
"layer": "oi",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

best bid price

Venue-scoped, layer book, type number, unit quote, readable as a series.

venues_listed >= 1 select bid
{
"value": 86989.5,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "book",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

best ask price

Venue-scoped, layer book, type number, unit quote, readable as a series.

venues_listed >= 1 select ask
{
"value": 86990.5,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "book",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

(bid + ask) / 2

Venue-scoped, layer book, type number, unit quote, readable as a series.

venues_listed >= 1 select mid
{
"value": 86990,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "book",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

(ask − bid) / mid

Venue-scoped, layer book, type number, unit fraction, readable as a series.

venues_listed >= 1 select spread
{
"value": 0.000011495574,
"unit": "fraction",
"venue": "BYBIT-PERP",
"layer": "book",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

resting quantity at the best bid

Venue-scoped, layer book, type number, unit quantity, readable as a series, additive across venues.

venues_listed >= 1 select bid_size
{
"value": 0.79,
"unit": "base",
"venue": "BYBIT-PERP",
"layer": "book",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

resting quantity at the best ask

Venue-scoped, layer book, type number, unit quantity, readable as a series, additive across venues.

venues_listed >= 1 select ask_size
{
"value": 3.19,
"unit": "base",
"venue": "BYBIT-PERP",
"layer": "book",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

rolling 24h traded volume as published

Venue-scoped, layer stats, type number, unit quantity, readable as a series, additive across venues.

venues_listed >= 1 select volume_24h
{
"value": 72800,
"unit": "base",
"venue": "BYBIT-PERP",
"layer": "stats",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:02:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

rolling 24h traded value as published

Venue-scoped, layer stats, type number, unit quote, readable as a series, additive across venues.

venues_listed >= 1 select turnover_24h
{
"value": 6332000000,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "stats",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:02:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

24h price change as published

Venue-scoped, layer stats, type number, unit fraction, readable as a series.

venues_listed >= 1 select change_24h
{
"value": 0.011,
"unit": "fraction",
"venue": "BYBIT-PERP",
"layer": "stats",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:02:04Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

A source is one column of the candles of one price type. close is the trade price; mark_close is the venue’s mark price; index_close is its index. They are different measurements and the language keeps them apart — a funding calculation done on trade prices is a different number from the one the venue settled.

A source is only readable at a timeframe: timeframe 15m on the query, or as a trailing argument on the function that reads it.

source price type column unit additive
open trade open quote —
high trade high quote —
low trade low quote —
close trade close quote —
volume trade volume quantity yes
mark_open mark open quote —
mark_high mark high quote —
mark_low mark low quote —
mark_close mark close quote —
mark_volume mark volume quantity yes
index_open index open quote —
index_high index high quote —
index_low index low quote —
index_close index close quote —
index_volume index volume quantity yes

Read one, at a period:

venues_listed >= 1 select close timeframe 15m
{
"value": 86980,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "candles",
"timeframe": "15m",
"bars": 1,
"candle_end": "2026-09-23T12:00:00Z",
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

The bars column says how much history the function needs, as a rule over the window it is given. It is what the platform charges against bars_per_atom and cost, and POST /v2/dql/parse will tell you a query’s cost before you run it.

function kind returns bars unit
prev(S, k) series series bars(S) + n —
sma(S, n) series series bars(S) + n − 1 —
ema(S, n) series series bars(S) + 4n − 1 —
rsi(S, n) series series bars(S) + 4n —
atr(n) series series 4n + 1 —
stdev(S, n) series series bars(S) + n − 1 —
highest(S, n) series series bars(S) + n − 1 —
lowest(S, n) series series bars(S) + n − 1 —
change(S, n) series series bars(S) + n —
roc(S, n) series series bars(S) + n —
crossover(A, B) series boolean max(bars(A), bars(B)) + 1 —
crossunder(A, B) series boolean max(bars(A), bars(B)) + 1 —
gaps(n) series number n —
carried(S, n) series number bars(S) + n − 1 —
abs(x) scalar number bars(x) —
rolling_sum(S, n) series series bars(S) + n − 1 —
percentile(S, n, p, [method]) series series bars(S) + n − 1 —
percentile_rank(S, n) series series bars(S) + n − 1 —
corr(S, X, n, [VENUE]) series series bars(S) + n —
beta(S, X, n, [VENUE]) series series bars(S) + n —
ref(INSTRUMENT, expr, [VENUE]) cross-listing number — —
age(F) data quality duration — —
status(F) data quality status — —
depth_bid(band) book depth number — quantity
depth_ask(band) book depth number — quantity
depth_bid_value(band) book depth number — quote
depth_ask_value(band) book depth number — quote
venue_depth_bid(band) venue depth number — quote
venue_depth_ask(band) venue depth number — quote
liquidation_count(n) event window number n count
liquidation_long_count(n) event window number n count
liquidation_short_count(n) event window number n count
liquidation_volume(n) event window number n quantity
liquidation_long_volume(n) event window number n quantity
liquidation_short_volume(n) event window number n quantity
liquidation_value(n) event window number n quote
liquidation_long_value(n) event window number n quote
liquidation_short_value(n) event window number n quote

S[k]

prev(S, k) — series, returns series, reads bars(S) + n bars.

venues_listed >= 1 select prev(close, 1) timeframe 15m
{
"value": 85476.66666666667,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "candles",
"timeframe": "15m",
"bars": 2,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

simple moving average

sma(S, n) — series, returns series, reads bars(S) + n − 1 bars.

venues_listed >= 1 select sma(close, 20) timeframe 15m
{
"value": 85517.16666666666,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

exponential moving average over a fixed 4n window

ema(S, n) — series, returns series, reads bars(S) + 4n − 1 bars.

venues_listed >= 1 select ema(close, 20) timeframe 15m
{
"value": 85564.184136414,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 80,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

relative strength index, Wilder smoothing over 4n

rsi(S, n) — series, returns series, reads bars(S) + 4n bars.

venues_listed >= 1 select rsi(close, 20) timeframe 15m
{
"value": 85.16667851522334,
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 81,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

average true range of the trade candles

atr(n) — series, returns series, reads 4n + 1 bars.

venues_listed >= 1 select atr(14) timeframe 15m
{
"value": 231.59289811088146,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 57,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

population standard deviation

stdev(S, n) — series, returns series, reads bars(S) + n − 1 bars.

venues_listed >= 1 select stdev(close, 20) timeframe 15m
{
"value": 342.66970653645143,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

max(S[0] … S[n−1])

highest(S, n) — series, returns series, reads bars(S) + n − 1 bars.

venues_listed >= 1 select highest(close, 20) timeframe 15m
{
"value": 87000,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

min(S[0] … S[n−1])

lowest(S, n) — series, returns series, reads bars(S) + n − 1 bars.

venues_listed >= 1 select lowest(close, 20) timeframe 15m
{
"value": 85373.33333333333,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

S[0] − S[n]

change(S, n) — series, returns series, reads bars(S) + n bars.

venues_listed >= 1 select change(close, 20) timeframe 15m
{
"value": 1606.6666666666715,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 21,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

(S[0] − S[n]) / S[n]

roc(S, n) — series, returns series, reads bars(S) + n bars.

venues_listed >= 1 select roc(close, 20) timeframe 15m
{
"value": 0.01881489577640727,
"unit": "fraction",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 21,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

A[0] > B[0] and A[1] ≤ B[1]

crossover(A, B) — series, returns boolean, reads max(bars(A), bars(B)) + 1 bars.

venues_listed >= 1 select crossover(ema(close, 5), ema(close, 20)) timeframe 15m
{
"value": false,
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 81,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

A[0] < B[0] and A[1] ≥ B[1]

crossunder(A, B) — series, returns boolean, reads max(bars(A), bars(B)) + 1 bars.

venues_listed >= 1 select crossunder(ema(close, 5), ema(close, 20)) timeframe 15m
{
"value": false,
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 81,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

missing periods among the last n

gaps(n) — series, returns number, reads n bars.

venues_listed >= 1 select gaps(20) timeframe 15m
{
"value": 1,
"venue": "BYBIT-PERP",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

periods among the last n whose value was carried, not observed

carried(S, n) — series, returns number, reads bars(S) + n − 1 bars.

venues_listed >= 1 select carried(close, 20) timeframe 15m
{
"value": 0,
"venue": "BYBIT-PERP",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

|x|, element-wise for series

abs(x) — scalar, returns number, reads bars(x) bars.

venues_listed >= 1 select abs(change_24h)
{
"value": 0.011,
"unit": "fraction",
"derived": true
}

S[n−1] + … + S[0]

rolling_sum(S, n) — series, returns series, reads bars(S) + n − 1 bars.

venues_listed >= 1 select rolling_sum(close, 20) timeframe 15m
{
"value": 1710343.3333333333,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

nearest-rank (default) or linear percentile of S[0] … S[n−1]

percentile(S, n, p, [method]) — series, returns series, reads bars(S) + n − 1 bars.

venues_listed >= 1 select percentile(close, 20, 0.9) timeframe 15m
{
"value": 85496.66666666667,
"unit": "quote",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

share of S[0] … S[n−1] that are ≤ S[0]

percentile_rank(S, n) — series, returns series, reads bars(S) + n − 1 bars.

venues_listed >= 1 select percentile_rank(close, 20) timeframe 15m
{
"value": 1,
"unit": "fraction",
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 20,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

Pearson correlation of the n simple returns of S and of S of instrument X, on the same venue (or VENUE)

corr(S, X, n, [VENUE]) — series, returns series, reads bars(S) + n bars.

venues_listed >= 1 select corr(close, BTC-PERP, 10) timeframe 15m
{
"value": 1,
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 11,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

cov(returns of S, returns of X) / var(returns of X) over n simple returns, X on the same venue (or VENUE)

beta(S, X, n, [VENUE]) — series, returns series, reads bars(S) + n bars.

venues_listed >= 1 select beta(close, BTC-PERP, 10) timeframe 15m
{
"value": 1,
"venue": "HYPERLIQUID",
"layer": "candles",
"timeframe": "15m",
"bars": 11,
"candle_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T12:00:00.300Z",
"age_ms": 4700,
"status": "present"
}

the value of expr for the instrument INSTRUMENT on the same venue (or VENUE), at the same instant; a series expr is read at its latest bar, so the result is a scalar (a series function goes inside: ref(X, sma(mark_close, 20))); null with not_in_scope when it is not in scope there

ref(INSTRUMENT, expr, [VENUE]) — cross-listing, returns number.

venues_listed >= 1 select ref(BTC-PERP, mark)
{
"value": 86990,
"unit": "quote",
"venue": "BYBIT-PERP",
"instrument": "BTC-PERP",
"layer": "mark",
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

T − received_at of the value used for F

age(F) — data quality, returns duration.

venues_listed >= 1 select age(funding)
{
"value": 485000,
"unit": "ms",
"venue": "BYBIT-PERP",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T11:52:00Z",
"age_ms": 485000,
"venue_age_ms": null,
"valid_until": "2026-09-23T11:57:00Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "stale"
}

state of F’s layer at T

status(F) — data quality, returns status.

venues_listed >= 1 select status(funding)
{
"value": "stale",
"venue": "BYBIT-PERP",
"layer": "funding",
"derived": true,
"venue_ts": null,
"received_at": "2026-09-23T11:52:00Z",
"age_ms": 485000,
"venue_age_ms": null,
"valid_until": "2026-09-23T11:57:00Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "stale"
}

bid quantity within band of mid

depth_bid(band) — book depth, returns number.

venues_listed >= 1 select depth_bid(10bps)
{
"value": 0.79,
"unit": "base",
"venue": "BYBIT-PERP",
"layer": "book",
"band": "10bps",
"reference": "mid",
"levels": 4,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

ask quantity within band of mid

depth_ask(band) — book depth, returns number.

venues_listed >= 1 select depth_ask(10bps)
{
"value": 3.19,
"unit": "base",
"venue": "BYBIT-PERP",
"layer": "book",
"band": "10bps",
"reference": "mid",
"levels": 4,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

bid value (price × size) within band of mid

depth_bid_value(band) — book depth, returns number.

venues_listed >= 1 select depth_bid_value(10bps)
{
"value": 68721.705,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "book",
"band": "10bps",
"reference": "mid",
"levels": 4,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

ask value (price × size) within band of mid

depth_ask_value(band) — book depth, returns number.

venues_listed >= 1 select depth_ask_value(10bps)
{
"value": 277499.695,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "book",
"band": "10bps",
"reference": "mid",
"levels": 4,
"venue_ts": null,
"received_at": "2026-09-23T12:00:04Z",
"age_ms": 1000,
"venue_age_ms": null,
"valid_until": "2026-09-23T12:00:34Z",
"horizon_source": "assumed",
"anchor": "receipt",
"status": "present"
}

bid-side depth the venue publishes within band of price

venue_depth_bid(band) — venue depth, returns number.

venues_listed >= 1 select venue_depth_bid(10bps)
{
"value": null,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "venue_depth",
"band": "10bps",
"reference": null,
"levels": null,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "not_published",
"reason": "venue_capability"
}

ask-side depth the venue publishes within band of price

venue_depth_ask(band) — venue depth, returns number.

venues_listed >= 1 select venue_depth_ask(10bps)
{
"value": null,
"unit": "quote",
"venue": "BYBIT-PERP",
"layer": "venue_depth",
"band": "10bps",
"reference": null,
"levels": null,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "not_published",
"reason": "venue_capability"
}

number of liquidations in the last n periods

liquidation_count(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_count(4) timeframe 15m
{
"value": 4,
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

number of long positions liquidated in the last n periods

liquidation_long_count(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_long_count(4) timeframe 15m
{
"value": 3,
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

number of short positions liquidated in the last n periods

liquidation_short_count(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_short_count(4) timeframe 15m
{
"value": 1,
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

quantity of liquidations in the last n periods

liquidation_volume(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_volume(4) timeframe 15m
{
"value": 2.1,
"unit": "base",
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

quantity of long positions liquidated in the last n periods

liquidation_long_volume(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_long_volume(4) timeframe 15m
{
"value": 1.8,
"unit": "base",
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

quantity of short positions liquidated in the last n periods

liquidation_short_volume(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_short_volume(4) timeframe 15m
{
"value": 0.3,
"unit": "base",
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

value (price × quantity) of liquidations in the last n periods

liquidation_value(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_value(4) timeframe 15m
{
"value": 181364.5,
"unit": "quote",
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

value (price × quantity) of long positions liquidated in the last n periods

liquidation_long_value(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_long_value(4) timeframe 15m
{
"value": 155249.5,
"unit": "quote",
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

value (price × quantity) of short positions liquidated in the last n periods

liquidation_short_value(n) — event window, returns number, reads n bars.

venues_listed >= 1 select liquidation_short_value(4) timeframe 15m
{
"value": 26115,
"unit": "quote",
"venue": "KRAKEN-FUTURES",
"layer": "liquidation",
"timeframe": "15m",
"bars": 4,
"window_start": "2026-09-23T11:00:00Z",
"window_end": "2026-09-23T12:00:00Z",
"derived": true,
"venue_ts": null,
"received_at": null,
"age_ms": null,
"status": "present"
}

Names the specification mentions that are not functions of the language: rma and sqrt are notation inside the formulas of §7.3, not things a query may call. depth_bid and depth_ask were fields in an early draft and are functions of a price band now — depth_bid_qty(10bps), not depth_bid.