{
  "openapi": "3.1.1",
  "info": {
    "title": "DEBYKO API",
    "description": "Crypto derivatives data from every venue that quotes an instrument, stored as each venue published it: each\nvalue carries the venue that published it, the time DEBYKO received it and its age.\n\n## What this API will not do to your data\n\n- **A missing value is never a zero.** A venue that does not publish a field is absent from the\n  answer, and the answer says which of the five it is: the value is there and fresh, there and stale,\n  the layer is collected but nothing has arrived, the venue publishes no such field, or nobody is\n  collecting it for that listing. Nothing is filled in.\n- **Venues are never averaged.** There is no “the price of BTC” here. There is what Bybit published,\n  what Kraken published, and the age of each.\n- **Values come back as the venue published them.** Prices are not rounded, rescaled or re-serialised\n  on the way through; a derived figure (a spread, a rate) says so and carries its own definition.\n- **Gaps are not filled.** History is stored with its holes intact, and an answer about a period nobody\n  quoted is empty rather than interpolated.\n\n## What this reference covers\n\n`/v2`, which is the platform: selection in DQL, point-in-time replay, per-second history, candles in\nany of the stored periods, books, screening and a live stream.\n\nMost measurement endpoints need a key. The venue and instrument catalogues, DQL catalogue and parser,\nplan list, public operational budgets, and public anchors do not; you can see what exists and what a\nquery may ask before deciding to pay for measurement data.\n\nThe unkeyed `/v1` display API and `/lab` demo were removed as part of issue 307. Use the V2 reference\nand the generated clients for platform integrations. Spot listings are available through the V2\nmarket-data endpoints when `kind` is `spot` or `all`; DQL and Agent selection remains perpetual-only.\n\n## Getting started\n\n```bash\n# what is collected, no key needed\ncurl \"https://api.debyko.com/v2/venues\"\ncurl \"https://api.debyko.com/v2/dql/catalogue\"\n\n# a measurement, with a key\ncurl -H \"Authorization: Bearer $DEBYKO_KEY\" \\\n  -H \"content-type: application/json\" \\\n  -d '{\"where\":\"base = BTC\",\"layers\":[\"mark\",\"funding\",\"book\"]}' \\\n  \"https://api.debyko.com/v2/snapshots\"\n```\n\nA key is issued at [studio.debyko.com/account](https://studio.debyko.com/account); the Free plan needs\nno card. Send it as `Authorization: Bearer <key>` — never in a URL, where it would be written into\nlogs and browser history. A key sent as a query parameter is refused with `KEY_IN_URL`.\n\n\n# Keys and plans\n\nEvery `/v2` endpoint that returns a measurement needs a key:\n\n```\nAuthorization: Bearer dbk_…\n```\n\nA key is issued at [studio.debyko.com/account](https://studio.debyko.com/account). The Free plan is\nissued without a card; Mini, Standard and Pro start with a free trial, and Pro Plus is charged at\ncheckout. One key covers Studio and the API — whatever a plan includes in Studio, it includes here. Agent evaluates under its own allowance, shown in its row.\n\n**Never in a URL.** A key in a query string is written into server logs, proxy logs and browser\nhistory. A request that carries one is refused with `KEY_IN_URL` and the key should be replaced from\nyour account.\n\n## What a plan changes\n\nA plan limits history and request rates; every plan sees every venue and instrument:\n\n- **venues and instruments**: every plan sees every venue and instrument in the registry. `DQL_UNKNOWN_VENUE`\n  is for a code that is no venue at all;\n- **history**: asking further back than a plan reaches is refused with `PLAN_LIMIT`, naming the date\n  the plan reaches and what it would take to go further — never a shortened answer that looks whole.\n  The error carries `next` (one sentence with the earliest instant the plan reads for this request) and, for\n  `POST /v2/candles`, `earliest_from` and `retry_with`: the same request with `from` moved to that instant.\n  The first such refusal of a Free account that has never had a trial is not shown: Standard answers the request, the\n  answer carries `trial` (`plan`, `until`), and Standard stays open for 4 days (`plan.trial_until` of `GET /v2/account`).\n  The first refusal of Free's number of Agent rules, DQL screening requests a minute or requests a day opens it the same way\n  (`trial.cap`, `trial.limit`); the per-second burst does not. One trial per account, ever; at `until` the account is Free again.\n  Free, Mini and Standard read every candle timeframe, as deep as the timeframe allows: Free `1m` 48 hours, `5m` and `15m` 7 days, `1h` 30 days,\n  `4h` and `1d` 90 days; Mini 7, 30, 90 and 180 days; Standard, Pro and Pro Plus the whole database window. Everything else (snapshots, history, trades,\n  liquidations, funding settlements, `screen`) reaches the plan's `history_days` (Free 7, Mini 30; Standard, Pro and Pro Plus the database window).\n  How long each layer is held in the database is a number per layer and candle timeframe, read from the retention classes in force: `history` of `GET /v2/account`\n  (and of every plan in `GET /v2/plans`) gives `hot_days` (the shortest of any listing), `reads_days` (what this plan reads of it), `archive_since` (the first\n  day with a verified file) and `archive.files_per_month`. A request (history, trades or candles) that lies wholly before the hot window of everything it asks for is refused `PLAN_LIMIT` with the\n  layer, the window in days and the earliest hot instant, and then one of: the exact `GET /v2/archive/{listing}/{layer}/{day}` when that day has a file; `no data before <date>`\n  when the venue has none that early; or that the archive has no file for the day. A request that reaches into the window is answered, and what is older is `not_retained`, with the archive pointer where\n  a file exists. No Parquet is served through the other endpoints; per file, x402 pays when there is no key. `funding_settlement` and `liquidation` are not swept (`history.not_swept`).\n  `GET /v2/plans` lists the depth of every plan (`history_days`, and `candle_history_days` for each timeframe);\n- **rate**: requests per second and per day, and the number of live streams, are counted per key.\n  The per-second limit is a token bucket: the plan's sustained rate refills it and its burst (4 times the rate, at least 10: Free is 2 a second, burst 10) is\n  what a key may send at once. Exceeding a limit is a `429` with `Retry-After` and, in `limit`, the name of the limit that stopped you.\n\nUsage is counted per key, per hour and per endpoint class, and is visible in your account. No\nper-request log of what you asked is kept.\n\n## Without a key: pay per call\n\n**On in production since 2026-10-02.** Six requests are payable without a key: `POST /v2/snapshots`, `POST /v2/snapshots/history`, `POST /v2/screen`,\n`POST /v2/candles`, `GET /v2/agent/state` (per rule named) and `GET /v2/archive/{listing}/{layer}/{day}` (per file). Called with no `Authorization` header they\nare answered `402` with a price in USDC on Base ([x402](https://www.x402.org)), and the same request\nwith a signed payment in `PAYMENT-SIGNATURE` is answered as Pro answers it, for that one request. A request that carries both a key and a payment is the\nkey's: the payment is not read. The prices, the order, and what is charged when something goes wrong are in the [limits](#limits) and at\n[docs.debyko.com/api/x402](https://docs.debyko.com/api/x402/).\n\nThe same 402 also offers **a plan** (Mini, Standard, Pro, Pro Plus, at the price of checkout) for 30 days with no renewal: pay its amount and the answer is a key of that plan, shown once, with no account\n(Agent rules need a free account the key is linked to). From three days before such a key expires every response carries `X-Debyko-Key-Expires`. `GET /v2/agent/state` is payable per rule named, and a file of the [archive](https://docs.debyko.com/data/archive/) per file (0.10 core, 0.05 top-100).\n[Pay with USDC](https://docs.debyko.com/api/pay-with-usdc/) has the whole of it.\n\n\n# Selecting with DQL\n\nDQL is how a request says **what it is about** — one language for selection across every endpoint,\ninstead of a different set of query parameters per resource.\n\n```\nwhere: base = BTC and venue in (BYBIT-PERP, KRAKEN-FUTURES)\n```\n\nThe same `where` selects for a snapshot, for history, for candles, for books and for the stream. What\nyou may name in it — the fields, the operators, the layers, the timeframes and the limits — is not\nwritten into this page: it is published live at `GET /v2/dql/catalogue`, so it can never disagree with\nwhat the platform actually holds.\n\nBefore sending a query, `POST /v2/dql/parse` will check it and answer with the position of the first\nproblem and what was expected there. It is free and needs no key, because a parser is a tool, not a\nmeasurement.\n\nAn instrument is named by its market code (`BTC-PERP`), a venue by its published code\n(`BYBIT-PERP`) — codes are permanent once published, so a saved query keeps working.\n\n\n# The language\n\nThe whole language, in the order you meet it. Each section states what a thing means, gives the grammar\nfor it exactly as the specification writes it, shows a query, and shows **the answer the engine gave** on\nthe documentation fixture — real venue codes and symbols, invented numbers.\n\nIf you want the language by example instead, read [the guide](#the-guide). If you want every name it has,\nread [the reference](#fields). This page is the map between them.\n\n## 1. The shape of a query\n\nA query is a condition, and then any number of clauses. The condition decides which instruments come back; the clauses decide what is read, when, in what order and what is returned alongside.\n\n```ebnf\nquery        = condition , { clause } ;\n\nclause       = \"timeframe\" , DURATION\n             | \"freshness\" , DURATION\n             | \"as\" , \"of\" , TIMESTAMP\n             | \"order\" , \"by\" , order_item , { \",\" , order_item }        (* C1-06: several keys *)\n             | \"select\" , expression , { \",\" , expression }              (* C1-05 *)\n             | \"where\" , condition ;                                     (* C4-02: selection *)\n\norder_item   = expression , [ \"asc\" | \"desc\" ] ;\n\n```\n\n```dql\nany(venues where funding > 0) where base = BTC order by max(venues, oi) desc select max(venues, oi)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {\n        \"max(venues, oi)\": {\n          \"value\": 60800,\n          \"unit\": \"base\",\n          \"from\": [\n            {\n              \"venue\": \"BYBIT-PERP\",\n              \"value\": 60800,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        }\n      },\n      \"scopes\": {\n        \"any(venues where funding > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        },\n        \"max(venues, oi)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            },\n            \"oi\": {\n              \"value\": 60800,\n              \"unit\": \"base\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"oi\": {\n              \"value\": 9400,\n              \"unit\": \"base\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"oi\": {\n              \"value\": 5800,\n              \"unit\": \"base\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"oi\": {\n              \"value\": 41200,\n              \"unit\": \"base\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\nClause order is free when you write it and fixed when the platform prints it back: `timeframe`, `freshness`, `as of`, `order by`, `select`, `where`. Each clause may appear once; twice is `DQL_DUPLICATE_CLAUSE`. A query may also be a selection alone — `where base = BTC` with no condition is valid and means \"every listing that matches\", which is what the data endpoints send.\n\n## 2. Text and machine form\n\nEvery query exists in two forms: the text you write and a JSON object with the same meaning. An editor that builds queries structurally sends the second and never has to quote anything. Every answer echoes both, canonically.\n\n```dql\nany(venues where funding > 0)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where funding > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjdlZjMxMGZmYTMyOTI2ZDEifQ\"\n  }\n}\n```\n\nThe `query.string` is the canonical text — what the platform understood, which may differ from what you sent in spacing and clause order. The `query.json` is the same thing as a tree. Send either; `POST /v2/dql/parse` converts between them without reading any market data.\n\n## 3. Scopes\n\nA name belongs either to the instrument or to one venue's listing of it. An instrument has several venues, so a venue-scoped name has to say which ones you mean.\n\n```ebnf\nquantifier   = ( \"any\" | \"all\" | \"count\" ) , \"(\" , \"venues\" , \"where\" , condition , \")\" ;\naggregate    = ( \"max\" | \"min\" | \"sum\" ) , \"(\" , \"venues\" , [ \"where\" , condition ] ,\n               \",\" , expression , \")\" ;\n\n```\n\n```dql\ncount(venues where funding > 0) >= 2\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"count(venues where funding > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjhiMzkyMmIxYmFjMzVhYWMifQ\"\n  }\n}\n```\n\nWriting `funding > 0` on its own is `DQL_SCOPE`, not a shortcut for \"some venue\": funding is a fact about one venue's listing, and the language will not pick one for you. Quantifiers do not nest — there is one level of venues, so an inner one would have nothing to range over.\n\n## 4. Literals and units\n\nNumbers may carry `%` or `bps`; durations are written `30s`, `15m`, `4h`; timestamps are ISO-8601 and always UTC. A bare uppercase word is a code — a venue, an asset, a currency, an instrument — and is checked against the catalogue.\n\n```ebnf\nprimary      = NUMBER\n             | DURATION\n             | CODE\n             | STRING                                                    (* C4-02, `symbol` only *)\n             | status_lit\n             | method_lit                                                (* C2-03, percentile only *)\n             | IDENT\n             | call\n             | quantifier\n             | aggregate\n             | \"(\" , condition , \")\" ;\n\nmethod_lit   = \"nearest\" | \"linear\" ;\n\nin_literal   = CODE | status_lit ;\nstatus_lit   = \"present\" | \"stale\" | \"missing\" | \"not_published\" | \"off\" ;\n```\n\n```dql\nany(venues where funding_8h > 1bps and status(funding) = present)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where funding_8h > 0.0001 and status(funding) = present)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            },\n            \"status(funding)\": {\n              \"value\": \"stale\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.000104,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.00008,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\n`1bps` is `0.0001` and `0.5%` is `0.005`; the platform stores the canonical number and prints it back that way, which is why a query asking for `10bps` comes back as `0.001`. Keywords are lower case, codes are upper case, and a quoted string is only ever a venue's own symbol.\n\n## 5. Operators\n\nArithmetic, comparison and the three connectives. Precedence is the usual one: unary minus, then `* /`, then `+ -`, then comparison, then `not`, then `and`, then `or`.\n\n```ebnf\ncondition    = or_expr ;\nor_expr      = and_expr , { \"or\" , and_expr } ;\nand_expr     = not_expr , { \"and\" , not_expr } ;\nnot_expr     = \"not\" , not_expr\n             | comparison ;\ncomparison   = expression , [ compare_op , expression\n                            | \"in\" , \"(\" , in_literal , { \",\" , in_literal } , \")\" ] ;\ncompare_op   = \"=\" | \"==\" | \"!=\" | \"<>\" | \"<\" | \"<=\" | \">\" | \">=\" ;\n\nexpression   = term , { ( \"+\" | \"-\" ) , term } ;\nterm         = factor , { ( \"*\" | \"/\" ) , factor } ;\nfactor       = \"-\" , factor\n             | primary ;\n```\n\n```dql\nany(venues where (mark - index) / index > 5bps)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where (mark - index) / index > 0.0005)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 86990,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"index\": {\n              \"value\": 86950,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 87010,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"index\": {\n              \"value\": 86960,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 87000,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"index\": {\n              \"value\": 86950,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 86995,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"index\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"not_retained\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6Ijk2ZWExZjk5MGMyMjc1OTUifQ\"\n  }\n}\n```\n\nTwo differences from what you may expect. `=` is comparison, never assignment. And `not` binds looser than comparison, so `not a > b` means `not (a > b)`. Comparison is non-associative: `a < b < c` is a syntax error rather than a surprise.\n\n## 6. Quantifiers and aggregates\n\n`any`, `all` and `count` ask a question about the venues. `max`, `min` and `sum` compute one number from them.\n\n```ebnf\nquantifier   = ( \"any\" | \"all\" | \"count\" ) , \"(\" , \"venues\" , \"where\" , condition , \")\" ;\naggregate    = ( \"max\" | \"min\" | \"sum\" ) , \"(\" , \"venues\" , [ \"where\" , condition ] ,\n               \",\" , expression , \")\" ;\n\n```\n\n```dql\nmax(venues where quote = USDT, oi) > 1000\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {\n        \"max(venues where quote = USDT, oi)\": {\n          \"value\": 60800,\n          \"unit\": \"base\",\n          \"from\": [\n            {\n              \"venue\": \"BYBIT-PERP\",\n              \"value\": 60800,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        }\n      },\n      \"scopes\": {\n        \"max(venues where quote = USDT, oi)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"quote\": {\n              \"value\": \"USDT\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"oi\": {\n              \"value\": 60800,\n              \"unit\": \"base\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"quote\": {\n              \"value\": \"USDC\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"oi\": {\n              \"value\": 9400,\n              \"unit\": \"base\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"quote\": {\n              \"value\": \"USD\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"oi\": {\n              \"value\": 5800,\n              \"unit\": \"base\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"quote\": {\n              \"value\": \"USDT\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"oi\": {\n              \"value\": 41200,\n              \"unit\": \"base\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImJiMjc1OWQ1YmY1N2M5YTQifQ\"\n  }\n}\n```\n\n`sum` refuses a field that is not additive: adding prices across venues is a category error, not a small inaccuracy. An aggregate whose venues all drop out by its `where` or a null is null with `no_value`. When no venue is in scope at all (every listing halted, or the field off or not published there), every quantifier and aggregate is unknown with `no_venues`, `count` included: `any` over nothing as false and `count(…) >= 0` as true would be facts about emptiness, not about the market.\n\n## 7. Series\n\nCandles and sampled snapshots, read at a period. A series function needs a timeframe — on the query or as its own last argument.\n\n```ebnf\ncall         = IDENT , \"(\" , [ condition , { \",\" , condition } ] , \")\" ;\n```\n\n```dql\nany(venues where ema(close, 20) > ema(close, 50)) timeframe 1h\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"1h\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where ema(close, 20) > ema(close, 50))\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImRkOWI3MzhhMWQzNzY1OTQifQ\"\n  }\n}\n```\n\n`S[0]` is the last completed period, never the forming one: the platform stores closed minutes only, so there is no half-finished candle to read. A window that reaches further back than the data goes is null with `insufficient_history`, and a hole inside the window is null with `gap` — neither is silently filled.\n\n## 8. Data quality\n\n`age` and `status` are how a query asks about the data rather than about the market.\n\n```dql\nall(venues where status(funding) = present and age(mark) < 10s)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"SOL-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"all(venues where status(funding) = present and age(mark) < 10s)\": {\n          \"venues_listed\": 1,\n          \"venues_in_scope\": 1,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"SOL\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"age(mark)\": {\n              \"value\": 1000,\n              \"unit\": \"ms\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"mark\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\nThe five statuses are `present`, `stale`, `missing`, `not_published` and `off`. The last two are kept apart on purpose: `not_published` is a fact about the venue, `off` is a decision the platform made and can change. Ask whether a value is current with `status`, not with an `age` of your own: `age(F)` is the time since the venue dated the value, and a settled funding rate (dYdX, Coinbase INTX) is dated by its settlement — forty minutes old and current in the middle of an hourly period — so `age(funding) < 2m` is false there for most of every hour, while `status(funding) = present` says what was meant.\n\n## 9. Book depth in bands\n\nHow much rests within a price band of the mid, per side, in quantity or in quote value.\n\n```dql\nany(venues where depth_bid_value(10bps) > 100000)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where depth_bid_value(0.001) > 100000)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"depth_bid_value(0.001)\": {\n              \"value\": 68721.705,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"band\": \"10bps\",\n              \"reference\": \"mid\",\n              \"levels\": 4,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"depth_bid_value(0.001)\": {\n              \"value\": 295830.6,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"book\",\n              \"band\": \"10bps\",\n              \"reference\": \"mid\",\n              \"levels\": 4,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"depth_bid_value(0.001)\": {\n              \"value\": 104398.8,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"band\": \"10bps\",\n              \"reference\": \"mid\",\n              \"levels\": 4,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"depth_bid_value(0.001)\": {\n              \"value\": 208787.76,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"band\": \"10bps\",\n              \"reference\": \"mid\",\n              \"levels\": 4,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjRhMzA2ZWYwNTYwNzU0NWMifQ\"\n  }\n}\n```\n\nThe bands are a fixed set — `0.001`, `0.0025`, `0.005`, `0.01` as fractions of the mid. A side the received book did not reach is null with `band_truncated`, never a partial sum presented as a whole one.\n\n## 10. Three-valued logic\n\nA comparison involving a value that is missing or stale is neither true nor false. It is unknown, and unknown propagates.\n\n```dql\nall(venues where funding > 0)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"all(venues where funding > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImI2ZTllZTg0MjMxMDhjNTMifQ\"\n  }\n}\n```\n\nThis is the part most worth understanding. `all(...)` over venues where one reading is stale answers *unknown*, not false — the platform does not know. Ask for `include_unknown` and those instruments come back with `result: unknown` instead of being dropped, which is the difference between a screen that reports its coverage and one that quietly narrows it.\n\n## 11. Point in time\n\n`as of` asks the same question about a past instant. What was visible then is what is used.\n\n```dql\ncount(venues where funding > 0) >= 2 as of 2026-09-23T08:00:00Z\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": \"2026-09-23T08:00:00Z\",\n  \"settled\": true,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\nVisibility is by receipt time, not by the venue's timestamp: a reading that arrived late was not visible at the instant it describes, and a replay that used it would be a backtest of information you did not have. A stored reading kept as the last of its sampling window (one or ten seconds; funding ten) counts from the end of that window, when it could no longer be replaced. \"Now\" is the newest reading, which can be one reading ahead of what history holds until its window closes. An answer says whether its instant is `settled` — whether late arrivals can still change it.\n\n## 12. Freshness\n\nEvery value has its own horizon, from a published fact about its venue's cadence; past it, the value is stale. A query may set a tighter bound of its own, never a looser one.\n\n```dql\nany(venues where funding > 0) freshness 10m\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": \"10m\",\n    \"mark\": \"10m\",\n    \"oi\": \"10m\",\n    \"book\": \"10m\",\n    \"stats\": \"10m\",\n    \"funding\": \"10m\"\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where funding > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjdlYjNlM2NkYTgxZTdiOTYifQ\"\n  }\n}\n```\n\nA stale value compares as unknown and is not returned as a value — its reason says why: `horizon_passed`, `connection_lost`, `state_lag` (the platform's own lag, not the venue's), `source_error` (the venue refused our requests), `horizon_unknown`, `freshness_bound`, `halted` (the venue does not trade the listing at that instant), `no_update` (a value pushed only on change that has not changed for longer than its pair's threshold, its connection alive). `status(F) = stale` asks for it explicitly and is never unknown. A value the venue pushes only on change holds while its connection lives, up to that threshold, and a series over it carries it forward, marked: `carried(S, n)`. What each venue's horizon rests on is on the Freshness and cadence page.\n\n## 13. Selecting listings\n\n`where` chooses which listings the query runs over, before the condition is evaluated.\n\n```ebnf\nclause       = \"timeframe\" , DURATION\n             | \"freshness\" , DURATION\n             | \"as\" , \"of\" , TIMESTAMP\n             | \"order\" , \"by\" , order_item , { \",\" , order_item }        (* C1-06: several keys *)\n             | \"select\" , expression , { \",\" , expression }              (* C1-05 *)\n             | \"where\" , condition ;                                     (* C4-02: selection *)\n\n```\n\n```dql\nvenues_listed >= 1 where venue = KRAKEN-FUTURES and base = BTC\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {\n        \"venues_listed\": {\n          \"value\": 1,\n          \"from\": \"reference\",\n          \"as_of\": \"2026-09-23T12:00:05Z\"\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {}\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\n`where` is evaluated at listing scope — `venue`, `symbol`, `quote`, `instrument`, `base` — and never at instrument scope. A listing that maps to no instrument is still selected and comes back with `instrument: null`; `instrument = X` never matches one.\n\n## 14. Reading another listing\n\n`ref(INSTRUMENT, expr)` is the value of an expression for another instrument on the same venue, at the same instant; `ref(INSTRUMENT, expr, VENUE)` names the venue. It is how a rule on one pair reads BTC — a regime filter.\n\n```dql\nany(venues where ref(BTC-PERP, mark) > 86990) where base = ETH\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"ETH-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where ref(BTC-PERP, mark) > 86990)\": {\n          \"venues_listed\": 3,\n          \"venues_in_scope\": 3,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"ETHUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ref(BTC-PERP, mark)\": {\n              \"value\": 86990,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"instrument\": \"BTC-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_ETHUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"ref(BTC-PERP, mark)\": {\n              \"value\": 87000,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"instrument\": \"BTC-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"ETH-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ref(BTC-PERP, mark)\": {\n              \"value\": 86995,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"instrument\": \"BTC-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\nThe instrument you read is not part of the answer, only its value: the answer above is about ETH-PERP, and each value says whose it is with `instrument` beside `venue`. Timeframes travel inside the expression (`ref(BTC-PERP, ema(mark_close, 50, 4h))`). A `ref` is one value at that instant, never a series: a series inside it is read at its latest bar, so a series function goes inside (`ref(BTC-PERP, sma(mark_close, 20))`), and `sma(ref(BTC-PERP, mark_close), 20)` is `DQL_TYPE`. A rolling series across two listings is not supported. Outside a quantifier the venue is required (`DQL_SCOPE`), the expression holds no `ref`, quantifier or aggregate (`DQL_NESTING`), and a query may read at most 4 different listings (`DQL_COMPLEXITY`). A target that is not listed there, is halted, or has a layer the expression reads switched off or not published is null with `not_in_scope`, and the comparison is unknown.\n\n## 15. What comes back\n\nEvery value is an object: the number, and everything needed to judge it.\n\n```dql\nany(venues where funding > 0) select funding, status(funding), age(funding)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where funding > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            },\n            \"status(funding)\": {\n              \"value\": \"stale\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\"\n            },\n            \"age(funding)\": {\n              \"value\": 485000,\n              \"unit\": \"ms\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"age(funding)\": {\n              \"value\": 1000,\n              \"unit\": \"ms\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"age(funding)\": {\n              \"value\": 1000,\n              \"unit\": \"ms\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"age(funding)\": {\n              \"value\": 1000,\n              \"unit\": \"ms\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImY5MGMxNDk4MWVkMTljMmMifQ\"\n  }\n}\n```\n\nA value carries the venue that published it, the venue's own timestamp, when the platform received it, how old that made it, its unit and its status — and a reason whenever it is null. An aggregate carries the readings it stands on instead of one venue; a derived figure carries the values it was computed from.\n\n## 16. Limits\n\nEvery ceiling is served as data by `GET /v2/dql/catalogue` and explained in [Limits](#limits). The ones that shape how a query is written:\n\n| limit | value |\n| --- | --- |\n| longest query text | 8192 bytes |\n| quantifiers and aggregates in one query | 16 |\n| series calls | 32 |\n| different periods | 3 |\n| longest window | 500 periods |\n| values in one `select` | 16 |\n| keys in one `order by` | 4 |\n| listings one query reads with `ref` | 4 |\n\n`POST /v2/dql/parse` returns a query's cost before you run it.\n\n## 17. What the language does not do\n\nStated because a language's edges are as much a part of it as its middle, and because each of these was\ndecided rather than forgotten.\n\n- **Boolean series.** `crossover` returns a truth about the last period, not a series of truths you can\n  feed to another function. Chaining them needs a way to say which period you mean, and no wording for\n  that has survived review.\n- **Cross-instrument joins.** A query can read one other instrument's listing with `ref`, a few times, and\n  cannot range over instruments (\"any instrument where…\"). The scope rules have two levels, instrument and\n  venue; a third would make every condition ambiguous about which instrument it is talking about.\n- **Sub-minute sampling.** One minute is the base period the platform stores. A query asking for less is\n  asking about jitter in the collection, not about the market.\n- **Mark-price sampled series.** Snapshot layers are sampled; the mark layer is not sampled into a series\n  of its own, because `mark_close` candles already exist and two answers to one question is one too many.\n- **Spot.** The platform collects perpetual futures. Spot is not a missing feature; it is a different\n  product.\n\nEach of these is a decision with a reason, and each can be revisited. None of them is a bug.\n\n\n# Fields, sources and functions\n\nEvery name a query may use. Generated from the catalogue the engine runs on — `GET /v2/dql/catalogue`\nserves the same thing as data, and a client should read it from there rather than carry a copy.\n\nEach entry shows a query that reads it and **the value the engine gave back**, on the documentation\nfixture. The shape is the shape you will get; the numbers are invented.\n\nTwo columns are worth understanding before the tables:\n\n- **scope** — `instrument` names belong to the instrument, `venue` names to one venue's listing of it. A\n  venue-scoped name has to sit inside `any(…)`, `all(…)`, `count(…)` or an aggregate, because an\n  instrument has several venues and the language will not silently pick one.\n- **additive** — whether summing it across venues means anything. `sum` refuses a field that is not\n  additive: adding prices is a category error, not a small inaccuracy.\n\n## Fields\n\n| field | scope | layer | type | unit | sampleable | additive |\n| --- | --- | --- | --- | --- | --- | --- |\n| [`instrument`](#instrument) | instrument | reference | code | code | — | — |\n| [`base`](#base) | instrument | reference | code | code | — | — |\n| [`venues_listed`](#venues-listed) | instrument | reference | number | count | — | — |\n| [`venues_answered`](#venues-answered) | instrument | reference | number | count | — | — |\n| [`venue`](#venue) | venue | reference | code | code | — | — |\n| [`quote`](#quote) | venue | reference | code | code | — | — |\n| [`tick_size`](#tick-size) | venue | reference | number | quote | — | — |\n| [`lot_size`](#lot-size) | venue | reference | number | quantity | — | — |\n| [`min_qty`](#min-qty) | venue | reference | number | quantity | — | — |\n| [`last`](#last) | venue | ticker | number | quote | yes | — |\n| [`mark`](#mark) | venue | mark | number | quote | yes | — |\n| [`index`](#index) | venue | mark | number | quote | yes | — |\n| [`basis`](#basis) | venue | mark | number | fraction | yes | — |\n| [`funding`](#funding) | venue | funding | number | fraction | yes | — |\n| [`funding_interval`](#funding-interval) | venue | funding | duration | ms | — | — |\n| [`funding_8h`](#funding-8h) | venue | funding | number | fraction | yes | — |\n| [`funding_short`](#funding-short) | venue | funding | number | fraction | yes | — |\n| [`funding_short_8h`](#funding-short-8h) | venue | funding | number | fraction | yes | — |\n| [`funding_cap`](#funding-cap) | venue | funding | number | fraction | — | — |\n| [`funding_floor`](#funding-floor) | venue | funding | number | fraction | — | — |\n| [`funding_cap_8h`](#funding-cap-8h) | venue | funding | number | fraction | — | — |\n| [`funding_floor_8h`](#funding-floor-8h) | venue | funding | number | fraction | — | — |\n| [`funding_at_cap`](#funding-at-cap) | venue | funding | boolean | — | — | — |\n| [`time_to_funding`](#time-to-funding) | venue | funding | duration | ms | — | — |\n| [`oi`](#oi) | venue | oi | number | quantity | yes | yes |\n| [`bid`](#bid) | venue | book | number | quote | yes | — |\n| [`ask`](#ask) | venue | book | number | quote | yes | — |\n| [`mid`](#mid) | venue | book | number | quote | yes | — |\n| [`spread`](#spread) | venue | book | number | fraction | yes | — |\n| [`bid_size`](#bid-size) | venue | book | number | quantity | yes | yes |\n| [`ask_size`](#ask-size) | venue | book | number | quantity | yes | yes |\n| [`volume_24h`](#volume-24h) | venue | stats | number | quantity | yes | yes |\n| [`turnover_24h`](#turnover-24h) | venue | stats | number | quote | yes | yes |\n| [`change_24h`](#change-24h) | venue | stats | number | fraction | yes | — |\n\n### instrument\n\nthe market code, e.g. BTC-PERP\n\n*Instrument-scoped, layer `reference`, type code, unit code.*\n\n```dql\nvenues_listed >= 1 select instrument\n```\n\n```json\n{\n  \"value\": \"BTC-PERP\",\n  \"from\": \"reference\",\n  \"as_of\": \"2026-09-23T12:00:05Z\"\n}\n```\n\n### base\n\nthe base asset's registry code, e.g. BTC\n\n*Instrument-scoped, layer `reference`, type code, unit code.*\n\n```dql\nvenues_listed >= 1 select base\n```\n\n```json\n{\n  \"value\": \"BTC\",\n  \"from\": \"reference\",\n  \"as_of\": \"2026-09-23T12:00:05Z\"\n}\n```\n\n### venues_listed\n\nnumber of (selected) listings at T\n\n*Instrument-scoped, layer `reference`, type number, unit count.*\n\n```dql\nvenues_listed >= 1 select venues_listed\n```\n\n```json\n{\n  \"value\": 4,\n  \"from\": \"reference\",\n  \"as_of\": \"2026-09-23T12:00:05Z\"\n}\n```\n\n### venues_answered\n\nnumber of (selected) listings whose mark is present at T\n\n*Instrument-scoped, layer `reference`, type number, unit count.*\n\n```dql\nvenues_listed >= 1 select venues_answered\n```\n\n```json\n{\n  \"value\": 4,\n  \"from\": \"reference\",\n  \"as_of\": \"2026-09-23T12:00:05Z\"\n}\n```\n\n### venue\n\nthe venue's public code\n\n*Venue-scoped, layer `reference`, type code, unit code.*\n\n```dql\nvenues_listed >= 1 select venue\n```\n\n```json\n{\n  \"value\": \"BYBIT-PERP\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"reference\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T00:00:00Z\",\n  \"age_ms\": 43205000,\n  \"status\": \"present\"\n}\n```\n\n### quote\n\nthe listing's quote currency\n\n*Venue-scoped, layer `reference`, type code, unit code.*\n\n```dql\nvenues_listed >= 1 select quote\n```\n\n```json\n{\n  \"value\": \"USDT\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"reference\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T00:00:00Z\",\n  \"age_ms\": 43205000,\n  \"status\": \"present\"\n}\n```\n\n### tick_size\n\nminimum price increment of the listing\n\n*Venue-scoped, layer `reference`, type number, unit quote.*\n\n```dql\nvenues_listed >= 1 select tick_size\n```\n\n```json\n{\n  \"value\": 0.1,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"reference\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T00:00:00Z\",\n  \"age_ms\": 43205000,\n  \"status\": \"present\"\n}\n```\n\n### lot_size\n\nminimum quantity increment\n\n*Venue-scoped, layer `reference`, type number, unit quantity.*\n\n```dql\nvenues_listed >= 1 select lot_size\n```\n\n```json\n{\n  \"value\": 0.001,\n  \"unit\": \"base\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"reference\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T00:00:00Z\",\n  \"age_ms\": 43205000,\n  \"status\": \"present\"\n}\n```\n\n### min_qty\n\nminimum order quantity\n\n*Venue-scoped, layer `reference`, type number, unit quantity.*\n\n```dql\nvenues_listed >= 1 select min_qty\n```\n\n```json\n{\n  \"value\": 0.001,\n  \"unit\": \"base\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"reference\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T00:00:00Z\",\n  \"age_ms\": 43205000,\n  \"status\": \"present\"\n}\n```\n\n### last\n\nlast trade price\n\n*Venue-scoped, layer `ticker`, type number, unit quote, readable as a series.*\n\n```dql\nvenues_listed >= 1 select last\n```\n\n```json\n{\n  \"value\": 86988,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"ticker\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### mark\n\nvenue mark price\n\n*Venue-scoped, layer `mark`, type number, unit quote, readable as a series.*\n\n```dql\nvenues_listed >= 1 select mark\n```\n\n```json\n{\n  \"value\": 86990,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"mark\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### index\n\nvenue index price\n\n*Venue-scoped, layer `mark`, type number, unit quote, readable as a series.*\n\n```dql\nvenues_listed >= 1 select index\n```\n\n```json\n{\n  \"value\": 86950,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"mark\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### basis\n\n(mark − index) / index\n\n*Venue-scoped, layer `mark`, type number, unit fraction, readable as a series.*\n\n```dql\nvenues_listed >= 1 select basis\n```\n\n```json\n{\n  \"value\": 0.000460034503,\n  \"unit\": \"fraction\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"mark\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding\n\npublished rate for the next settlement, per interval\n\n*Venue-scoped, layer `funding`, type number, unit fraction, readable as a series.*\n\n```dql\nvenues_listed >= 1 select funding\n```\n\n```json\n{\n  \"value\": 0.000013,\n  \"unit\": \"fraction\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"funding\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_interval\n\nsettlement interval as published\n\n*Venue-scoped, layer `funding`, type duration, unit ms.*\n\n```dql\nvenues_listed >= 1 select funding_interval\n```\n\n```json\n{\n  \"value\": 3600000,\n  \"unit\": \"ms\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"funding\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_8h\n\nfunding × 8h / funding_interval, the registry's; null without one (no comparison)\n\n*Venue-scoped, layer `funding`, type number, unit fraction, readable as a series.*\n\n```dql\nvenues_listed >= 1 select funding_8h\n```\n\n```json\n{\n  \"value\": 0.000104,\n  \"unit\": \"fraction\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_short\n\nrate the short side pays, positive when the short pays\n\n*Venue-scoped, layer `funding`, type number, unit fraction, readable as a series.*\n\n```dql\nvenues_listed >= 1 select funding_short\n```\n\n```json\n{\n  \"value\": -0.000013,\n  \"unit\": \"fraction\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_short_8h\n\nfunding_short × 8h / funding_interval, the registry's; null without one\n\n*Venue-scoped, layer `funding`, type number, unit fraction, readable as a series.*\n\n```dql\nvenues_listed >= 1 select funding_short_8h\n```\n\n```json\n{\n  \"value\": -0.000104,\n  \"unit\": \"fraction\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_cap\n\nhighest funding rate the venue allows, as published, per the listing's interval; the cap in force at the funding value's time\n\n*Venue-scoped, layer `funding`, type number, unit fraction.*\n\n```dql\nvenues_listed >= 1 select funding_cap\n```\n\n```json\n{\n  \"value\": 0.005,\n  \"unit\": \"fraction\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"funding\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_floor\n\nlowest funding rate the venue allows, as published, per the listing's interval; the floor in force at the funding value's time\n\n*Venue-scoped, layer `funding`, type number, unit fraction.*\n\n```dql\nvenues_listed >= 1 select funding_floor\n```\n\n```json\n{\n  \"value\": -0.005,\n  \"unit\": \"fraction\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"funding\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_cap_8h\n\nfunding_cap × 8h / funding_interval, the registry's; null without one\n\n*Venue-scoped, layer `funding`, type number, unit fraction.*\n\n```dql\nvenues_listed >= 1 select funding_cap_8h\n```\n\n```json\n{\n  \"value\": 0.04,\n  \"unit\": \"fraction\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_floor_8h\n\nfunding_floor × 8h / funding_interval, the registry's; null without one\n\n*Venue-scoped, layer `funding`, type number, unit fraction.*\n\n```dql\nvenues_listed >= 1 select funding_floor_8h\n```\n\n```json\n{\n  \"value\": -0.04,\n  \"unit\": \"fraction\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### funding_at_cap\n\nfunding 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\n\n*Venue-scoped, layer `funding`, type boolean.*\n\n```dql\nvenues_listed >= 1 select funding_at_cap\n```\n\n```json\n{\n  \"value\": false,\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### time_to_funding\n\nnext_funding_at − T\n\n*Venue-scoped, layer `funding`, type duration, unit ms.*\n\n```dql\nvenues_listed >= 1 select time_to_funding\n```\n\n```json\n{\n  \"value\": 3600000,\n  \"unit\": \"ms\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:05:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### oi\n\nopen interest\n\n*Venue-scoped, layer `oi`, type number, unit quantity, readable as a series, additive across venues.*\n\n```dql\nvenues_listed >= 1 select oi\n```\n\n```json\n{\n  \"value\": 60800,\n  \"unit\": \"base\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"oi\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### bid\n\nbest bid price\n\n*Venue-scoped, layer `book`, type number, unit quote, readable as a series.*\n\n```dql\nvenues_listed >= 1 select bid\n```\n\n```json\n{\n  \"value\": 86989.5,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### ask\n\nbest ask price\n\n*Venue-scoped, layer `book`, type number, unit quote, readable as a series.*\n\n```dql\nvenues_listed >= 1 select ask\n```\n\n```json\n{\n  \"value\": 86990.5,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### mid\n\n(bid + ask) / 2\n\n*Venue-scoped, layer `book`, type number, unit quote, readable as a series.*\n\n```dql\nvenues_listed >= 1 select mid\n```\n\n```json\n{\n  \"value\": 86990,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### spread\n\n(ask − bid) / mid\n\n*Venue-scoped, layer `book`, type number, unit fraction, readable as a series.*\n\n```dql\nvenues_listed >= 1 select spread\n```\n\n```json\n{\n  \"value\": 0.000011495574,\n  \"unit\": \"fraction\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### bid_size\n\nresting quantity at the best bid\n\n*Venue-scoped, layer `book`, type number, unit quantity, readable as a series, additive across venues.*\n\n```dql\nvenues_listed >= 1 select bid_size\n```\n\n```json\n{\n  \"value\": 0.79,\n  \"unit\": \"base\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### ask_size\n\nresting quantity at the best ask\n\n*Venue-scoped, layer `book`, type number, unit quantity, readable as a series, additive across venues.*\n\n```dql\nvenues_listed >= 1 select ask_size\n```\n\n```json\n{\n  \"value\": 3.19,\n  \"unit\": \"base\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### volume_24h\n\nrolling 24h traded volume as published\n\n*Venue-scoped, layer `stats`, type number, unit quantity, readable as a series, additive across venues.*\n\n```dql\nvenues_listed >= 1 select volume_24h\n```\n\n```json\n{\n  \"value\": 72800,\n  \"unit\": \"base\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"stats\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:02:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### turnover_24h\n\nrolling 24h traded value as published\n\n*Venue-scoped, layer `stats`, type number, unit quote, readable as a series, additive across venues.*\n\n```dql\nvenues_listed >= 1 select turnover_24h\n```\n\n```json\n{\n  \"value\": 6332000000,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"stats\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:02:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### change_24h\n\n24h price change as published\n\n*Venue-scoped, layer `stats`, type number, unit fraction, readable as a series.*\n\n```dql\nvenues_listed >= 1 select change_24h\n```\n\n```json\n{\n  \"value\": 0.011,\n  \"unit\": \"fraction\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"stats\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:02:04Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n## Candle sources\n\nA source is one column of the candles of one price type. `close` is the trade price; `mark_close` is the\nvenue's mark price; `index_close` is its index. They are different measurements and the language keeps\nthem apart — a funding calculation done on trade prices is a different number from the one the venue\nsettled.\n\nA source is only readable at a timeframe: `timeframe 15m` on the query, or as a trailing argument on the\nfunction that reads it.\n\n| source | price type | column | unit | additive |\n| --- | --- | --- | --- | --- |\n| `open` | trade | open | quote | — |\n| `high` | trade | high | quote | — |\n| `low` | trade | low | quote | — |\n| `close` | trade | close | quote | — |\n| `volume` | trade | volume | quantity | yes |\n| `mark_open` | mark | open | quote | — |\n| `mark_high` | mark | high | quote | — |\n| `mark_low` | mark | low | quote | — |\n| `mark_close` | mark | close | quote | — |\n| `mark_volume` | mark | volume | quantity | yes |\n| `index_open` | index | open | quote | — |\n| `index_high` | index | high | quote | — |\n| `index_low` | index | low | quote | — |\n| `index_close` | index | close | quote | — |\n| `index_volume` | index | volume | quantity | yes |\n\nRead one, at a period:\n\n```dql\nvenues_listed >= 1 select close timeframe 15m\n```\n\n```json\n{\n  \"value\": 86980,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 1,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n\n## Functions\n\nThe `bars` column says how much history the function needs, as a rule over the window it is given. It is\nwhat the platform charges against `bars_per_atom` and `cost`, and `POST /v2/dql/parse` will tell you a\nquery's cost before you run it.\n\n| function | kind | returns | bars | unit |\n| --- | --- | --- | --- | --- |\n| [`prev(S, k)`](#prev) | series | series | bars(S) + n | — |\n| [`sma(S, n)`](#sma) | series | series | bars(S) + n − 1 | — |\n| [`ema(S, n)`](#ema) | series | series | bars(S) + 4n − 1 | — |\n| [`rsi(S, n)`](#rsi) | series | series | bars(S) + 4n | — |\n| [`atr(n)`](#atr) | series | series | 4n + 1 | — |\n| [`stdev(S, n)`](#stdev) | series | series | bars(S) + n − 1 | — |\n| [`highest(S, n)`](#highest) | series | series | bars(S) + n − 1 | — |\n| [`lowest(S, n)`](#lowest) | series | series | bars(S) + n − 1 | — |\n| [`change(S, n)`](#change) | series | series | bars(S) + n | — |\n| [`roc(S, n)`](#roc) | series | series | bars(S) + n | — |\n| [`crossover(A, B)`](#crossover) | series | boolean | max(bars(A), bars(B)) + 1 | — |\n| [`crossunder(A, B)`](#crossunder) | series | boolean | max(bars(A), bars(B)) + 1 | — |\n| [`gaps(n)`](#gaps) | series | number | n | — |\n| [`carried(S, n)`](#carried) | series | number | bars(S) + n − 1 | — |\n| [`abs(x)`](#abs) | scalar | number | bars(x) | — |\n| [`rolling_sum(S, n)`](#rolling-sum) | series | series | bars(S) + n − 1 | — |\n| [`percentile(S, n, p, [method])`](#percentile) | series | series | bars(S) + n − 1 | — |\n| [`percentile_rank(S, n)`](#percentile-rank) | series | series | bars(S) + n − 1 | — |\n| [`corr(S, X, n, [VENUE])`](#corr) | series | series | bars(S) + n | — |\n| [`beta(S, X, n, [VENUE])`](#beta) | series | series | bars(S) + n | — |\n| [`ref(INSTRUMENT, expr, [VENUE])`](#ref) | cross-listing | number | — | — |\n| [`age(F)`](#age) | data quality | duration | — | — |\n| [`status(F)`](#status) | data quality | status | — | — |\n| [`depth_bid(band)`](#depth-bid) | book depth | number | — | quantity |\n| [`depth_ask(band)`](#depth-ask) | book depth | number | — | quantity |\n| [`depth_bid_value(band)`](#depth-bid-value) | book depth | number | — | quote |\n| [`depth_ask_value(band)`](#depth-ask-value) | book depth | number | — | quote |\n| [`venue_depth_bid(band)`](#venue-depth-bid) | venue depth | number | — | quote |\n| [`venue_depth_ask(band)`](#venue-depth-ask) | venue depth | number | — | quote |\n| [`liquidation_count(n)`](#liquidation-count) | event window | number | n | count |\n| [`liquidation_long_count(n)`](#liquidation-long-count) | event window | number | n | count |\n| [`liquidation_short_count(n)`](#liquidation-short-count) | event window | number | n | count |\n| [`liquidation_volume(n)`](#liquidation-volume) | event window | number | n | quantity |\n| [`liquidation_long_volume(n)`](#liquidation-long-volume) | event window | number | n | quantity |\n| [`liquidation_short_volume(n)`](#liquidation-short-volume) | event window | number | n | quantity |\n| [`liquidation_value(n)`](#liquidation-value) | event window | number | n | quote |\n| [`liquidation_long_value(n)`](#liquidation-long-value) | event window | number | n | quote |\n| [`liquidation_short_value(n)`](#liquidation-short-value) | event window | number | n | quote |\n\n### prev\n\nS[k]\n\n`prev(S, k)` — series, returns series, reads bars(S) + n bars.\n\n```dql\nvenues_listed >= 1 select prev(close, 1) timeframe 15m\n```\n\n```json\n{\n  \"value\": 85476.66666666667,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 2,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### sma\n\nsimple moving average\n\n`sma(S, n)` — series, returns series, reads bars(S) + n − 1 bars.\n\n```dql\nvenues_listed >= 1 select sma(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 85517.16666666666,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### ema\n\nexponential moving average over a fixed 4n window\n\n`ema(S, n)` — series, returns series, reads bars(S) + 4n − 1 bars.\n\n```dql\nvenues_listed >= 1 select ema(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 85564.184136414,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 80,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### rsi\n\nrelative strength index, Wilder smoothing over 4n\n\n`rsi(S, n)` — series, returns series, reads bars(S) + 4n bars.\n\n```dql\nvenues_listed >= 1 select rsi(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 85.16667851522334,\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 81,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### atr\n\naverage true range of the trade candles\n\n`atr(n)` — series, returns series, reads 4n + 1 bars.\n\n```dql\nvenues_listed >= 1 select atr(14) timeframe 15m\n```\n\n```json\n{\n  \"value\": 231.59289811088146,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 57,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### stdev\n\npopulation standard deviation\n\n`stdev(S, n)` — series, returns series, reads bars(S) + n − 1 bars.\n\n```dql\nvenues_listed >= 1 select stdev(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 342.66970653645143,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### highest\n\nmax(S[0] … S[n−1])\n\n`highest(S, n)` — series, returns series, reads bars(S) + n − 1 bars.\n\n```dql\nvenues_listed >= 1 select highest(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 87000,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### lowest\n\nmin(S[0] … S[n−1])\n\n`lowest(S, n)` — series, returns series, reads bars(S) + n − 1 bars.\n\n```dql\nvenues_listed >= 1 select lowest(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 85373.33333333333,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### change\n\nS[0] − S[n]\n\n`change(S, n)` — series, returns series, reads bars(S) + n bars.\n\n```dql\nvenues_listed >= 1 select change(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 1606.6666666666715,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 21,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### roc\n\n(S[0] − S[n]) / S[n]\n\n`roc(S, n)` — series, returns series, reads bars(S) + n bars.\n\n```dql\nvenues_listed >= 1 select roc(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 0.01881489577640727,\n  \"unit\": \"fraction\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 21,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### crossover\n\nA[0] > B[0] and A[1] ≤ B[1]\n\n`crossover(A, B)` — series, returns boolean, reads max(bars(A), bars(B)) + 1 bars.\n\n```dql\nvenues_listed >= 1 select crossover(ema(close, 5), ema(close, 20)) timeframe 15m\n```\n\n```json\n{\n  \"value\": false,\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 81,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### crossunder\n\nA[0] < B[0] and A[1] ≥ B[1]\n\n`crossunder(A, B)` — series, returns boolean, reads max(bars(A), bars(B)) + 1 bars.\n\n```dql\nvenues_listed >= 1 select crossunder(ema(close, 5), ema(close, 20)) timeframe 15m\n```\n\n```json\n{\n  \"value\": false,\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 81,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### gaps\n\nmissing periods among the last n\n\n`gaps(n)` — series, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select gaps(20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 1,\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### carried\n\nperiods among the last n whose value was carried, not observed\n\n`carried(S, n)` — series, returns number, reads bars(S) + n − 1 bars.\n\n```dql\nvenues_listed >= 1 select carried(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 0,\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### abs\n\n|x|, element-wise for series\n\n`abs(x)` — scalar, returns number, reads bars(x) bars.\n\n```dql\nvenues_listed >= 1 select abs(change_24h)\n```\n\n```json\n{\n  \"value\": 0.011,\n  \"unit\": \"fraction\",\n  \"derived\": true\n}\n```\n\n### rolling_sum\n\nS[n−1] + … + S[0]\n\n`rolling_sum(S, n)` — series, returns series, reads bars(S) + n − 1 bars.\n\n```dql\nvenues_listed >= 1 select rolling_sum(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 1710343.3333333333,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### percentile\n\nnearest-rank (default) or linear percentile of S[0] … S[n−1]\n\n`percentile(S, n, p, [method])` — series, returns series, reads bars(S) + n − 1 bars.\n\n```dql\nvenues_listed >= 1 select percentile(close, 20, 0.9) timeframe 15m\n```\n\n```json\n{\n  \"value\": 85496.66666666667,\n  \"unit\": \"quote\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### percentile_rank\n\nshare of S[0] … S[n−1] that are ≤ S[0]\n\n`percentile_rank(S, n)` — series, returns series, reads bars(S) + n − 1 bars.\n\n```dql\nvenues_listed >= 1 select percentile_rank(close, 20) timeframe 15m\n```\n\n```json\n{\n  \"value\": 1,\n  \"unit\": \"fraction\",\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 20,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### corr\n\nPearson correlation of the n simple returns of S and of S of instrument X, on the same venue (or VENUE)\n\n`corr(S, X, n, [VENUE])` — series, returns series, reads bars(S) + n bars.\n\n```dql\nvenues_listed >= 1 select corr(close, BTC-PERP, 10) timeframe 15m\n```\n\n```json\n{\n  \"value\": 1,\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 11,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### beta\n\ncov(returns of S, returns of X) / var(returns of X) over n simple returns, X on the same venue (or VENUE)\n\n`beta(S, X, n, [VENUE])` — series, returns series, reads bars(S) + n bars.\n\n```dql\nvenues_listed >= 1 select beta(close, BTC-PERP, 10) timeframe 15m\n```\n\n```json\n{\n  \"value\": 1,\n  \"venue\": \"HYPERLIQUID\",\n  \"layer\": \"candles\",\n  \"timeframe\": \"15m\",\n  \"bars\": 11,\n  \"candle_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:00.300Z\",\n  \"age_ms\": 4700,\n  \"status\": \"present\"\n}\n```\n\n### ref\n\nthe 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\n\n`ref(INSTRUMENT, expr, [VENUE])` — cross-listing, returns number.\n\n```dql\nvenues_listed >= 1 select ref(BTC-PERP, mark)\n```\n\n```json\n{\n  \"value\": 86990,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"instrument\": \"BTC-PERP\",\n  \"layer\": \"mark\",\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### age\n\nT − received_at of the value used for F\n\n`age(F)` — data quality, returns duration.\n\n```dql\nvenues_listed >= 1 select age(funding)\n```\n\n```json\n{\n  \"value\": 485000,\n  \"unit\": \"ms\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T11:52:00Z\",\n  \"age_ms\": 485000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T11:57:00Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"stale\"\n}\n```\n\n### status\n\nstate of F's layer at T\n\n`status(F)` — data quality, returns status.\n\n```dql\nvenues_listed >= 1 select status(funding)\n```\n\n```json\n{\n  \"value\": \"stale\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"funding\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T11:52:00Z\",\n  \"age_ms\": 485000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T11:57:00Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"stale\"\n}\n```\n\n### depth_bid\n\nbid quantity within band of mid\n\n`depth_bid(band)` — book depth, returns number.\n\n```dql\nvenues_listed >= 1 select depth_bid(10bps)\n```\n\n```json\n{\n  \"value\": 0.79,\n  \"unit\": \"base\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"band\": \"10bps\",\n  \"reference\": \"mid\",\n  \"levels\": 4,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### depth_ask\n\nask quantity within band of mid\n\n`depth_ask(band)` — book depth, returns number.\n\n```dql\nvenues_listed >= 1 select depth_ask(10bps)\n```\n\n```json\n{\n  \"value\": 3.19,\n  \"unit\": \"base\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"band\": \"10bps\",\n  \"reference\": \"mid\",\n  \"levels\": 4,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### depth_bid_value\n\nbid value (price × size) within band of mid\n\n`depth_bid_value(band)` — book depth, returns number.\n\n```dql\nvenues_listed >= 1 select depth_bid_value(10bps)\n```\n\n```json\n{\n  \"value\": 68721.705,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"band\": \"10bps\",\n  \"reference\": \"mid\",\n  \"levels\": 4,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### depth_ask_value\n\nask value (price × size) within band of mid\n\n`depth_ask_value(band)` — book depth, returns number.\n\n```dql\nvenues_listed >= 1 select depth_ask_value(10bps)\n```\n\n```json\n{\n  \"value\": 277499.695,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"book\",\n  \"band\": \"10bps\",\n  \"reference\": \"mid\",\n  \"levels\": 4,\n  \"venue_ts\": null,\n  \"received_at\": \"2026-09-23T12:00:04Z\",\n  \"age_ms\": 1000,\n  \"venue_age_ms\": null,\n  \"valid_until\": \"2026-09-23T12:00:34Z\",\n  \"horizon_source\": \"assumed\",\n  \"anchor\": \"receipt\",\n  \"status\": \"present\"\n}\n```\n\n### venue_depth_bid\n\nbid-side depth the venue publishes within band of price\n\n`venue_depth_bid(band)` — venue depth, returns number.\n\n```dql\nvenues_listed >= 1 select venue_depth_bid(10bps)\n```\n\n```json\n{\n  \"value\": null,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"venue_depth\",\n  \"band\": \"10bps\",\n  \"reference\": null,\n  \"levels\": null,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"not_published\",\n  \"reason\": \"venue_capability\"\n}\n```\n\n### venue_depth_ask\n\nask-side depth the venue publishes within band of price\n\n`venue_depth_ask(band)` — venue depth, returns number.\n\n```dql\nvenues_listed >= 1 select venue_depth_ask(10bps)\n```\n\n```json\n{\n  \"value\": null,\n  \"unit\": \"quote\",\n  \"venue\": \"BYBIT-PERP\",\n  \"layer\": \"venue_depth\",\n  \"band\": \"10bps\",\n  \"reference\": null,\n  \"levels\": null,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"not_published\",\n  \"reason\": \"venue_capability\"\n}\n```\n\n### liquidation_count\n\nnumber of liquidations in the last n periods\n\n`liquidation_count(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_count(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 4,\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n### liquidation_long_count\n\nnumber of long positions liquidated in the last n periods\n\n`liquidation_long_count(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_long_count(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 3,\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n### liquidation_short_count\n\nnumber of short positions liquidated in the last n periods\n\n`liquidation_short_count(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_short_count(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 1,\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n### liquidation_volume\n\nquantity of liquidations in the last n periods\n\n`liquidation_volume(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_volume(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 2.1,\n  \"unit\": \"base\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n### liquidation_long_volume\n\nquantity of long positions liquidated in the last n periods\n\n`liquidation_long_volume(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_long_volume(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 1.8,\n  \"unit\": \"base\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n### liquidation_short_volume\n\nquantity of short positions liquidated in the last n periods\n\n`liquidation_short_volume(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_short_volume(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 0.3,\n  \"unit\": \"base\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n### liquidation_value\n\nvalue (price × quantity) of liquidations in the last n periods\n\n`liquidation_value(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_value(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 181364.5,\n  \"unit\": \"quote\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n### liquidation_long_value\n\nvalue (price × quantity) of long positions liquidated in the last n periods\n\n`liquidation_long_value(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_long_value(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 155249.5,\n  \"unit\": \"quote\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n### liquidation_short_value\n\nvalue (price × quantity) of short positions liquidated in the last n periods\n\n`liquidation_short_value(n)` — event window, returns number, reads n bars.\n\n```dql\nvenues_listed >= 1 select liquidation_short_value(4) timeframe 15m\n```\n\n```json\n{\n  \"value\": 26115,\n  \"unit\": \"quote\",\n  \"venue\": \"KRAKEN-FUTURES\",\n  \"layer\": \"liquidation\",\n  \"timeframe\": \"15m\",\n  \"bars\": 4,\n  \"window_start\": \"2026-09-23T11:00:00Z\",\n  \"window_end\": \"2026-09-23T12:00:00Z\",\n  \"derived\": true,\n  \"venue_ts\": null,\n  \"received_at\": null,\n  \"age_ms\": null,\n  \"status\": \"present\"\n}\n```\n\n\n## What is not here\n\nNames the specification mentions that are not functions of the language: `rma` and `sqrt` are notation\ninside the formulas of §7.3, not things a query may call. `depth_bid` and `depth_ask` were fields in an\nearly draft and are functions of a price band now — `depth_bid_qty(10bps)`, not `depth_bid`.\n\n\n# Cookbook\n\nQueries that answer a question somebody actually has, with the answer the engine gives.\n\nEvery recipe is taken from [the guide](#the-guide), where it is explained in full; this page is the\nindex you scan when you know what you want and not how to write it. The answers are rendered on the\ndocumentation fixture — real venue codes and symbols, invented numbers.\n\n## Positive funding on any venue\n\nIntent: instruments with a positive funding rate on at least one venue.\n\n```dql\nany(venues where funding > 0)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where funding > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjdlZjMxMGZmYTMyOTI2ZDEifQ\"\n  }\n}\n```\n\n## Fresh positive funding on at least three venues\n\nIntent: the funding rate, normalised to eight hours, is above one basis point on three or more venues, and each of those readings is current. Ask for that with `status(funding) = present`, not with an age: a settled rate (dYdX, Coinbase INTX) is as old as its settlement — forty minutes into an hourly period it is forty minutes old, and current until the next one is due — so `age(funding) < 2m` would leave those venues out for most of every hour.\n\n```dql\ncount(venues where funding_8h > 1bps and status(funding) = present) >= 3\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Cross-venue mark dispersion\n\nIntent: the highest and lowest mark price across venues differ by more than five basis points of the lowest, and at least three venues are answering.\n\n```dql\n(max(venues, mark) - min(venues, mark)) / min(venues, mark) > 5bps and venues_answered >= 3\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"ETH-PERP\",\n      \"result\": \"true\",\n      \"values\": {\n        \"max(venues, mark)\": {\n          \"value\": 2751,\n          \"unit\": \"quote\",\n          \"from\": [\n            {\n              \"venue\": \"BYBIT-PERP\",\n              \"value\": 2751,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        },\n        \"min(venues, mark)\": {\n          \"value\": 2749,\n          \"unit\": \"quote\",\n          \"from\": [\n            {\n              \"venue\": \"OKX-PERP\",\n              \"value\": 2749,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        },\n        \"venues_answered\": {\n          \"value\": 3,\n          \"from\": \"reference\",\n          \"as_of\": \"2026-09-23T12:00:05Z\"\n        }\n      },\n      \"scopes\": {\n        \"max(venues, mark)\": {\n          \"venues_listed\": 3,\n          \"venues_in_scope\": 3,\n          \"excluded\": []\n        },\n        \"min(venues, mark)\": {\n          \"venues_listed\": 3,\n          \"venues_in_scope\": 3,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"ETHUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 2751,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_ETHUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 2750,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"ETH-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 2749,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Two named venues\n\nIntent: the mark price on KRAKEN-FUTURES and BYBIT-PERP differs by more than 10 (quote units).\n\n```dql\nmax(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark) - min(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark) > 10\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"SOL-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {\n        \"max(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark)\": {\n          \"value\": null,\n          \"unit\": \"quote\",\n          \"from\": [],\n          \"reason\": \"no_value\"\n        },\n        \"min(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark)\": {\n          \"value\": null,\n          \"unit\": \"quote\",\n          \"from\": [],\n          \"reason\": \"no_value\"\n        }\n      },\n      \"scopes\": {\n        \"max(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark)\": {\n          \"venues_listed\": 1,\n          \"venues_in_scope\": 1,\n          \"excluded\": []\n        },\n        \"min(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark)\": {\n          \"venues_listed\": 1,\n          \"venues_in_scope\": 1,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"SOL\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"venue\": {\n              \"value\": \"HYPERLIQUID\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"mark\": {\n              \"value\": 118,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Tight books wherever there is a book\n\nIntent: every venue that publishes an order book has a spread below five basis points. Venues that publish no book (oracle-priced venues) must not make the condition fail.\n\n```dql\nall(venues where status(bid) = not_published or spread < 5bps)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"all(venues where status(bid) = not_published or spread < 0.0005)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"status(bid)\": {\n              \"value\": \"present\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000011495574,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"status(bid)\": {\n              \"value\": \"present\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000022985864,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"status(bid)\": {\n              \"value\": \"present\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000022988506,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"status(bid)\": {\n              \"value\": \"present\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000002298983,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImI5ZTY0YzFjZWJmOTkzZmQifQ\"\n  }\n}\n```\n\n## Trend on hourly candles, any venue\n\nIntent: on at least one venue, the 20-candle EMA of hourly closes is above the 50-candle EMA.\n\n```dql\nany(venues where ema(close, 20) > ema(close, 50)) timeframe 1h\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"1h\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where ema(close, 20) > ema(close, 50))\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImRkOWI3MzhhMWQzNzY1OTQifQ\"\n  }\n}\n```\n\n## A cross on the latest closed 15-minute candle, one venue, clean history\n\nIntent: on KRAKEN-FUTURES, the 20-EMA crossed above the 50-EMA on the most recent completed 15-minute candle, and the last 200 candles have no gaps.\n\n```dql\nany(venues where venue = KRAKEN-FUTURES and crossover(ema(close, 20), ema(close, 50)) and gaps(200) = 0) timeframe 15m\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"15m\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"ETH-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where venue = KRAKEN-FUTURES and crossover(ema(close, 20), ema(close, 50)) and gaps(200) = 0)\": {\n          \"venues_listed\": 3,\n          \"venues_in_scope\": 3,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"ETHUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"venue\": {\n              \"value\": \"BYBIT-PERP\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"crossover(ema(close, 20), ema(close, 50))\": {\n              \"value\": null,\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 201,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"gaps(200)\": {\n              \"value\": null,\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_ETHUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"venue\": {\n              \"value\": \"KRAKEN-FUTURES\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"crossover(ema(close, 20), ema(close, 50))\": {\n              \"value\": null,\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 201,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"gaps(200)\": {\n              \"value\": null,\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"ETH-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"venue\": {\n              \"value\": \"OKX-PERP\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"crossover(ema(close, 20), ema(close, 50))\": {\n              \"value\": null,\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 201,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"gaps(200)\": {\n              \"value\": null,\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Two timeframes in one condition\n\nIntent: hourly trend up (EMA 20 above EMA 50 on 1h candles) while the 15-minute RSI is low.\n\n```dql\nany(venues where ema(close, 20, 1h) > ema(close, 50, 1h) and rsi(close, 14, 15m) < 35)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where ema(close, 20, 1h) > ema(close, 50, 1h) and rsi(close, 14, 15m) < 35)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"rsi(close, 14, 15m)\": {\n              \"value\": null,\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 57,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\",\n              \"reason\": \"gap\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"ema(close, 20, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"rsi(close, 14, 15m)\": {\n              \"value\": 88.19612724877551,\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 57,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"ema(close, 20, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"rsi(close, 14, 15m)\": {\n              \"value\": 88.19612724877551,\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 57,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"rsi(close, 14, 15m)\": {\n              \"value\": null,\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 57,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjMxOTVhZGUxMDU2YTFhOWMifQ\"\n  }\n}\n```\n\n## Which instruments have a venue that has gone quiet\n\nIntent: instruments where at least one listed venue is not answering (no fresh mark price).\n\n```dql\nvenues_answered < venues_listed\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Stale, missing and not published are three different things\n\nIntent: instruments where at least one venue's funding rate is **stale** — we have a value, but it is older than the freshness bound.\n\n```dql\ncount(venues where status(funding) = stale) >= 1\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"count(venues where status(funding) = stale)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"stale\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\n## As of a past moment\n\nIntent: which instruments had positive funding on three or more venues at 08:00 UTC today, using only what DEBYKO had received by then.\n\n```dql\ncount(venues where funding > 0) >= 3 as of 2026-09-21T08:00:00Z\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": \"2026-09-21T08:00:00Z\",\n  \"settled\": true,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Relaxed freshness for a historical question\n\nIntent: a week ago at noon, did any venue show open interest at all — accepting values up to ten minutes old.\n\n```dql\nany(venues where oi > 0) freshness 10m as of 2026-09-14T12:00:00Z\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": \"2026-09-14T12:00:00Z\",\n  \"settled\": true,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": \"10m\",\n    \"mark\": \"10m\",\n    \"oi\": \"10m\",\n    \"book\": \"10m\",\n    \"stats\": \"10m\",\n    \"funding\": \"10m\"\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where oi > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0xNFQxMjowMDowMFoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6Ijg5MDVkMmI1ZmRjNWVhNzEifQ\"\n  }\n}\n```\n\n## Like-for-like quotes only\n\nIntent: dispersion of mark prices above ten basis points, comparing only listings quoted in a USD stablecoin or USD.\n\n```dql\nmax(venues where quote in (USDT, USDC, USD), mark) / min(venues where quote in (USDT, USDC, USD), mark) - 1 > 10bps\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Ordering the screen\n\nIntent: instruments answering on at least two venues, highest eight-hour funding first.\n\n```dql\nvenues_answered >= 2 order by max(venues, funding_8h) desc\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {\n        \"venues_answered\": {\n          \"value\": 4,\n          \"from\": \"reference\",\n          \"as_of\": \"2026-09-23T12:00:05Z\"\n        },\n        \"max(venues, funding_8h)\": {\n          \"value\": 0.000104,\n          \"unit\": \"fraction\",\n          \"from\": [\n            {\n              \"venue\": \"HYPERLIQUID\",\n              \"value\": 0.000104,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        }\n      },\n      \"scopes\": {\n        \"max(venues, funding_8h)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.000104,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.00008,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjE0MTk1NWNjMGNhMzliODEifQ\"\n  }\n}\n```\n\n## Alerts, with Agent\n\nIntent: be told when, for any instrument, the 20/50 EMA cross happens on hourly candles on a venue with a clean 200-candle history. The condition is a query like any other:\n\n```dql\nany(venues where crossover(ema(close, 20), ema(close, 50)) and gaps(200) = 0) timeframe 1h\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"1h\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where crossover(ema(close, 20), ema(close, 50)) and gaps(200) = 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"crossover(ema(close, 20), ema(close, 50))\": {\n              \"value\": null,\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 201,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"gaps(200)\": {\n              \"value\": null,\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"crossover(ema(close, 20), ema(close, 50))\": {\n              \"value\": null,\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 201,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"gaps(200)\": {\n              \"value\": null,\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"crossover(ema(close, 20), ema(close, 50))\": {\n              \"value\": null,\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 201,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"gaps(200)\": {\n              \"value\": null,\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"crossover(ema(close, 20), ema(close, 50))\": {\n              \"value\": null,\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 201,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"gaps(200)\": {\n              \"value\": null,\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImViMGQ5ZmE4NmMxMzc3ZWIifQ\"\n  }\n}\n```\n\n## A rate of change on a snapshot field\n\nIntent: the mark price is more than half a per cent above where it stood five minutes ago, on any venue. `mark` is a snapshot field, not a candle, and DQL samples it at the effective timeframe.\n\n```dql\nany(venues where roc(mark, 5) > 0.5%) timeframe 1m\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"1m\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where roc(mark, 5) > 0.005)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"roc(mark, 5)\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"mark\",\n              \"timeframe\": \"1m\",\n              \"bars\": 6,\n              \"sample_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"roc(mark, 5)\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"mark\",\n              \"timeframe\": \"1m\",\n              \"bars\": 6,\n              \"sample_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"roc(mark, 5)\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"mark\",\n              \"timeframe\": \"1m\",\n              \"bars\": 6,\n              \"sample_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"roc(mark, 5)\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"mark\",\n              \"timeframe\": \"1m\",\n              \"bars\": 6,\n              \"sample_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjRhZDZhYmRjMjY0ZGMzYTEifQ\"\n  }\n}\n```\n\n## A spread that is unusually wide for this venue\n\nIntent: the current spread sits above the 90th percentile of its own last hour — \"wide for this venue\", not \"wide compared with a number I guessed\".\n\n```dql\nany(venues where spread > percentile(spread, 60, 90%)) timeframe 1m\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"1m\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where spread > percentile(spread, 60, 0.9))\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"spread\": {\n              \"value\": 0.000011495574,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"percentile(spread, 60, 0.9)\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"timeframe\": \"1m\",\n              \"bars\": 60,\n              \"sample_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"spread\": {\n              \"value\": 0.000022985864,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"percentile(spread, 60, 0.9)\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"book\",\n              \"timeframe\": \"1m\",\n              \"bars\": 60,\n              \"sample_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"spread\": {\n              \"value\": 0.000022988506,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"percentile(spread, 60, 0.9)\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"timeframe\": \"1m\",\n              \"bars\": 60,\n              \"sample_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"spread\": {\n              \"value\": 0.000002298983,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"percentile(spread, 60, 0.9)\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"timeframe\": \"1m\",\n              \"bars\": 60,\n              \"sample_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjA0NWQ1MGE0MmE4NzI1NjkifQ\"\n  }\n}\n```\n\n## Real money resting near the mid\n\nIntent: at least one venue has more than two million quote units resting within ten basis points of the mid on the bid side.\n\n```dql\nany(venues where depth_bid_value(10bps) > 2000000)\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"ETH-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where depth_bid_value(0.001) > 2000000)\": {\n          \"venues_listed\": 3,\n          \"venues_in_scope\": 3,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"ETHUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"depth_bid_value(0.001)\": {\n              \"value\": 330108.0,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"band\": \"10bps\",\n              \"reference\": \"mid\",\n              \"levels\": 4,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_ETHUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"depth_bid_value(0.001)\": {\n              \"value\": 109996.0,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"band\": \"10bps\",\n              \"reference\": \"mid\",\n              \"levels\": 4,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"ETH-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"depth_bid_value(0.001)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"band\": \"10bps\",\n              \"reference\": \"mid\",\n              \"levels\": null,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Choosing the columns, and ordering by two keys\n\nIntent: the instruments where at least two venues answer, the widest funding first and, where that ties, the tighter spread first — and bring back only the three numbers I want.\n\n```dql\nvenues_answered >= 2 select max(venues, funding_8h), min(venues, spread), venues_answered order by max(venues, funding_8h) desc, min(venues, spread) asc\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {\n        \"venues_answered\": {\n          \"value\": 4,\n          \"from\": \"reference\",\n          \"as_of\": \"2026-09-23T12:00:05Z\"\n        },\n        \"max(venues, funding_8h)\": {\n          \"value\": 0.000104,\n          \"unit\": \"fraction\",\n          \"from\": [\n            {\n              \"venue\": \"HYPERLIQUID\",\n              \"value\": 0.000104,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        },\n        \"min(venues, spread)\": {\n          \"value\": 2.298983e-06,\n          \"unit\": \"fraction\",\n          \"from\": [\n            {\n              \"venue\": \"OKX-PERP\",\n              \"value\": 0.000002298983,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        }\n      },\n      \"scopes\": {\n        \"max(venues, funding_8h)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        },\n        \"min(venues, spread)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            },\n            \"spread\": {\n              \"value\": 0.000011495574,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.000104,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000022985864,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.00008,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000022988506,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000002298983,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjJhYWQwMDMyMGM4MjFiOTgifQ\"\n  }\n}\n```\n\n## The venue's mark candle, not its trade candle\n\nIntent: compare the last closed hourly **mark** candle with the live mark price.\n\n```dql\nany(venues where mark > mark_close) timeframe 1h\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"1h\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where mark > mark_close)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 3,\n          \"excluded\": [\n            {\n              \"venue\": \"HYPERLIQUID\",\n              \"symbol\": \"BTC\",\n              \"reason\": \"not_published\",\n              \"layer\": \"candles\"\n            }\n          ]\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 86990,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"mark_close\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"price_type\": \"mark\",\n              \"timeframe\": \"1h\",\n              \"bars\": 1,\n              \"candle_end\": null,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 87010,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"mark_close\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"price_type\": \"mark\",\n              \"timeframe\": \"1h\",\n              \"bars\": 1,\n              \"candle_end\": null,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"not_published\",\n              \"reason\": \"venue_capability\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 87000,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"mark_close\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"price_type\": \"mark\",\n              \"timeframe\": \"1h\",\n              \"bars\": 1,\n              \"candle_end\": null,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 86995,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"mark_close\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"price_type\": \"mark\",\n              \"timeframe\": \"1h\",\n              \"bars\": 1,\n              \"candle_end\": null,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjIwNWFiZDlmN2QwZTQ2YzQifQ\"\n  }\n}\n```\n\n## Asking for older data on purpose\n\nIntent: a question about yesterday, where a reading a few minutes old is perfectly good.\n\n```dql\nany(venues where oi > 1000) freshness 30m as of 2026-09-20T12:00:00Z\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": \"2026-09-20T12:00:00Z\",\n  \"settled\": true,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": \"30m\",\n    \"mark\": \"30m\",\n    \"oi\": \"30m\",\n    \"book\": \"30m\",\n    \"stats\": \"30m\",\n    \"funding\": \"30m\"\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where oi > 1000)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yMFQxMjowMDowMFoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjY0MGUzZjQ5NjgwNDc3MTYifQ\"\n  }\n}\n```\n\n## One venue's own symbol\n\nIntent: the listing a venue calls `BTCUSDT`, whatever DEBYKO calls the instrument.\n\n```dql\nany(venues where mark > 0) where symbol = \"BTCUSDT\"\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where mark > 0)\": {\n          \"venues_listed\": 1,\n          \"venues_in_scope\": 1,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 86990,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\n## Who is being forced out\n\nIntent: at least one venue has had more than a hundred thousand quote units of long positions liquidated in the last hour, and more than twice the value of the short positions liquidated there.\n\n```dql\nany(venues where liquidation_long_value(4) > 100000 and liquidation_long_value(4) > 2 * liquidation_short_value(4)) timeframe 15m\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"15m\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where liquidation_long_value(4) > 100000 and liquidation_long_value(4) > 2 * liquidation_short_value(4))\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 2,\n          \"excluded\": [\n            {\n              \"venue\": \"BYBIT-PERP\",\n              \"symbol\": \"BTCUSDT\",\n              \"reason\": \"off\",\n              \"layer\": \"liquidation\"\n            },\n            {\n              \"venue\": \"HYPERLIQUID\",\n              \"symbol\": \"BTC\",\n              \"reason\": \"not_published\",\n              \"layer\": \"liquidation\"\n            }\n          ]\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"liquidation_long_value(4)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"liquidation\",\n              \"timeframe\": \"15m\",\n              \"bars\": 4,\n              \"window_start\": \"2026-09-23T11:00:00Z\",\n              \"window_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"off\",\n              \"reason\": \"policy_off\"\n            },\n            \"liquidation_short_value(4)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"liquidation\",\n              \"timeframe\": \"15m\",\n              \"bars\": 4,\n              \"window_start\": \"2026-09-23T11:00:00Z\",\n              \"window_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"off\",\n              \"reason\": \"policy_off\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"liquidation_long_value(4)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"liquidation\",\n              \"timeframe\": \"15m\",\n              \"bars\": 4,\n              \"window_start\": \"2026-09-23T11:00:00Z\",\n              \"window_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"not_published\",\n              \"reason\": \"venue_capability\"\n            },\n            \"liquidation_short_value(4)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"liquidation\",\n              \"timeframe\": \"15m\",\n              \"bars\": 4,\n              \"window_start\": \"2026-09-23T11:00:00Z\",\n              \"window_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"not_published\",\n              \"reason\": \"venue_capability\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"liquidation_long_value(4)\": {\n              \"value\": 155249.5,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"liquidation\",\n              \"timeframe\": \"15m\",\n              \"bars\": 4,\n              \"window_start\": \"2026-09-23T11:00:00Z\",\n              \"window_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"present\"\n            },\n            \"liquidation_short_value(4)\": {\n              \"value\": 26115,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"liquidation\",\n              \"timeframe\": \"15m\",\n              \"bars\": 4,\n              \"window_start\": \"2026-09-23T11:00:00Z\",\n              \"window_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"liquidation_long_value(4)\": {\n              \"value\": 1035600,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"liquidation\",\n              \"timeframe\": \"15m\",\n              \"bars\": 4,\n              \"window_start\": \"2026-09-23T11:00:00Z\",\n              \"window_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"present\"\n            },\n            \"liquidation_short_value(4)\": {\n              \"value\": 609140,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"liquidation\",\n              \"timeframe\": \"15m\",\n              \"bars\": 4,\n              \"window_start\": \"2026-09-23T11:00:00Z\",\n              \"window_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjM5ZjY1Y2QyM2NhYzRjZWYifQ\"\n  }\n}\n```\n\n## A BTC regime filter\n\nIntent: on Kraken, in USD, an instrument whose 9-period average is above its 21-period average, but only while BTC itself is above its own 50-period average — the signal on one pair, the filter on another.\n\n```dql\nany(venues where venue = KRAKEN-FUTURES and ema(mark_close, 9, 15m) > ema(mark_close, 21, 15m) and ref(BTC-PERP, mark_close) > ref(BTC-PERP, ema(mark_close, 50, 15m))) timeframe 15m where venue = KRAKEN-FUTURES and quote = USD\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"15m\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where venue = KRAKEN-FUTURES and ema(mark_close, 9, 15m) > ema(mark_close, 21, 15m) and ref(BTC-PERP, mark_close) > ref(BTC-PERP, ema(mark_close, 50, 15m)))\": {\n          \"venues_listed\": 1,\n          \"venues_in_scope\": 1,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"venue\": {\n              \"value\": \"KRAKEN-FUTURES\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"ema(mark_close, 9, 15m)\": {\n              \"value\": 85767.62831152731,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"price_type\": \"mark\",\n              \"timeframe\": \"15m\",\n              \"bars\": 36,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\"\n            },\n            \"ema(mark_close, 21, 15m)\": {\n              \"value\": 85547.56873889006,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"price_type\": \"mark\",\n              \"timeframe\": \"15m\",\n              \"bars\": 84,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\"\n            },\n            \"ref(BTC-PERP, mark_close)\": {\n              \"value\": 86995,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"instrument\": \"BTC-PERP\",\n              \"layer\": \"candles\",\n              \"price_type\": \"mark\",\n              \"timeframe\": \"15m\",\n              \"bars\": 1,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\"\n            },\n            \"ref(BTC-PERP, ema(mark_close, 50, 15m))\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"instrument\": \"BTC-PERP\",\n              \"layer\": \"candles\",\n              \"price_type\": \"mark\",\n              \"timeframe\": \"15m\",\n              \"bars\": 200,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\",\n              \"reason\": \"insufficient_history\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImJkOGNhMzI1Yjg3MjFmZGMifQ\"\n  }\n}\n```\n\n## Highest and lowest funding across venues over a window\n\nWhich venue had the highest (or lowest) BTC funding over the last 6 hours. One call to `POST /v2/snapshots/history` (the MCP tool `history`) with `summary: true` answers it with one short object per listing instead of the series: the `max` of `funding_8h` of each listing is the highest rate observed in the window, and its time. `funding_8h` restates every venue's rate on the 8 h basis, so the venues compare. The rate is the one observed at the interval's samples (`5m` here), the live rate the venue published, not the funding that settled: for what a venue settled, read `GET /v2/funding/settlements`. Take the largest `max` over the listings; the smallest `min` is the lowest. A listing with no reading in the window has `n: 0` and a state (`gap`, `off`, `not_published`, `missing`), never a zero.\n\n```json\n{\n  \"where\": \"base = BTC\",\n  \"layers\": [\"funding\"],\n  \"interval\": \"5m\",\n  \"from\": \"2026-10-27T02:00:00Z\",\n  \"to\": \"2026-10-27T08:00:00Z\",\n  \"summary\": true,\n  \"fields\": [\"funding_8h\"]\n}\n```\n\n```json\n{\n  \"mode\": \"summary\",\n  \"interval\": \"5m\",\n  \"from\": \"2026-10-27T02:00:00Z\",\n  \"to\": \"2026-10-27T08:00:00Z\",\n  \"items\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"venue\": \"HYPERLIQUID\",\n      \"venue_symbol\": \"BTC\",\n      \"quote\": \"USDC\",\n      \"layers\": {\n        \"funding\": {\n          \"status\": \"present\",\n          \"n\": 72,\n          \"fields\": {\n            \"funding_8h\": {\n              \"min\": [0.000081, \"2026-10-27T04:35:00Z\"],\n              \"max\": [0.000125, \"2026-10-27T07:50:00Z\"],\n              \"first\": [0.0001, \"2026-10-27T02:00:00Z\"],\n              \"last\": [0.000121, \"2026-10-27T08:00:00Z\"]\n            }\n          },\n          \"units\": { \"funding_8h\": \"fraction\" }\n        }\n      }\n    }\n  ]\n}\n```\n\n\n# The guide\n\nThis guide teaches the DEBYKO Query Language (DQL) by example. The generated API reference\n(`/v2` in Scalar) lists every endpoint field; the normative language definition is the\nspecification. This document is the tutorial and the cookbook.\n\n> **Every response in this guide was produced by the engine.** They are rendered from a small fixture\n> (`DocumentationFixture`) whose venue codes and symbols are the ones the platform really collects and\n> whose prices are invented, and they are regenerated on every build — so the shape here is the shape\n> you will get, field for field. What is made up is the numbers, never the form, and no page claims a\n> price. The whole answers, including the canonical query each one echoes back, are in `examples.json`\n> beside this file.\n\n---\n\n## 1. What DQL is for\n\nDEBYKO stores what perpetual-futures venues published, when they published it, and when we\nreceived it. DQL is how you ask questions about that store:\n\n- **Screening** — \"which instruments satisfy this condition right now?\" (`POST /v2/screen`)\n- **Screening in the past** — the same question, answered with only what was known at a moment\n  you name (`as of`)\n- **Alerts** — \"call my webhook when this condition becomes true for an instrument\", with a tag\n  you choose in the payload (`POST /v2/rules`)\n\nA DQL query is a **condition**: a yes/no statement about data, written the way you would write a\n`WHERE` clause. Indicators use the names you already know (`ema`, `rsi`, `atr`, `crossover`).\nThere are no variables, loops or scripts — a query is one expression, and the same expression has\nan equivalent JSON form for programs.\n\nThree things make DQL different from other screeners, and they come from how DEBYKO treats data:\n\n1. **Venues stay separate.** There is no \"BTC price\"; there is a BTC price on each venue. Every\n   condition about a venue value says which venues it is about: `any(...)`, `all(...)`,\n   `count(...)` or `max/min/sum(...)`.\n2. **Missing data is not filled in.** A venue that has not sent a funding rate has no funding rate —\n   not zero, not yesterday's. A condition on it is neither true nor false; it is *unknown*, and\n   the language has rules for that (§6).\n3. **Everything has an age and a source.** Every value in every response tells you which venue\n   sent it, when we received it and how old it was when the query used it.\n\n---\n\n## 2. Your first query\n\n**Question:** which instruments have a positive funding rate on at least one venue?\n\n```dql\nany(venues where funding > 0)\n```\n\nRead it as: *for this instrument, is there any venue where funding is greater than zero?*\n`funding` on its own would not be a valid query — the language insists you say which venues.\n\nSend it:\n\n```http\nPOST /v2/screen\nContent-Type: application/json\n\n{ \"query\": \"any(venues where funding > 0)\", \"limit\": 2 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where funding > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjdlZjMxMGZmYTMyOTI2ZDEifQ\"\n  }\n}\n```\n\nThings to notice:\n\n- `result` is `\"true\"` for each returned instrument. Instruments where the answer is *unknown* are\n  not returned unless you ask (`\"include_unknown\": true`).\n- Under each instrument, **every listed venue** appears, even the one whose value is missing\n  (OKX-PERP above). That is how you see *why* `any` was true: three venues said yes, one said\n  nothing.\n- Every value carries `venue`, `received_at`, `age_ms` and `status`. There is no bare number\n  anywhere in a DEBYKO response.\n- `next_cursor` continues the **same** evaluation instant, so page two is consistent with page one\n  even though the market moved.\n\n---\n\n## 3. Reading a value\n\n```json\n{ \"value\": 0.0001, \"venue\": \"BYBIT-PERP\", \"layer\": \"funding\",\n  \"venue_ts\": \"2026-09-21T09:30:03.517Z\", \"received_at\": \"2026-09-21T09:30:03.702Z\",\n  \"age_ms\": 1410, \"status\": \"present\" }\n```\n\n| Key | Meaning |\n|---|---|\n| `value` | the number the query used; `null` when there was nothing to use |\n| `venue` | which venue published it |\n| `layer` | the data layer it came from (`funding`, `mark`, `book`, `candles`, …); fields in one layer share a timestamp |\n| `venue_ts` | the venue's own timestamp, when the venue sends one; `null` when it does not |\n| `received_at` | when DEBYKO received it |\n| `age_ms` | `evaluated_at − received_at` (or `as_of − received_at`) |\n| `status` | `present`, `stale`, `missing`, `not_published` or `off` — see §6 |\n| `reason` | only with a null value: `no_value`, `not_retained`, `gap`, `insufficient_history`, `venue_capability`, `policy_off` |\n| `gap_cause` | only with `reason: gap`, and only when DEBYKO recorded the hole: what it recorded — `bus_unavailable` (its own bus refused what the venue sent), `rate_limited`, `venue_rejected`, `ws_disconnected`, `collector_down`, `not_collected` (the platform was not collecting this listing at all — an operator or a rule took it off collection — until it was collected again), … `/v2/snapshots/history` and `/v2/candles` write such a period as `reason: collector_gap` with the same `gap_cause` |\n\nIndicator values add `timeframe`, `bars` (how many candles the number was computed from) and\n`candle_end` (the close time of the newest candle used). Cross-venue aggregates (`max`, `min`,\n`sum`) replace the single venue with a `from` list naming every venue that contributed.\n\nUnits, once:\n\n- Prices are plain numbers in the venue's quote currency (`quote`), never converted.\n- Rates and spreads are **fractions**: `0.0001` is one basis point, `0.01` is one percent. You\n  may write them with a suffix — `1bps`, `0.01%` — and the language turns the suffix into the\n  fraction. `spread < 5bps` and `spread < 0.0005` are the same condition.\n- `funding` is the rate per funding interval **as the venue publishes it**; intervals differ\n  (`1h`, `4h`, `8h`), so `funding_8h` is provided as the same rate scaled to eight hours. It is scaled only by\n  the registry's figure for the listing — the settlement interval, or, on a venue that accrues funding\n  continuously, the period its rate is per (an hour: × 8; a second would be × 28 800). A listing without\n  one answers `funding` as published and `funding_8h` null, so it takes no part in a comparison of\n  eight-hour rates.\n- A venue clamps funding at a cap and a floor, so a value on one is the venue's rule and not the market.\n  Where the venue's **API** publishes the bounds, `funding_cap` and `funding_floor` are those figures, for the same\n  interval as `funding`, and `funding_cap_8h` and `funding_floor_8h` restate them to eight hours exactly as\n  `funding_8h` restates the rate. `funding_at_cap` is a boolean: true when `funding` is at or beyond a bound,\n  false when it lies between two known bounds, unknown when no bound had been observed when the value was received\n  (`not_retained`; a value is never judged against a cap that came later) — so `any(venues where funding_at_cap)` is\n  the question \"does some venue's rate sit on its cap?\". A cap the venue documents only in prose is not data: the\n  fields are `not_published` there.\n- Durations are `10s`, `2m`, `1h`, `1d` (one unit, no `1h30m`).\n\n---\n\n## 3a. Saying what the query is about\n\nA condition says *what must be true*. A `where` clause says *which listings to ask at all*, and it is\nthe same clause on every endpoint — screen, snapshots, history, candles, books, stream. It runs first,\nagainst the listing's own identity, and never against a measurement:\n\n```dql\nvenues_answered >= 1 where base = BTC\nvenues_answered >= 1 where instrument in (BTC-PERP, ETH-PERP)\nvenues_answered >= 1 where venue = KRAKEN-FUTURES\nvenues_answered >= 1 where quote = USDT\nvenues_answered >= 1 where symbol = \"BTCUSDT\"\n```\n\nFive things can be named there:\n\n| In the clause | What it is | Written as |\n|---|---|---|\n| `instrument` | the market code DEBYKO normalised the listing to | a code: `BTC-PERP` |\n| `base` | the base asset of that market | a code: `BTC` |\n| `venue` | the venue's **published** code | a code: `KRAKEN-FUTURES`, from `GET /v2/venues` |\n| `quote` | the listing's quote currency | a code: `USDT` |\n| `symbol` | the venue's own name for the listing | a quoted string: `\"BTCUSDT\"` |\n\nA selection may stand alone: `where base = BTC` with no condition means \"every listing of BTC\", which\nis what the data endpoints send. A venue code that no longer exists, or an instrument that never did,\nis an error naming what is known — never an empty answer that looks like \"nothing matched\".\n\nVenue codes come from `GET /v2/venues`, which needs no key:\n\n```json\n{ \"evaluated_at\": \"2026-09-23T08:51:50.944Z\",\n  \"items\": [ { \"venue\": \"KRAKEN-FUTURES\", \"name\": \"Kraken Futures\", \"kind\": \"order_book\",\n               \"listings\": 296, \"listings_collected\": 5, \"since\": \"2026-09-20T15:11:19.524Z\" } ] }\n```\n\n`listings` is what the venue lists; `listings_collected` is what DEBYKO collects today. The two differ\non purpose, and the difference is not hidden.\n\n## 3b. Units, and what a value says about itself\n\nA venue publishes what it publishes: one exchange counts open interest in contracts, another in the\nbase asset. DQL does not guess. You ask for the units you want, and every value tells you what it is.\n\n- `\"units\": \"published\"` (the default) — exactly what the venue published.\n- `\"units\": \"base\"` — converted to base-asset units with the listing's multiplier and contract size.\n\nEvery value in every response carries `unit`: `quote`, `base`, `contracts`, `fraction`, `count` or\n`duration`. Nothing has to be assumed from a field name.\n\nTwo consequences worth knowing before they surprise you:\n\n- Summing a quantity across venues (`sum(venues, oi)`) is **refused** under `units: published` — the\n  sum of Bybit contracts and Kraken contracts is not a number anybody should print. Ask for\n  `units: base` and it is allowed.\n- Under `units: base`, a listing whose multiplier or contract size DEBYKO does not know answers null\n  with reason `unit_unknown` rather than an unconverted number that looks right.\n\nThree response options, while you are here:\n\n- `\"number_format\": \"string\"` returns every number as the venue's own digits in a JSON string, so a\n  price that does not fit a double survives the round trip. `\"json\"` (the default) returns numbers.\n- `\"include_raw\": true` adds the venue's untouched payload for each layer beside the parsed values.\n- `items_sha256` comes back on every data answer: the hash of the items as serialised. Two answers\n  with the same hash are the same answer, which is cheaper to check than a diff.\n\n---\n\n## 4. Cookbook\n\nEach entry gives the intent, the string form, the JSON form, a request and a rendered\nresponse. Responses are shortened to the instruments and venues that make the point; a real\nresponse lists every venue of every returned instrument.\n\n### 4.1 Positive funding on any venue\n\nIntent: instruments with a positive funding rate on at least one venue.\n\n```dql\nany(venues where funding > 0)\n```\n\nCovered in §2, including the JSON form and the full response.\n\n### 4.2 Fresh positive funding on at least three venues\n\nIntent: the funding rate, normalised to eight hours, is above one basis point on three or more\nvenues, and each of those readings is current. Ask for that with `status(funding) = present`, not with\nan age: a settled rate (dYdX, Coinbase INTX) is as old as its settlement — forty minutes into an hourly\nperiod it is forty minutes old, and current until the next one is due — so `age(funding) < 2m` would\nleave those venues out for most of every hour.\n\n```dql\ncount(venues where funding_8h > 1bps and status(funding) = present) >= 3\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"condition\": { \"type\": \"cmp\", \"op\": \">=\",\n  \"left\": { \"type\": \"count\", \"where\": { \"type\": \"and\", \"args\": [\n    { \"type\": \"cmp\", \"op\": \">\", \"left\": { \"type\": \"field\", \"name\": \"funding_8h\" }, \"right\": { \"type\": \"number\", \"value\": 0.0001 } },\n    { \"type\": \"cmp\", \"op\": \"=\", \"left\": { \"type\": \"call\", \"name\": \"status\", \"args\": [ { \"type\": \"field\", \"name\": \"funding\" } ] },\n      \"right\": { \"type\": \"status\", \"value\": \"present\" } } ] } },\n  \"right\": { \"type\": \"number\", \"value\": 3 } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"count(venues where funding_8h > 1bps and status(funding) = present) >= 3\", \"limit\": 50 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\nDYDX-PERP is listed but did not count: its rate is below the threshold. Three venues did, so the\ncondition holds. Note the canonical string in `query.string`: `1bps` became `0.0001`.\n\n### 4.3 Cross-venue mark dispersion\n\nIntent: the highest and lowest mark price across venues differ by more than five basis points of\nthe lowest, and at least three venues are answering.\n\n```dql\n(max(venues, mark) - min(venues, mark)) / min(venues, mark) > 5bps and venues_answered >= 3\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"condition\": { \"type\": \"and\", \"args\": [\n  { \"type\": \"cmp\", \"op\": \">\",\n    \"left\": { \"type\": \"arith\", \"op\": \"/\",\n      \"left\": { \"type\": \"arith\", \"op\": \"-\", \"left\": { \"type\": \"agg\", \"fn\": \"max\", \"expr\": { \"type\": \"field\", \"name\": \"mark\" } },\n                                              \"right\": { \"type\": \"agg\", \"fn\": \"min\", \"expr\": { \"type\": \"field\", \"name\": \"mark\" } } },\n      \"right\": { \"type\": \"agg\", \"fn\": \"min\", \"expr\": { \"type\": \"field\", \"name\": \"mark\" } } },\n    \"right\": { \"type\": \"number\", \"value\": 0.0005 } },\n  { \"type\": \"cmp\", \"op\": \">=\", \"left\": { \"type\": \"field\", \"name\": \"venues_answered\" }, \"right\": { \"type\": \"number\", \"value\": 3 } } ] } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"(max(venues, mark) - min(venues, mark)) / min(venues, mark) > 5bps and venues_answered >= 3\" }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"ETH-PERP\",\n      \"result\": \"true\",\n      \"values\": {\n        \"max(venues, mark)\": {\n          \"value\": 2751,\n          \"unit\": \"quote\",\n          \"from\": [\n            {\n              \"venue\": \"BYBIT-PERP\",\n              \"value\": 2751,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        },\n        \"min(venues, mark)\": {\n          \"value\": 2749,\n          \"unit\": \"quote\",\n          \"from\": [\n            {\n              \"venue\": \"OKX-PERP\",\n              \"value\": 2749,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        },\n        \"venues_answered\": {\n          \"value\": 3,\n          \"from\": \"reference\",\n          \"as_of\": \"2026-09-23T12:00:05Z\"\n        }\n      },\n      \"scopes\": {\n        \"max(venues, mark)\": {\n          \"venues_listed\": 3,\n          \"venues_in_scope\": 3,\n          \"excluded\": []\n        },\n        \"min(venues, mark)\": {\n          \"venues_listed\": 3,\n          \"venues_in_scope\": 3,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"ETHUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 2751,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_ETHUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 2750,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"ETH-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"mark\": {\n              \"value\": 2749,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\nDispersion is `(0.8134 − 0.8119) / 0.8119 ≈ 18.5 bps`. KRAKEN-FUTURES had a mark, but it was\n84 seconds old — older than the 30-second freshness bound — so it was **stale**, excluded from\n`max`/`min`, and not counted in `venues_answered`. The response shows the value's age; it does not\npretend the value is current. Also note that `max`/`min` provenance names the winning venue.\n\n### 4.4 Two named venues\n\nIntent: the mark price on KRAKEN-FUTURES and BYBIT-PERP differs by more than 10 (quote units).\n\n```dql\nmax(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark) - min(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark) > 10\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"condition\": { \"type\": \"cmp\", \"op\": \">\",\n  \"left\": { \"type\": \"arith\", \"op\": \"-\",\n    \"left\":  { \"type\": \"agg\", \"fn\": \"max\", \"expr\": { \"type\": \"field\", \"name\": \"mark\" },\n               \"where\": { \"type\": \"in\", \"left\": { \"type\": \"field\", \"name\": \"venue\" }, \"values\": [ { \"type\": \"code\", \"value\": \"KRAKEN-FUTURES\" }, { \"type\": \"code\", \"value\": \"BYBIT-PERP\" } ] } },\n    \"right\": { \"type\": \"agg\", \"fn\": \"min\", \"expr\": { \"type\": \"field\", \"name\": \"mark\" },\n               \"where\": { \"type\": \"in\", \"left\": { \"type\": \"field\", \"name\": \"venue\" }, \"values\": [ { \"type\": \"code\", \"value\": \"KRAKEN-FUTURES\" }, { \"type\": \"code\", \"value\": \"BYBIT-PERP\" } ] } } },\n  \"right\": { \"type\": \"number\", \"value\": 10 } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"max(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark) - min(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark) > 10\" }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"SOL-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {\n        \"max(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark)\": {\n          \"value\": null,\n          \"unit\": \"quote\",\n          \"from\": [],\n          \"reason\": \"no_value\"\n        },\n        \"min(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark)\": {\n          \"value\": null,\n          \"unit\": \"quote\",\n          \"from\": [],\n          \"reason\": \"no_value\"\n        }\n      },\n      \"scopes\": {\n        \"max(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark)\": {\n          \"venues_listed\": 1,\n          \"venues_in_scope\": 1,\n          \"excluded\": []\n        },\n        \"min(venues where venue in (KRAKEN-FUTURES, BYBIT-PERP), mark)\": {\n          \"venues_listed\": 1,\n          \"venues_in_scope\": 1,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"SOL\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"venue\": {\n              \"value\": \"HYPERLIQUID\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"reference\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T00:00:00Z\",\n              \"age_ms\": 43205000,\n              \"status\": \"present\"\n            },\n            \"mark\": {\n              \"value\": 118,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"mark\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\nThe `where` inside `max(...)` restricts the venues the aggregate looks at; other venues still\nappear in the response because they are part of the instrument, but they did not contribute.\n\n### 4.5 Tight books wherever there is a book\n\nIntent: every venue that publishes an order book has a spread below five basis points. Venues\nthat publish no book (oracle-priced venues) must not make the condition fail.\n\n```dql\nall(venues where status(bid) = not_published or spread < 5bps)\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"condition\": { \"type\": \"all\", \"where\": { \"type\": \"or\", \"args\": [\n  { \"type\": \"cmp\", \"op\": \"=\", \"left\": { \"type\": \"call\", \"name\": \"status\", \"args\": [ { \"type\": \"field\", \"name\": \"bid\" } ] }, \"right\": { \"type\": \"status\", \"value\": \"not_published\" } },\n  { \"type\": \"cmp\", \"op\": \"<\", \"left\": { \"type\": \"field\", \"name\": \"spread\" }, \"right\": { \"type\": \"number\", \"value\": 0.0005 } } ] } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"all(venues where status(bid) = not_published or spread < 5bps)\" }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"all(venues where status(bid) = not_published or spread < 0.0005)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"status(bid)\": {\n              \"value\": \"present\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000011495574,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"status(bid)\": {\n              \"value\": \"present\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000022985864,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"status(bid)\": {\n              \"value\": \"present\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000022988506,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"status(bid)\": {\n              \"value\": \"present\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            },\n            \"spread\": {\n              \"value\": 0.000002298983,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"book\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:00:34Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImI5ZTY0YzFjZWJmOTkzZmQifQ\"\n  }\n}\n```\n\nWithout the `status(bid) = not_published or` part the answer is the same: a venue that publishes no\nbook has no spread by construction, so it is left out of the `all` altogether and named under\n`scopes` with the reason (§6). The `or` still says in the query what you meant.\n\n### 4.6 Trend on hourly candles, any venue\n\nIntent: on at least one venue, the 20-candle EMA of hourly closes is above the 50-candle EMA.\n\n```dql\nany(venues where ema(close, 20) > ema(close, 50)) timeframe 1h\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"timeframe\": \"1h\", \"condition\": { \"type\": \"any\", \"where\": { \"type\": \"cmp\", \"op\": \">\",\n  \"left\":  { \"type\": \"call\", \"name\": \"ema\", \"args\": [ { \"type\": \"source\", \"name\": \"close\" }, { \"type\": \"number\", \"value\": 20 } ] },\n  \"right\": { \"type\": \"call\", \"name\": \"ema\", \"args\": [ { \"type\": \"source\", \"name\": \"close\" }, { \"type\": \"number\", \"value\": 50 } ] } } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"any(venues where ema(close, 20) > ema(close, 50)) timeframe 1h\", \"limit\": 20 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"timeframe\": \"1h\",\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where ema(close, 20) > ema(close, 50))\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6ImRkOWI3MzhhMWQzNzY1OTQifQ\"\n  }\n}\n```\n\nTwo details. First, the candle used is the **last completed** hourly candle (`candle_end`\n09:00); the candle that is still forming is never used, so a condition cannot become true and\nthen untrue within the same hour as the price wobbles. Second, `ema(close, 20)` uses exactly 80\ncandles (`bars`), and `ema(close, 50)` exactly 200 — a fixed window, defined in the\nspecification, so you can recompute the number yourself. WEEX-FUTURES had a hole somewhere in\nits last 200 hourly candles, so both EMAs are null there (`reason: gap`); DEBYKO does not fill\nholes, and the other two venues carried the condition.\n\n### 4.7 A cross on the latest closed 15-minute candle, one venue, clean history\n\nIntent: on KRAKEN-FUTURES, the 20-EMA crossed above the 50-EMA on the most recent completed\n15-minute candle, and the last 200 candles have no gaps.\n\n```dql\nany(venues where venue = KRAKEN-FUTURES and crossover(ema(close, 20), ema(close, 50)) and gaps(200) = 0) timeframe 15m\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"timeframe\": \"15m\", \"condition\": { \"type\": \"any\", \"where\": { \"type\": \"and\", \"args\": [\n  { \"type\": \"cmp\", \"op\": \"=\", \"left\": { \"type\": \"field\", \"name\": \"venue\" }, \"right\": { \"type\": \"code\", \"value\": \"KRAKEN-FUTURES\" } },\n  { \"type\": \"call\", \"name\": \"crossover\", \"args\": [\n      { \"type\": \"call\", \"name\": \"ema\", \"args\": [ { \"type\": \"source\", \"name\": \"close\" }, { \"type\": \"number\", \"value\": 20 } ] },\n      { \"type\": \"call\", \"name\": \"ema\", \"args\": [ { \"type\": \"source\", \"name\": \"close\" }, { \"type\": \"number\", \"value\": 50 } ] } ] },\n  { \"type\": \"cmp\", \"op\": \"=\", \"left\": { \"type\": \"call\", \"name\": \"gaps\", \"args\": [ { \"type\": \"number\", \"value\": 200 } ] }, \"right\": { \"type\": \"number\", \"value\": 0 } } ] } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"any(venues where venue = KRAKEN-FUTURES and crossover(ema(close, 20), ema(close, 50)) and gaps(200) = 0) timeframe 15m\" }\n```\n\nIllustrative response (only the named venue is shown; the others are listed in a real response\nwith `venue = KRAKEN-FUTURES` evaluating to false):\n\n```json\n{\n  \"dql\": \"1\",\n  \"query\": { \"string\": \"any(venues where venue = KRAKEN-FUTURES and crossover(ema(close, 20), ema(close, 50)) and gaps(200) = 0) timeframe 15m\", \"json\": { \"…\": \"…\" } },\n  \"evaluated_at\": \"2026-09-21T09:30:05.112Z\", \"as_of\": null, \"settled\": false, \"timeframe\": \"15m\",\n  \"freshness\": { \"ticker\": \"30s\", \"mark\": \"30s\", \"oi\": \"30s\", \"book\": \"30s\", \"stats\": \"120s\", \"funding\": \"300s\" },\n  \"instruments\": [\n    { \"instrument\": \"DOGE\", \"result\": \"true\", \"values\": {},\n      \"venues\": [\n        { \"venue\": \"KRAKEN-FUTURES\", \"symbol\": \"DOGEUSDT\", \"quote\": \"USDT\", \"values\": {\n            \"venue\": { \"value\": \"KRAKEN-FUTURES\", \"venue\": \"KRAKEN-FUTURES\", \"layer\": \"reference\", \"venue_ts\": null, \"received_at\": \"2026-08-30T00:00:12.000Z\", \"age_ms\": 1934393112, \"status\": \"present\" },\n            \"crossover(ema(close, 20), ema(close, 50))\": { \"value\": true, \"venue\": \"KRAKEN-FUTURES\", \"layer\": \"candles\", \"timeframe\": \"15m\", \"bars\": 201, \"candle_end\": \"2026-09-21T09:30:00Z\", \"venue_ts\": \"2026-09-21T09:30:00Z\", \"received_at\": \"2026-09-21T09:30:00.455Z\", \"age_ms\": 4657, \"status\": \"present\" },\n            \"gaps(200)\": { \"value\": 0, \"venue\": \"KRAKEN-FUTURES\", \"layer\": \"candles\", \"timeframe\": \"15m\", \"bars\": 200, \"candle_end\": \"2026-09-21T09:30:00Z\", \"venue_ts\": \"2026-09-21T09:30:00Z\", \"received_at\": \"2026-09-21T09:30:00.455Z\", \"age_ms\": 4657, \"status\": \"present\" } } }\n      ] }\n  ],\n  \"page\": { \"limit\": 100, \"returned\": 1, \"next_cursor\": null }\n}\n```\n\n`crossover(a, b)` means: on the newest completed candle `a > b`, and on the one before it\n`a <= b`. It is a statement about two candles, not a forecast.\n\n### 4.8 Two timeframes in one condition\n\nIntent: hourly trend up (EMA 20 above EMA 50 on 1h candles) while the 15-minute RSI is low.\n\n```dql\nany(venues where ema(close, 20, 1h) > ema(close, 50, 1h) and rsi(close, 14, 15m) < 35)\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"condition\": { \"type\": \"any\", \"where\": { \"type\": \"and\", \"args\": [\n  { \"type\": \"cmp\", \"op\": \">\",\n    \"left\":  { \"type\": \"call\", \"name\": \"ema\", \"args\": [ { \"type\": \"source\", \"name\": \"close\" }, { \"type\": \"number\", \"value\": 20 } ], \"timeframe\": \"1h\" },\n    \"right\": { \"type\": \"call\", \"name\": \"ema\", \"args\": [ { \"type\": \"source\", \"name\": \"close\" }, { \"type\": \"number\", \"value\": 50 } ], \"timeframe\": \"1h\" } },\n  { \"type\": \"cmp\", \"op\": \"<\",\n    \"left\":  { \"type\": \"call\", \"name\": \"rsi\", \"args\": [ { \"type\": \"source\", \"name\": \"close\" }, { \"type\": \"number\", \"value\": 14 } ], \"timeframe\": \"15m\" },\n    \"right\": { \"type\": \"number\", \"value\": 35 } } ] } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"any(venues where ema(close, 20, 1h) > ema(close, 50, 1h) and rsi(close, 14, 15m) < 35)\" }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where ema(close, 20, 1h) > ema(close, 50, 1h) and rsi(close, 14, 15m) < 35)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"rsi(close, 14, 15m)\": {\n              \"value\": null,\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 57,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\",\n              \"reason\": \"gap\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"ema(close, 20, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"rsi(close, 14, 15m)\": {\n              \"value\": 88.19612724877551,\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 57,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"ema(close, 20, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"rsi(close, 14, 15m)\": {\n              \"value\": 88.19612724877551,\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 57,\n              \"candle_end\": \"2026-09-23T12:00:00Z\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:00.300Z\",\n              \"age_ms\": 4700,\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"ema(close, 20, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 80,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"ema(close, 50, 1h)\": {\n              \"value\": null,\n              \"unit\": \"quote\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"1h\",\n              \"bars\": 200,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            },\n            \"rsi(close, 14, 15m)\": {\n              \"value\": null,\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"candles\",\n              \"timeframe\": \"15m\",\n              \"bars\": 57,\n              \"candle_end\": null,\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjMxOTVhZGUxMDU2YTFhOWMifQ\"\n  }\n}\n```\n\nWhen every series function carries its own timeframe, the `timeframe` clause is not needed. Mixing\nis fine as long as each function's series is consistent: `crossover(ema(close, 20, 1h),\nema(close, 50, 4h))` is rejected because the two series have different timeframes.\n\n### 4.9 Which instruments have a venue that has gone quiet\n\nIntent: instruments where at least one listed venue is not answering (no fresh mark price).\n\n```dql\nvenues_answered < venues_listed\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"condition\": { \"type\": \"cmp\", \"op\": \"<\", \"left\": { \"type\": \"field\", \"name\": \"venues_answered\" }, \"right\": { \"type\": \"field\", \"name\": \"venues_listed\" } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"venues_answered < venues_listed\", \"limit\": 3 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\nThis query references no venue field, so per-venue `values` are empty; add `status(mark)` inside a\nquantifier if you want to see which venue is quiet (next entry).\n\n### 4.10 Stale, missing and not published are three different things\n\nIntent: instruments where at least one venue's funding rate is **stale** — we have a value, but it\nis older than the freshness bound.\n\n```dql\ncount(venues where status(funding) = stale) >= 1\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"condition\": { \"type\": \"cmp\", \"op\": \">=\",\n  \"left\": { \"type\": \"count\", \"where\": { \"type\": \"cmp\", \"op\": \"=\", \"left\": { \"type\": \"call\", \"name\": \"status\", \"args\": [ { \"type\": \"field\", \"name\": \"funding\" } ] }, \"right\": { \"type\": \"status\", \"value\": \"stale\" } } },\n  \"right\": { \"type\": \"number\", \"value\": 1 } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"count(venues where status(funding) = stale) >= 1\", \"limit\": 1 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"count(venues where status(funding) = stale)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"stale\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"status(funding)\": {\n              \"value\": \"present\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": null\n  }\n}\n```\n\nFour situations, one per venue: a reading that arrived a second ago is **present**; one that arrived\neight minutes ago, past the layer's freshness bound, is **stale** — the value comes back with its true\nage, and a comparison treats it as unknown; a layer DEBYKO collects for which nothing has arrived for\nthis listing is **missing**; a field the venue does not publish at all — Hyperliquid's mark candles,\nKraken's funding interval — is **not_published**. A fifth status, **off**, means DEBYKO does not\ncollect that layer for that instrument's group by policy. Only the first counts as data in a\ncomparison.\n\n### 4.11 As of a past moment\n\nIntent: which instruments had positive funding on three or more venues at 08:00 UTC today, using\nonly what DEBYKO had received by then.\n\n```dql\ncount(venues where funding > 0) >= 3 as of 2026-09-21T08:00:00Z\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"as_of\": \"2026-09-21T08:00:00Z\", \"condition\": { \"type\": \"cmp\", \"op\": \">=\",\n  \"left\": { \"type\": \"count\", \"where\": { \"type\": \"cmp\", \"op\": \">\", \"left\": { \"type\": \"field\", \"name\": \"funding\" }, \"right\": { \"type\": \"number\", \"value\": 0 } } },\n  \"right\": { \"type\": \"number\", \"value\": 3 } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"count(venues where funding > 0) >= 3 as of 2026-09-21T08:00:00Z\", \"limit\": 1 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": \"2026-09-21T08:00:00Z\",\n  \"settled\": true,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\nNotice the ages: they are measured against 08:00:00, not against now, and they are up to a minute\nbecause funding history was retained once per minute then (once per ten seconds since 2026-09-29). `settled: true` says the answer will not\nchange if you ask again — the moment is older than the platform's settle window, and the platform\nhas written its history past that window too, so nothing is still in flight. Every `received_at` is before 08:00:00; a value received at 08:00:00.100 would not\nbe visible to this query even if the venue stamped it 07:59:59.\n\n### 4.12 Relaxed freshness for a historical question\n\nIntent: a week ago at noon, did any venue show open interest at all — accepting values up to ten\nminutes old.\n\n```dql\nany(venues where oi > 0) freshness 10m as of 2026-09-14T12:00:00Z\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"freshness\": \"10m\", \"as_of\": \"2026-09-14T12:00:00Z\",\n  \"condition\": { \"type\": \"any\", \"where\": { \"type\": \"cmp\", \"op\": \">\", \"left\": { \"type\": \"field\", \"name\": \"oi\" }, \"right\": { \"type\": \"number\", \"value\": 0 } } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"any(venues where oi > 0) freshness 10m as of 2026-09-14T12:00:00Z\", \"limit\": 1 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": \"2026-09-14T12:00:00Z\",\n  \"settled\": true,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": \"10m\",\n    \"mark\": \"10m\",\n    \"oi\": \"10m\",\n    \"book\": \"10m\",\n    \"stats\": \"10m\",\n    \"funding\": \"10m\"\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"unknown\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where oi > 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"oi\": {\n              \"value\": null,\n              \"unit\": \"base\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"oi\",\n              \"venue_ts\": null,\n              \"received_at\": null,\n              \"age_ms\": null,\n              \"status\": \"missing\",\n              \"reason\": \"no_value\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0xNFQxMjowMDowMFoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6Ijg5MDVkMmI1ZmRjNWVhNzEifQ\"\n  }\n}\n```\n\nBybit's reading above was almost eight minutes old; under the default 30-second bound it would have\nbeen stale, under `freshness 10m` it is present — and its true age comes back either way. A venue\nwhose history is kept for a shorter period answers `missing` with reason `not_retained` instead:\nnothing from that day exists any more. The query still runs; it simply cannot see that venue.\n\n### 4.13 Like-for-like quotes only\n\nIntent: dispersion of mark prices above ten basis points, comparing only listings quoted in a USD\nstablecoin or USD.\n\n```dql\nmax(venues where quote in (USDT, USDC, USD), mark) / min(venues where quote in (USDT, USDC, USD), mark) - 1 > 10bps\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\", \"condition\": { \"type\": \"cmp\", \"op\": \">\",\n  \"left\": { \"type\": \"arith\", \"op\": \"-\",\n    \"left\": { \"type\": \"arith\", \"op\": \"/\",\n      \"left\":  { \"type\": \"agg\", \"fn\": \"max\", \"expr\": { \"type\": \"field\", \"name\": \"mark\" }, \"where\": { \"type\": \"in\", \"left\": { \"type\": \"field\", \"name\": \"quote\" }, \"values\": [ { \"type\": \"code\", \"value\": \"USDT\" }, { \"type\": \"code\", \"value\": \"USDC\" }, { \"type\": \"code\", \"value\": \"USD\" } ] } },\n      \"right\": { \"type\": \"agg\", \"fn\": \"min\", \"expr\": { \"type\": \"field\", \"name\": \"mark\" }, \"where\": { \"type\": \"in\", \"left\": { \"type\": \"field\", \"name\": \"quote\" }, \"values\": [ { \"type\": \"code\", \"value\": \"USDT\" }, { \"type\": \"code\", \"value\": \"USDC\" }, { \"type\": \"code\", \"value\": \"USD\" } ] } } },\n    \"right\": { \"type\": \"number\", \"value\": 1 } },\n  \"right\": { \"type\": \"number\", \"value\": 0.001 } } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"max(venues where quote in (USDT, USDC, USD), mark) / min(venues where quote in (USDT, USDC, USD), mark) - 1 > 10bps\", \"limit\": 1 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 0,\n    \"next_cursor\": null\n  }\n}\n```\n\nDQL never converts currencies. `USDT`, `USDC` and `USD` are three different values of\n`quote`; if you want to treat them as one group, say so in the query, as here. (The comparison page\ngroups them for display; the language does not.)\n\n### 4.14 Ordering the screen\n\nIntent: instruments answering on at least two venues, highest eight-hour funding first.\n\n```dql\nvenues_answered >= 2 order by max(venues, funding_8h) desc\n```\n\nJSON form:\n\n```json\n{ \"dql\": \"1\",\n  \"condition\": { \"type\": \"cmp\", \"op\": \">=\", \"left\": { \"type\": \"field\", \"name\": \"venues_answered\" }, \"right\": { \"type\": \"number\", \"value\": 2 } },\n  \"order_by\": { \"expr\": { \"type\": \"agg\", \"fn\": \"max\", \"expr\": { \"type\": \"field\", \"name\": \"funding_8h\" } }, \"direction\": \"desc\" } }\n```\n\nRequest:\n\n```json\n{ \"query\": \"venues_answered >= 2 order by max(venues, funding_8h) desc\", \"limit\": 3 }\n```\n\nResponse, on the documentation fixture — real venue codes, invented numbers, the query echo dropped:\n\n```json\n{\n  \"dql\": \"1\",\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {\n        \"venues_answered\": {\n          \"value\": 4,\n          \"from\": \"reference\",\n          \"as_of\": \"2026-09-23T12:00:05Z\"\n        },\n        \"max(venues, funding_8h)\": {\n          \"value\": 0.000104,\n          \"unit\": \"fraction\",\n          \"from\": [\n            {\n              \"venue\": \"HYPERLIQUID\",\n              \"value\": 0.000104,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"status\": \"present\"\n            }\n          ]\n        }\n      },\n      \"scopes\": {\n        \"max(venues, funding_8h)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.000104,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.00008,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding_8h\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"derived\": true,\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 1,\n    \"returned\": 1,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkJUQy1QRVJQIiwicSI6IjE0MTk1NWNjMGNhMzliODEifQ\"\n  }\n}\n```\n\nThe ordering key appears in `values` so you can see what the sort used (BTC's venue list is shortened here; a real response lists all fourteen). Instruments whose key is\nnull (no venue had a usable `funding_8h`) sort last, in either direction.\n\n### 4.15 Alerts, with Agent\n\nIntent: be told when, for any instrument, the 20/50 EMA cross happens on hourly candles on a venue\nwith a clean 200-candle history.\n\nThe condition is a query like any other:\n\n```dql\nany(venues where crossover(ema(close, 20), ema(close, 50)) and gaps(200) = 0) timeframe 1h\n```\n\n**The API does not hold alerts.** It answers questions; it does not remember them, does not run them\non a schedule and does not deliver anything to a webhook. That belongs to **Agent**: Agent holds the\nquery, the cadence, the destination and your own tag, calls this API on that cadence, and decides\nwhat a firing means.\n\nThe reason is not architectural tidiness. A saved rule with a webhook makes the data API responsible\nfor delivery, for retries, and — once a rule can be public — for showing somebody's words next to a\nnumber, which is how a data platform ends up looking like it recommends a trade. The language has no\nvocabulary for an action or an opinion (spec §7.5), and now it has no tag to store either.\n\nUntil Agent opens, the same thing is four lines of your own code: run the query on your cadence,\ncompare with the previous answer, act on the difference. Everything the query needs — the canonical\nform to compare against and `settled` to know the answer may still move — is in the response.\n\n### 4.16 A rate of change on a snapshot field\n\nIntent: the mark price is more than half a per cent above where it stood five minutes ago, on any\nvenue. `mark` is a snapshot field, not a candle, and DQL samples it at the effective timeframe.\n\n```dql\nany(venues where roc(mark, 5) > 0.5%) timeframe 1m\n```\n\nThe samples are the platform's own per-second readings collapsed to the timeframe (spec §7.2a); a\nperiod with nothing retained is a gap, and a gap makes the answer null rather than a smaller number.\n\n### 4.17 A spread that is unusually wide for this venue\n\nIntent: the current spread sits above the 90th percentile of its own last hour — \"wide for this\nvenue\", not \"wide compared with a number I guessed\".\n\n```dql\nany(venues where spread > percentile(spread, 60, 90%)) timeframe 1m\n```\n\n`percentile` takes the nearest rank by default; add `linear` as a fourth argument for interpolation\nbetween the two neighbouring readings.\n\n### 4.18 Real money resting near the mid\n\nIntent: at least one venue has more than two million quote units resting within ten basis points of\nthe mid on the bid side.\n\n```dql\nany(venues where depth_bid_value(10bps) > 2000000)\n```\n\nThe bands are the platform's, not yours: ask `GET /v2/dql/catalogue` for the set. A book that did not\nreach the band's edge answers null with reason `band_truncated` — never the sum of the levels that\nhappened to arrive. A book the platform keeps as a window of the venue's (Binance USD-M's core listings)\nsays how far each side reaches in `liquidity.coverage_bps` on `/v2/snapshots`; the bands inside it are exact\nto the last update and a band beyond it is null with `partial_coverage` on that endpoint.\n\n### 4.19 Choosing the columns, and ordering by two keys\n\nIntent: the instruments where at least two venues answer, the widest funding first and, where that\nties, the tighter spread first — and bring back only the three numbers I want.\n\n```dql\nvenues_answered >= 2 select max(venues, funding_8h), min(venues, spread), venues_answered order by max(venues, funding_8h) desc, min(venues, spread) asc\n```\n\n`select` decides what comes back; without it the answer carries every atom the condition touched.\n\n### 4.20 The venue's mark candle, not its trade candle\n\nIntent: compare the last closed hourly **mark** candle with the live mark price.\n\n```dql\nany(venues where mark > mark_close) timeframe 1h\n```\n\nA venue that publishes no mark candles answers `not_published` for `mark_close` — Hyperliquid today —\nand the comparison is unknown for that venue rather than false.\n\n### 4.21 Asking for older data on purpose\n\nIntent: a question about yesterday, where a reading a few minutes old is perfectly good.\n\n```dql\nany(venues where oi > 1000) freshness 30m as of 2026-09-20T12:00:00Z\n```\n\n`freshness` replaces every layer's default bound at once. It does not make stale data fresh: it\nchanges where the line between `present` and `stale` is drawn for this question, and every value\nstill comes back with its true age.\n\n### 4.22 One venue's own symbol\n\nIntent: the listing a venue calls `BTCUSDT`, whatever DEBYKO calls the instrument.\n\n```dql\nany(venues where mark > 0) where symbol = \"BTCUSDT\"\n```\n\n`symbol` is the venue's own string and is quoted; it may appear only in the `where` selection. A bare\ncode there (`symbol = BTCUSDT`) is `DQL_TYPE`, because a symbol is not a code.\n\n### 4.23 Who is being forced out\n\nIntent: at least one venue has had more than a hundred thousand quote units of long positions liquidated\nin the last hour, and more than twice the value of the short positions liquidated there.\n\n```dql\nany(venues where liquidation_long_value(4) > 100000 and liquidation_long_value(4) > 2 * liquidation_short_value(4)) timeframe 15m\n```\n\nA liquidation is an event the venue published, so the language reads it as a **total over a window of\nperiods** — here the four 15-minute periods ending at the latest period end — and has no \"latest\nliquidation\": there is no now to read, nothing is sampled and nothing is carried. `long` is a long position\nclosed (the venue's forced `sell`), `short` a short position closed (its `buy`). A quiet hour is `0` and\n`present`, never `missing`. The total is null, with the reason, where the platform cannot vouch for the window:\nit begins before what is kept for the listing (`not_retained`), or the platform recorded a hole in it that lost\nevents (`gap`, and `gap_cause` says what was recorded). A venue that publishes none is `not_published`, a group\nthat does not keep them `off`. The events themselves, one by one, are `POST /v2/liquidations`.\n\nOne limit of what a total can know: the platform does not record when it began collecting the layer for a venue, so a\nwindow reaching back past that moment counts what was collected, and a venue whose collector has not run yet answers `0`,\nnot null. `retention_from` (on `/v2/liquidations` and `/v2/instruments`) is the oldest week its retention class holds, not the\nday collection started.\n\n### 4.24 A BTC regime filter\n\nIntent: on Kraken, in USD, an instrument whose 9-period average is above its 21-period average, but only while BTC itself is above its own\n50-period average — the signal on one pair, the filter on another.\n\n```dql\nany(venues where venue = KRAKEN-FUTURES and ema(mark_close, 9, 15m) > ema(mark_close, 21, 15m) and ref(BTC-PERP, mark_close) > ref(BTC-PERP, ema(mark_close, 50, 15m))) timeframe 15m where venue = KRAKEN-FUTURES and quote = USD\n```\n\n`ref(INSTRUMENT, expr)` is the value of `expr` for another instrument on the **same venue** the venue-scoped part is being evaluated for,\nat the same instant, under the same `as of` and `freshness`; `ref(INSTRUMENT, expr, VENUE)` names the venue. The BTC listing is read\nwhether or not the `where` selection holds it, and reading it adds nothing to the answer — each value read says whose it is, with\n`instrument` beside `venue`. Periods travel inside the expression (`ref(BTC-PERP, ema(mark_close, 50, 4h))`); a bare `mark_close`, as\nabove, takes the `timeframe` clause. A `ref` is always one value at that instant, never a series: when the expression is a series, `ref`\nreads its latest bar, so `ref(BTC-PERP, mark_close)` is BTC's latest mark close, and a series function goes inside the `ref`\n(`ref(BTC-PERP, sma(mark_close, 20))`, `ref(BTC-PERP, ema(mark_close, 9) > ema(mark_close, 21))`); `sma(ref(BTC-PERP, mark_close), 20)`\nis `DQL_TYPE`. A rolling series across two listings (ALT/BTC over time) cannot be written. Where BTC is not listed on that venue, is halted there, or has candles switched off or not\npublished, the value is null with `not_in_scope` and the comparison is unknown, never false. Outside a quantifier the venue is required\n(`ref(BTC-PERP, mark_close, KRAKEN-FUTURES) > 60000` is a condition on the instrument), a `ref` holds no other `ref`, quantifier or\naggregate (`DQL_NESTING`), and one query reads at most four different listings (`DQL_COMPLEXITY`).\n\n## 5. Two ways to write the same query\n\nEvery query has a string form and a JSON form, and they are interchangeable: send either to\n`POST /v2/screen`, and the response contains both, normalised. `POST /v2/dql/parse` converts and\nvalidates without evaluating — useful for editors and for programs that generate queries.\n\n```json\n{ \"query\": \"count(venues where funding_8h > 1bps) >= 3\", \"context\": \"screen\" }\n```\n\nreturns the canonical string (`1bps` becomes `0.0001`), the JSON tree, the list of fields and\nfunctions the query touches, and its complexity score — or a precise error with a position and\na hint. Errors are structured:\n\n```json\n{ \"errors\": [ { \"code\": \"DQL_SCOPE\", \"message\": \"'funding' is venue-scoped at 1:1\",\n                \"position\": { \"line\": 1, \"column\": 1, \"offset\": 0, \"length\": 7 },\n                \"hint\": \"wrap it in any(venues where …), all(…), count(…) or an aggregate\" } ] }\n```\n\n`GET /v2/dql/catalogue` lists every field (with type, unit, layer and which venues do not publish\nit), every function, every venue, currency and timeframe, the freshness defaults and the limits.\nIf you generate queries programmatically, read it first.\n\n---\n\n## 6. Missing data, for humans\n\nA DQL comparison can come out three ways: **true**, **false**, or **unknown**. Unknown means\n\"there was no value to compare\", and it happens more often than in a stock screener because DEBYKO\nrefuses to invent values:\n\n- a venue has not sent a field for a while (**stale**): the last value is shown with its age,\n  but the language will not compare it as if it were current;\n- a venue has never sent the field for this instrument, or its history was not kept that long\n  (**missing**);\n- the venue does not have the field at all — an oracle-priced venue has no order book\n  (**not_published**);\n- DEBYKO does not collect that layer for that instrument group (**off**);\n- an indicator needs 80 candles and one is absent (**gap**), or only 30 exist\n  (**insufficient history**).\n\nThe combining rules are the ones SQL uses for `NULL`:\n\n- `unknown and false` is **false** (one false is enough), `unknown and true` is **unknown**;\n- `unknown or true` is **true** (one true is enough), `unknown or false` is **unknown**;\n- `not unknown` is **unknown**;\n- `any(...)` is true if some venue is true, otherwise unknown if some venue is unknown, otherwise\n  false;\n- `all(...)` is false if some venue is false, otherwise unknown if some venue is unknown,\n  otherwise true;\n- `count(...)` counts only venues that are true, so it is never unknown.\n\nWhich venues a quantifier (`any`, `all`, `count`) or an aggregate (`max`, `min`, `sum`) runs over is\ndecided for each one by what it reads. A venue that has **no value by construction** is left out:\nthe venue has halted the listing (**halted**), or a field the quantifier's own expression reads is\n**not_published** or **off** there. A venue that has **no value right now** — **stale** or\n**missing** — stays in and makes the answer unknown, because a clean \"no\" has to wait for it. So\n`any(venues where mark > 84607)` skips the venues that never publish a mark, while\n`any(venues where funding > 0)` still asks them about funding. Every answer says what each\nquantifier ran over, under `scopes`:\n\n```json\n\"scopes\": {\n  \"any(venues where mark > 84607)\": {\n    \"venues_listed\": 16, \"venues_in_scope\": 12,\n    \"excluded\": [ { \"venue\": \"DYDX-PERP\", \"symbol\": \"BTC-USD\", \"reason\": \"not_published\", \"layer\": \"mark\" },\n                  { \"venue\": \"COINBASE-INTX\", \"symbol\": \"BTC-PERP\", \"reason\": \"halted\", \"layer\": null } ]\n  }\n}\n```\n\nOne venue left out still leaves out the whole listing for that quantifier, even when the\nexpression has an `or` that the listing could have answered on another field. That is a known\nlimitation, kept on purpose: membership that depended on the shape of the expression could not be\nshown in one line of `scopes`. A venue that accrues funding continuously never settles, so its\n`time_to_funding` and `funding_interval` are **not_published** (`funding_continuous`): a quantifier\nover either leaves it out.\n\nWhen every listing is left out — `\"venues_in_scope\": 0`, \"0 of 11 venues\" — the quantifier has\nnothing to answer about, and its value is **unknown** with the reason `no_venues`. That holds for\n`any`, `all`, `count`, `max`, `min` and `sum` alike: `any` over nothing is not a \"no\", and\n`count(venues where …) >= 0` is not a \"yes\". A rule over such an instrument does not fire, and its\nnot-fired line names `no_venues` and the scope.\n\nA screen returns instruments where the condition is **true**. A rule fires only on **true**.\nUnknown is silent by default; ask for it with `\"include_unknown\": true` when you are debugging a\ncondition.\n\nWriting conditions that handle it:\n\n| You want | Write |\n|---|---|\n| ignore venues that do not publish the field | nothing: they are left out of the quantifier already (`scopes` names them) |\n| only count venues with fresh data | `count(venues where status(field) = present and <condition>)` |\n| require a minimum number of answering venues | `... and venues_answered >= 3` |\n| treat \"no data\" as a failure of the screen | leave the condition as it is — unknown is already excluded |\n| find the instruments where data quality is the problem | `count(venues where status(field) != present) >= 1` |\n| accept older readings on purpose | `... freshness 10m` |\n\nA useful habit: when a screen returns fewer instruments than you expect, run it once with\n`include_unknown: true` and look at the `status` and `reason` of the values. The answer is always\nin the response.\n\n---\n\n### The two reasons that are about DEBYKO, not about the venue\n\nSeven of the nine reasons say something about the venue or the moment. Two say something about us:\n\n- `unit_unknown` — you asked for `units: base` and we do not know this listing's contract size, so we\n  will not convert. Ask for `units: published` and do the conversion yourself, or tell us the\n  contract rules are missing.\n- `unmapped` — the listing is collected but belongs to no market yet, so it has no `instrument`. It\n  still answers by `venue` and `symbol`; it just cannot be compared with anything.\n\n## 6a. Four mistakes, and what the API says about them\n\nEach of these is rejected before anything is evaluated, with the position and a suggestion. They are\nworth reading once: three of the four are the difference between DQL and the query languages it\nresembles.\n\n**A venue-scoped field on its own.** Which venue's funding? The language will not guess.\n\n```dql-error DQL_SCOPE\nfunding > 0\n```\n\n> `'funding' is venue-scoped; wrap it in any(venues where …), all(…), count(…) or an aggregate`\n\n**A series without a period.** `ema` over what candles?\n\n```dql-error DQL_TIMEFRAME_REQUIRED\nany(venues where ema(close, 20) > 0)\n```\n\n> add `timeframe 1h`, or write the period into the call: `ema(close, 20, 1h)`\n\n**A period the platform does not keep.**\n\n```dql-error DQL_TIMEFRAME_UNSUPPORTED\nany(venues where ema(close, 20) > 0) timeframe 7m\n```\n\n> `timeframe '7m' is not supported; supported: 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d`\n\n**A venue's symbol written as a code.** `symbol` is the venue's own string, so it is quoted.\n\n```dql-error DQL_TYPE\nany(venues where mark > 0) where symbol = BTCUSDT\n```\n\n> `symbol takes a quoted string`\n\n## 7. Coming from Pine Script\n\nDQL borrows indicator names, nothing else. Pine is a scripting language that runs bar by bar over\na chart; DQL is a single condition evaluated over many instruments and venues at one instant.\n\n| In Pine you write | In DQL you write | Note |\n|---|---|---|\n| `ta.ema(close, 20)` | `ema(close, 20)` | no `ta.` prefix; fixed 80-candle window with SMA seed (see spec §7.3) |\n| `close` | `close` | the last **completed** candle; the forming candle is never used |\n| `close[1]` | `prev(close, 1)` | no `[]` operator |\n| `ta.crossover(a, b)` | `crossover(a, b)` | same meaning: `a > b` now and `a <= b` one candle earlier |\n| `ta.rsi(close, 14)` | `rsi(close, 14)` | Wilder smoothing, fixed 56-change window |\n| `ta.atr(14)` | `atr(14)` | same |\n| chart timeframe | `timeframe 15m` clause, or `ema(close, 20, 15m)` | no implicit timeframe |\n| `request.security(...)` | trailing timeframe argument per function | several timeframes in one condition |\n| `and or not` | `and or not` | same words; `not` binds below comparisons (`not a > b` is `not (a > b)`) |\n| `==` `!=` | `=` `!=` (`==` and `<>` accepted) | |\n| `na(x)` | `status(x) != present` | five statuses instead of one `na` |\n| `nz(x, 0)` | — | deliberately absent; missing is never zero |\n| `ta.percentile_nearest_rank(S, n, p)` | `percentile(S, n, p)` | and `percentile(S, n, p, linear)` for interpolation |\n| `math.abs(x)` | `abs(x)` | element-wise over a series |\n| `math.sum(S, n)` | `rolling_sum(S, n)` | |\n| a script per symbol, switched by hand | `where base = BTC`, `where venue = KRAKEN-FUTURES`, `where symbol = \"BTCUSDT\"` | selection is part of the query |\n| `input`, `var`, `:=`, `if`, `for`, `plot`, `strategy.*`, `alertcondition` | — | not a scripting language |\n| one symbol per script | `any(venues where ...)`, `all(...)`, `count(...)`, `max(venues, ...)` | every venue value needs a venue scope |\n\nNumbers will not match TradingView exactly. TradingView's EMA depends on how much chart history\nis loaded; DQL's uses a fixed window so that anyone can recompute it from public candles.\n\n## 8. Coming from SQL\n\nThink of a table with one row per (instrument, venue). A DQL condition is a `WHERE` clause over\nthat table, grouped by instrument.\n\n| In SQL you write | In DQL you write | Note |\n|---|---|---|\n| `WHERE funding > 0` | `any(venues where funding > 0)` | the group-by is built in; say which rows |\n| `HAVING COUNT(*) FILTER (WHERE funding > 0) >= 3` | `count(venues where funding > 0) >= 3` | |\n| `HAVING MAX(mark) - MIN(mark) > 5` | `max(venues, mark) - min(venues, mark) > 5` | |\n| `MAX(mark) FILTER (WHERE quote = 'USDT')` | `max(venues where quote = USDT, mark)` | codes are unquoted, uppercase |\n| `venue IN ('KRAKEN-FUTURES', 'BYBIT-PERP')` | `venue in (KRAKEN-FUTURES, BYBIT-PERP)` | |\n| `funding IS NULL` | `status(funding) != present` | and the status tells you *why* |\n| `NULL` semantics in `AND`/`OR`/`NOT` | identical | three-valued logic |\n| `AVG(mark)` | — | deliberately absent: venues are never averaged |\n| `SUM(oi)` | `sum(venues, oi)` | only additive quantities can be summed |\n| `AS OF SYSTEM TIME '...'` | `as of 2026-09-21T08:00:00Z` | visibility by `received_at`, not by venue timestamp |\n| `ORDER BY x DESC LIMIT 50` | `order by x desc` in the query, `\"limit\": 50` in the request | |\n| `WHERE base = 'BTC'` (choosing rows before aggregating) | the `where` **clause**: `… where base = BTC` | selection and condition are separate; the clause runs first |\n| `SELECT a, b, c` | `select max(venues, funding_8h), min(venues, spread)` | chooses what comes back, not what is compared |\n| `ORDER BY a DESC, b ASC` | `order by max(venues, funding_8h) desc, min(venues, spread) asc` | several keys, C1-06 |\n| `WHERE symbol = 'BTCUSDT'` | `where symbol = \"BTCUSDT\"` | the venue's own symbol is a quoted string, not a code |\n| `SUM(oi)` across venues with mixed contract sizes | `sum(venues, oi)` with `units: base` | refused under `units: published`, because contracts do not add up |\n| `LIKE`, joins, subqueries, `CASE` | — | not in the language |\n\nKeywords are lowercase (`and`, not `AND`); uppercase words are venue, currency and asset codes.\n\n---\n\n## 9. What DQL deliberately does not do\n\n- **It does not express actions or opinions.** There is no `buy`, `sell`, `long`, `short`,\n  `signal`, `entry`, `exit`, `strength` or `confidence` anywhere in the language, and there will\n  not be. `ema(close, 20) > ema(close, 50)` is a statement about two numbers; what you do with it\n  is not DEBYKO's business. The alert tag is text you choose; DEBYKO stores it, sends it back, and\n  never reads it. This keeps DEBYKO a data service, and it keeps your rules yours.\n- **It does not blend venues.** No average price, no consensus price, no \"best\" price. You can\n  ask for the maximum, the minimum, the count, the sum, or any single venue.\n- **It does not fill gaps.** A missing candle is not filled in, and an indicator over it is null. If\n  you want indicators that tolerate holes, you have all the candles via `/v2/candles` and can\n  compute your own.\n- **It does not convert currencies.** A price is a number in the venue's quote currency.\n- **It does not join instruments.** `ref` reads one other listing, a few times a query; there is no \"any instrument where…\".\n- **It does not run code.** No variables, loops, user-defined functions or state. A query is one\n  condition. If you need more, the data endpoints are there.\n- **It does not let you see the future.** `as of` uses only what had been received by that\n  moment, including candles that had not yet arrived.\n\nNothing in a response is a forecast, a rating or advice. Every number is something a venue\npublished, or an arithmetic function of such numbers defined in the specification, with the\nvenue, the receipt time and the age attached.\n\n---\n\n## 10. Every function, with one example\n\nOne runnable query per function, the function's name visible in the query itself. Every line here is\nrun by `GuideExampleTests` against the conformance fixture, so an example that stops working fails\nthe build instead of sitting here misleading you.\n\nSeries functions — all need a period, from the `timeframe` clause or a trailing argument:\n\n```dql\nany(venues where close > prev(close, 1)) timeframe 15m\nany(venues where close > sma(close, 20)) timeframe 15m\nany(venues where ema(close, 20) > ema(close, 50)) timeframe 1h\nany(venues where rsi(close, 14) < 30) timeframe 1h\nany(venues where atr(14) > 100) timeframe 15m\nany(venues where stdev(close, 20) > 50) timeframe 15m\nany(venues where close >= highest(close, 50)) timeframe 15m\nany(venues where close <= lowest(close, 50)) timeframe 15m\nany(venues where change(close, 10) > 0) timeframe 15m\nany(venues where roc(close, 12) > 1%) timeframe 5m\nany(venues where crossover(close, sma(close, 3))) timeframe 15m\nany(venues where crossunder(sma(close, 3), close)) timeframe 15m\nany(venues where gaps(100) = 0) timeframe 15m\nany(venues where abs(change(close, 5)) > 100) timeframe 15m\nany(venues where rolling_sum(volume, 12) > 1000) timeframe 5m\nany(venues where close > percentile(close, 100, 95%)) timeframe 15m\nany(venues where close > percentile(close, 100, 95%, linear)) timeframe 15m\nany(venues where percentile_rank(close, 100) > 0.8) timeframe 15m\n```\n\nAnother listing — the value of an expression for another instrument on the same venue (or on the venue named), at the same instant:\n\n```dql\nany(venues where ref(BTC-PERP, mark) > 86990) where base = ETH\nany(venues where ref(BTC-PERP, mark, OKX-PERP) > ref(BTC-PERP, mark))\nref(BTC-PERP, mark, KRAKEN-FUTURES) > 86000 where base = ETH\n```\n\nData quality — these two are the reason the language exists:\n\n```dql\nany(venues where age(mark) < 5s)\nany(venues where status(funding) = stale)\n```\n\nBook depth — the bands are the platform's, from `GET /v2/dql/catalogue`:\n\n```dql\nany(venues where depth_bid(10bps) > 5)\nany(venues where depth_ask(10bps) > 5)\nany(venues where depth_bid_value(10bps) > 250000)\nany(venues where depth_ask_value(10bps) > 250000)\n```\n\nLiquidations — a total over the events of the last `n` periods, from the `timeframe` clause or a trailing\nargument; an event has no \"now\", so there is no field, only these:\n\n```dql\nany(venues where liquidation_count(4) > 0) timeframe 15m\nany(venues where liquidation_long_count(4) > 0) timeframe 15m\nany(venues where liquidation_short_count(4) > 0) timeframe 15m\nany(venues where liquidation_volume(4) > 10) timeframe 15m\nany(venues where liquidation_long_volume(4) > 10) timeframe 15m\nany(venues where liquidation_short_volume(4) > 10) timeframe 15m\nany(venues where liquidation_value(4) > 100000) timeframe 15m\nany(venues where liquidation_long_value(4) > 100000) timeframe 15m\nany(venues where liquidation_short_value(4) > 100000) timeframe 15m\nany(venues where liquidation_value(24, 1h) > 1000000)\n```\n\n## 11. Every field, with one example\n\nThe instrument, and the two counts that say how many venues answered:\n\n```dql\nvenues_answered >= 2 where instrument = BTC-PERP\nvenues_answered >= 2 where base = BTC\nvenues_listed >= 3\nvenues_answered < venues_listed\n```\n\nThe listing — what a venue calls it and what its contract rules are:\n\n```dql\nany(venues where venue = KRAKEN-FUTURES and mark > 0)\nany(venues where quote = USDT and mark > 0)\nvenues_answered >= 1 where symbol = \"BTCUSDT\"\nany(venues where tick_size <= 0.1)\nany(venues where lot_size <= 0.001)\nany(venues where min_qty <= 0.001)\n```\n\nWhat the venue publishes, layer by layer:\n\n```dql\nany(venues where last > 0)\nmax(venues, mark) - min(venues, mark) > 5bps\nany(venues where index > 0)\nany(venues where basis > 10bps)\nany(venues where funding > 0)\nany(venues where funding_interval = 8h)\nany(venues where funding_8h > 1bps)\nany(venues where time_to_funding < 30m)\nsum(venues, oi) > 10000\nany(venues where ask - bid > 0)\nany(venues where mid > 0)\nall(venues where status(bid) = not_published or spread < 5bps)\nany(venues where bid_size > 1 and ask_size > 1)\nany(venues where volume_24h > 10000)\nany(venues where turnover_24h > 100000000)\nany(venues where change_24h < -1%)\n```\n\nCandles. Trade candles are `open high low close volume`; the venue's mark and index candles carry the\nsame five names with a prefix. A venue that publishes no mark candle answers `not_published` for every\n`mark_*` source rather than repeating its trade candle:\n\n```dql\nany(venues where high - low > 0 and close > open) timeframe 1h\nany(venues where volume > 0) timeframe 1h\nany(venues where mark_high - mark_low > 0 and mark_close > mark_open) timeframe 1h\nany(venues where mark_volume >= 0) timeframe 1h\nany(venues where index_high - index_low > 0 and index_close > index_open) timeframe 1h\nany(venues where index_volume >= 0) timeframe 1h\n```\n\n\n# The endpoints\n\nSeventeen endpoints. Five need no key.\n\n| endpoint | key | what it answers |\n| --- | --- | --- |\n| [`GET /v2/venues`](#getv2venues) | — | Every venue in DQL, with how many listings it has and how many of them the platform collects. |\n| [`GET /v2/instruments`](#getv2instruments) | — | Every selected listing: how its venue names it, the rules it trades under, and what is collected for it. |\n| [`GET /v2/dql/catalogue`](#getv2dqlcatalogue) | — | Every field, source, function, code and limit a query may use. |\n| [`POST /v2/dql/parse`](#postv2dqlparse) | — | A query checked but not run: what it means, what it reads, what it costs. |\n| [`GET /v2/plans`](#getv2plans) | — | Every self-serve plan and its limits, in the order of the Compare-plans table. |\n| [`POST /v2/screen`](#postv2screen) | yes | Run a DQL query across venues and return what matched. |\n| [`POST /v2/snapshots`](#postv2snapshots) | yes | The latest reading of each layer for the selected listings. |\n| [`POST /v2/snapshots/history`](#postv2snapshotshistory) | yes | The same snapshot as it stood in the past: one row per period, per named instant, or per message as it arrived. |\n| [`POST /v2/candles`](#postv2candles) | yes | Completed candles, in any stored period and price type. |\n| [`POST /v2/liquidations`](#postv2liquidations) | yes | Liquidations, one by one, in a window of up to a week. |\n| [`GET /v2/funding/settlements`](#getv2fundingsettlements) | yes | Funding settlement prints, one row per print of a listing: the rate as published, the interval in force, the origin, the cap and floor. |\n| [`POST /v2/books`](#postv2books) | yes | Order books to the depth the plan allows, with the depth resting in each band around the mid. |\n| [`GET /v2/account`](#getv2account) | yes | What this key sees and what is left of it today: the plan, the platform's venues, layers and limits, and today's counters. |\n| [`GET /v2/agent/state`](#getv2agentstate) | yes | The state of the account's Agent rules, polled: true, false or unknown, and what this key was told last time. |\n| [`GET /v2/agent/result`](#getv2agentresult) | yes | A persisted live candle decision for one rule, instrument and UTC candle close. |\n| [`GET /v2/archive`](#getv2archive) | yes | The files of the archive for one listing: the day, the rows, the size, the sha256, how many gaps the day has, and where to fetch it. |\n| [`GET /v2/archive/{listing}/{layer}/{day}`](#getv2archivelistinglayerday) | yes | One file of the archive, as a `302` to a link that works for fifteen minutes. |\n| [`GET /v2/stream`](#getv2stream) | yes | A live stream of the selected listings, as server-sent events. |\n\nEvery one of them refuses in the same shape — a list of errors with a stable `code` — and every one of\nthem takes the same selection grammar in `where`. The full schemas are in\n[the reference](#reference); what follows is the shape of each in prose.\n\n## Receipts and replay\n\nEvery answer that carries data has `served_at` (UTC, its own as-of instant, the same as `evaluated_at`) and `receipt_id` (opaque, new for every\nanswer and every stream event). Log them next to the decision you made from the answer. What a receipt lets you\nreplay, and where that stops:\n\n> The live answer is the freshest we have seen; history is what we stored. The live answer can be one reading\n> ahead of history, until that reading's sampling window closes (`history_cadence` on `/v2/instruments`); in time\n> the two readings can be further apart than one window where the venue updates less often than that.\n\nA live answer (`snapshots`, `screen` without `as of`, `stream`) shows the newest reading received by `served_at`;\nits `received_at` and `age_ms` say how fresh it is. History keeps, for each layer, the last reading of every\nsampling window, and a stored reading counts from the end of its window — before that a later reading of the same\nwindow could still replace it. So a replay with `as_of = served_at` returns exactly what had been recorded as of\nthat instant — every reading visible then, with its `received_at` and its status — and returns the same every\ntime you ask. It is the tool for a post-mortem, not a copy of the live answer: a live answer may show a reading of\nthe window still open at `served_at`, which history did not have then. Once that window has ended, the two agree\nfield for field. To keep exactly what your code read, log the response itself — `receipt_id` and the values.\nOrdering between venues or layers is fixed by `received_at`, never by arrival order at the client.\n\nHow long the window is, is `history_cadence` per layer on `/v2/instruments`: `1s`, `10s`, `15s` or `1m` — by the\nlisting's group and the layer, the table is on the Freshness page (\"How often history keeps a value\"); funding is\nkept one reading per ten seconds at the shortest, so it says `10s` where the window would be a second. `null` for\na layer history keeps whole or does not keep (`candles`, `trades`; a layer off by policy shows `policy: \"off\"`).\nEvery stored row carries the window it was sampled at, and the live answers are the newest tick whatever this says.\n\nAsk a snapshot's past with `POST /v2/snapshots/history` and `at: [served_at]` (with `at`, `from` and `to` are\nrefused: the instants are the rows) — each row is the recorded layer in a snapshot's words, `status`, `reason`,\n`age_ms` and all, a layer not published `not_published` and one off by policy `off` in both — a screen's with\n`as of` (an instant to the millisecond: the first three fractional digits of `served_at`), instruments with\n`?as_of=`. Order books are not replayable: levels are never stored, and stream events are ticks, not replayed one\nby one. The replay is final once `settled: true`. A query that names its\nown `as of` is replayed by it. A value stamped after `served_at` — by a collector whose clock runs ahead, say — is\nnever shown in the answer and never in its replay. Collectors and the API run on one host and one clock today.\n\n## Freshness: a value says how long it is good for\n\nEvery value of a snapshot layer carries `valid_until`, `horizon_source` and `anchor`, its age `age_ms` — from the\nvenue's own timestamp where the venue dates the value (`anchor: venue`), from our receipt otherwise — and\n`venue_age_ms` by the venue's clock. Past `valid_until` a layer is `stale`, with a reason, and its value is\n**not** in the answer: `values` is empty, and the value is written under `withheld` only when the request sets\n`allow_stale: true` (default false). A replay with `as_of = served_at` withholds exactly what the answer\nwithheld, for the same reason. What each horizon rests on, pair by pair, and which pairs rest on an assumed\ncadence: [Freshness and cadence](#freshness-and-cadence).\n\n## GET /v2/venues\n\nEvery venue in DQL, with how many listings it has and how many of them the platform collects.\n\nRead it before anything else: a venue that is not here cannot be named in a query, and the gap between `listings` and `listings_collected` is the coverage you actually have.\n\n**No key.** What exists is not a paid fact.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `registry_revision` | string | Stable registry snapshot identity shared by all pages: the UTC Snapshot.ReadAt timestamp, a dot, and the lowercase SHA-256 digest of the effective registry row, … |\n| `next_cursor` | string or null | Opaque continuation cursor for the next page. Null means this is the last page. Keep all other request options unchanged; a stale cursor or changed scope … |\n| `items` | array | The venues, by public code. |\n\n### An answer\n\n```json\n{\n  \"evaluated_at\": \"2026-09-23T11:28:26.904Z\",\n  \"registry_revision\": \"2026-09-23T11:28:26.904Z.f78b77f848f073634ad0df313bd48d234f27206cf523dd6f5018575231c01eed\",\n  \"next_cursor\": null,\n  \"items\": [\n    {\n      \"venue\": \"HYPERLIQUID\",\n      \"name\": \"Hyperliquid\",\n      \"kind\": \"order_book\",\n      \"listings\": 234,\n      \"listings_collected\": 5,\n      \"since\": \"2026-09-21T12:03:13.315Z\"\n    }\n  ],\n  \"items_note\": \"1 more, cut here for length\"\n}\n```\n\n## GET /v2/instruments\n\nEvery selected listing: how its venue names it, the rules it trades under, and what is collected for it.\n\nThis is where a bot learns the exchange's own symbol for an instrument, its tick and lot size, and which layers exist for it. `?where=` takes the same selection grammar as everything else. For 90 days after a listing's instrument was renamed (`1000PEPE-PERP` became `PEPE-PERP`), `?renamed_from=1000PEPE-PERP` finds the listings that carried the old name, and each of them says so in `renamed_from`; DQL has no alias, so the old name cannot be written in `where`.\n\n**No key.** What exists is not a paid fact.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `registry_revision` | string | Stable registry snapshot identity shared by all pages: the UTC Snapshot.ReadAt timestamp, a dot, and the lowercase SHA-256 digest of the effective registry row, … |\n| `next_cursor` | string or null | Opaque continuation cursor for the next page. Null means this is the last page. Keep all other request options unchanged; a stale cursor or changed scope … |\n| `as_of` | `Instant` | The instant the answer describes: the moment of the request, or the `as_of` it asked for. |\n| `catalogue` | string | The catalogue version the answer was built against. |\n| `units` | `published`, `base` | The unit mode applied. |\n| `normalisation_version` | `NormalisationVersion` | Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store. |\n| `listings_as_of` | `NullableInstant` | When the listing set itself was last known to change. Present when asking about the past. |\n| `capabilities_as_of` | `NullableInstant` | When what each venue publishes was last known to change. |\n| `items` | array | The listings, one object each. |\n\n### An answer\n\n```json\n{\n  \"evaluated_at\": \"2026-09-23T11:28:27.118Z\",\n  \"registry_revision\": \"2026-09-23T11:28:27.118Z.bf96b16abe250df1069a531df3bbef48bf6c16a3fdfa8f266df63e26975c256c\",\n  \"next_cursor\": null,\n  \"as_of\": \"2026-09-23T11:28:27.118Z\",\n  \"catalogue\": \"2026-09-22\",\n  \"units\": \"published\",\n  \"items\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"venue\": \"HYPERLIQUID\",\n      \"venue_symbol\": \"BTC\",\n      \"base\": \"BTC\",\n      \"base_venue_alias\": null,\n      \"quote\": \"USDC\",\n      \"kind\": \"perpetual\",\n      \"venue_kind\": null,\n      \"pair\": null,\n      \"status\": \"tradeable\",\n      \"post_only\": null,\n      \"contract_size\": 1,\n      \"multiplier\": 1,\n      \"tick_size\": null,\n      \"lot_size\": null,\n      \"min_qty\": null,\n      \"min_notional\": null,\n      \"price_decimals\": null,\n      \"qty_decimals\": 5,\n      \"units\": {\n        \"tick_size\": \"quote\",\n        \"lot_size\": \"base\",\n        \"min_qty\": \"base\",\n        \"min_notional\": \"quote\"\n      },\n      \"funding_interval\": \"1h\",\n      \"funding_interval_source\": \"venue\",\n      \"funding_normalisation\": {\n        \"venue_field\": \"funding\",\n        \"transform\": \"identity\"\n      },\n      \"rules_normalisation\": {\n        \"funding_interval\": {\n          \"venue_field\": \"fundingIntervalHours\",\n          \"transform\": \"hours_to_duration\"\n        },\n        \"qty_decimals\": {\n          \"venue_field\": \"szDecimals\",\n          \"transform\": \"identity\"\n        }\n      },\n      \"candles\": {\n        \"base_timeframe\": \"1m\",\n        \"price_types\": [\n          \"trade\"\n        ],\n        \"timeframes\": [\n          \"1m\",\n          \"5m\",\n          \"15m\",\n          \"30m\",\n          \"1h\",\n          \"4h\",\n          \"12h\",\n          \"1d\"\n        ]\n      },\n      \"layers\": {\n        \"ticker\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        },\n        \"mark\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        },\n        \"funding\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        },\n        \"oi\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        },\n        \"book\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        },\n        \"stats\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        },\n        \"candles\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        },\n        \"trade\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        },\n        \"book_bands\": {\n          \"policy\": \"on\",\n          \"cadence\": \"live\"\n        }\n      },\n      \"not_published\": [\n        \"change_24h\",\n        \"index_close\",\n        \"index_high\",\n        \"index_low\",\n        \"index_open\",\n        \"index_volume\",\n        \"mark_close\",\n        \"mark_high\",\n        \"mark_low\",\n        \"mark_open\",\n        \"mark_volume\"\n      ],\n      \"bands\": [\n        \"10bps\",\n        \"25bps\",\n        \"50bps\",\n        \"100bps\"\n      ],\n      \"listed_at\": null,\n      \"first_seen_at\": \"2026-09-21T20:05:09.829Z\",\n      \"delisted_at\": null,\n      \"venue_ts\": null,\n      \"received_at\": \"2026-09-23T11:20:39.343Z\",\n      \"age_ms\": 467774\n    }\n  ],\n  \"items_note\": \"1 more, cut here for length\"\n}\n```\n\n## GET /v2/dql/catalogue\n\nEvery field, source, function, code and limit a query may use.\n\nRead this rather than hard-coding a list. It is generated from the registry and the policy the collectors run on, so it changes the moment the platform does.\n\n**No key.** What exists is not a paid fact.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `dql` | string | The language version this catalogue describes. |\n| `catalogue` | string | A version that changes whenever the catalogue's content does. Cache against it. |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `fields` | array | Every field. |\n| `sources` | array | Every candle source. |\n| `functions` | array | Every function. |\n| `venues` | array | Every venue code a query may name. |\n| `currencies` | array | Every quote currency. DQL never converts between them. |\n| `assets` | array | Every base asset. |\n| `instruments` | array | Every instrument code. |\n| `timeframes` | array | Every period a series may be read at. |\n| `bands` | array | Every price band the depth functions accept. |\n| `freshness_defaults` | object | The default freshness bound per layer. A reading older than its bound is stale and compares as unknown. |\n| `limits` | `CatalogueLimits` |  |\n| `settle_after` | integer | Seconds after which an instant is settled: late arrivals can no longer change an answer about it. |\n| `earliest_retained` | `NullableInstant` | The earliest instant any query may ask about. |\n| `units` | array | The unit modes a request may ask for. |\n| `number_formats` | array | The number formats a request may ask for. |\n\n### An answer\n\n```json\n{\n  \"dql\": \"1\",\n  \"catalogue\": \"2026-09-22\",\n  \"evaluated_at\": \"2026-09-23T11:28:26.994Z\",\n  \"fields\": [\n    {\n      \"name\": \"instrument\",\n      \"type\": \"code\",\n      \"scope\": \"instrument\",\n      \"layer\": \"reference\",\n      \"unit\": \"code\",\n      \"description\": \"the market code, e.g. BTC-PERP\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"base\",\n      \"type\": \"code\",\n      \"scope\": \"instrument\",\n      \"layer\": \"reference\",\n      \"unit\": \"code\",\n      \"description\": \"the base asset\\u0027s registry code, e.g. BTC\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"venues_listed\",\n      \"type\": \"number\",\n      \"scope\": \"instrument\",\n      \"layer\": \"reference\",\n      \"unit\": \"count\",\n      \"description\": \"number of (selected) listings at T\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"venues_answered\",\n      \"type\": \"number\",\n      \"scope\": \"instrument\",\n      \"layer\": \"reference\",\n      \"unit\": \"count\",\n      \"description\": \"number of (selected) listings whose mark is present at T\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"venue\",\n      \"type\": \"code\",\n      \"scope\": \"venue\",\n      \"layer\": \"reference\",\n      \"unit\": \"code\",\n      \"description\": \"the venue\\u0027s public code\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"quote\",\n      \"type\": \"code\",\n      \"scope\": \"venue\",\n      \"layer\": \"reference\",\n      \"unit\": \"code\",\n      \"description\": \"the listing\\u0027s quote currency\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"tick_size\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"reference\",\n      \"unit\": \"quote\",\n      \"description\": \"minimum price increment of the listing\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"lot_size\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"reference\",\n      \"unit\": \"quantity\",\n      \"description\": \"minimum quantity increment\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"min_qty\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"reference\",\n      \"unit\": \"quantity\",\n      \"description\": \"minimum order quantity\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"last\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"ticker\",\n      \"unit\": \"quote\",\n      \"description\": \"last trade price\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"mark\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"mark\",\n      \"unit\": \"quote\",\n      \"description\": \"venue mark price\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"index\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"mark\",\n      \"unit\": \"quote\",\n      \"description\": \"venue index price\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"basis\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"mark\",\n      \"unit\": \"fraction\",\n      \"description\": \"(mark \\u2212 index) / index\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"funding\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"funding\",\n      \"unit\": \"fraction\",\n      \"description\": \"published rate for the next settlement, per interval\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"funding_interval\",\n      \"type\": \"duration\",\n      \"scope\": \"venue\",\n      \"layer\": \"funding\",\n      \"unit\": \"ms\",\n      \"description\": \"settlement interval as published\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": [\n        \"KRAKEN-FUTURES\"\n      ]\n    },\n    {\n      \"name\": \"funding_8h\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"funding\",\n      \"unit\": \"fraction\",\n      \"description\": \"funding \\u00D7 8h / funding_interval\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": [\n        \"KRAKEN-FUTURES\"\n      ]\n    },\n    {\n      \"name\": \"time_to_funding\",\n      \"type\": \"duration\",\n      \"scope\": \"venue\",\n      \"layer\": \"funding\",\n      \"unit\": \"ms\",\n      \"description\": \"next_funding_at \\u2212 T\",\n      \"sampleable\": false,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"oi\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"oi\",\n      \"unit\": \"quantity\",\n      \"description\": \"open interest\",\n      \"sampleable\": true,\n      \"additive\": true,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"bid\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quote\",\n      \"description\": \"best bid price\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"ask\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quote\",\n      \"description\": \"best ask price\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"mid\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quote\",\n      \"description\": \"(bid \\u002B ask) / 2\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"spread\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"fraction\",\n      \"description\": \"(ask \\u2212 bid) / mid\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"bid_size\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quantity\",\n      \"description\": \"resting quantity at the best bid\",\n      \"sampleable\": true,\n      \"additive\": true,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"ask_size\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quantity\",\n      \"description\": \"resting quantity at the best ask\",\n      \"sampleable\": true,\n      \"additive\": true,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"volume_24h\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"stats\",\n      \"unit\": \"quantity\",\n      \"description\": \"rolling 24h traded volume as published\",\n      \"sampleable\": true,\n      \"additive\": true,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"turnover_24h\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"stats\",\n      \"unit\": \"quote\",\n      \"description\": \"rolling 24h traded value as published\",\n      \"sampleable\": true,\n      \"additive\": true,\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"change_24h\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"stats\",\n      \"unit\": \"fraction\",\n      \"description\": \"24h price change as published\",\n      \"sampleable\": true,\n      \"additive\": false,\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    }\n  ],\n  \"sources\": [\n    {\n      \"name\": \"open\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"trade\",\n      \"unit\": \"quote\",\n      \"description\": \"trade candle open\",\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"high\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"trade\",\n      \"unit\": \"quote\",\n      \"description\": \"trade candle high\",\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"low\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"trade\",\n      \"unit\": \"quote\",\n      \"description\": \"trade candle low\",\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"close\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"trade\",\n      \"unit\": \"quote\",\n      \"description\": \"trade candle close\",\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"volume\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"trade\",\n      \"unit\": \"quantity\",\n      \"description\": \"trade candle volume\",\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"mark_open\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"mark\",\n      \"unit\": \"quote\",\n      \"description\": \"mark-price candle open\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"mark_high\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"mark\",\n      \"unit\": \"quote\",\n      \"description\": \"mark-price candle high\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"mark_low\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"mark\",\n      \"unit\": \"quote\",\n      \"description\": \"mark-price candle low\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"mark_close\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"mark\",\n      \"unit\": \"quote\",\n      \"description\": \"mark-price candle close\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"mark_volume\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"mark\",\n      \"unit\": \"quantity\",\n      \"description\": \"mark-price candle volume as published\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"index_open\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"index\",\n      \"unit\": \"quote\",\n      \"description\": \"index-price candle open\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"index_high\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"index\",\n      \"unit\": \"quote\",\n      \"description\": \"index-price candle high\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"index_low\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"index\",\n      \"unit\": \"quote\",\n      \"description\": \"index-price candle low\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"index_close\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"index\",\n      \"unit\": \"quote\",\n      \"description\": \"index-price candle close\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    },\n    {\n      \"name\": \"index_volume\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"price_type\": \"index\",\n      \"unit\": \"quantity\",\n      \"description\": \"index-price candle volume as published\",\n      \"not_published_on\": [\n        \"HYPERLIQUID\"\n      ]\n    }\n  ],\n  \"functions\": [\n    {\n      \"name\": \"prev\",\n      \"signature\": \"prev(S, k)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"S[k]\"\n    },\n    {\n      \"name\": \"sma\",\n      \"signature\": \"sma(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"simple moving average\"\n    },\n    {\n      \"name\": \"ema\",\n      \"signature\": \"ema(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"exponential moving average over a fixed 4n window\"\n    },\n    {\n      \"name\": \"rsi\",\n      \"signature\": \"rsi(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"relative strength index, Wilder smoothing over 4n\"\n    },\n    {\n      \"name\": \"atr\",\n      \"signature\": \"atr(n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"average true range of the trade candles\"\n    },\n    {\n      \"name\": \"stdev\",\n      \"signature\": \"stdev(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"population standard deviation\"\n    },\n    {\n      \"name\": \"highest\",\n      \"signature\": \"highest(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"max(S[0] \\u2026 S[n\\u22121])\"\n    },\n    {\n      \"name\": \"lowest\",\n      \"signature\": \"lowest(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"min(S[0] \\u2026 S[n\\u22121])\"\n    },\n    {\n      \"name\": \"change\",\n      \"signature\": \"change(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"S[0] \\u2212 S[n]\"\n    },\n    {\n      \"name\": \"roc\",\n      \"signature\": \"roc(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"(S[0] \\u2212 S[n]) / S[n]\"\n    },\n    {\n      \"name\": \"crossover\",\n      \"signature\": \"crossover(A, B)\",\n      \"type\": \"boolean\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"A[0] \\u003E B[0] and A[1] \\u2264 B[1]\"\n    },\n    {\n      \"name\": \"crossunder\",\n      \"signature\": \"crossunder(A, B)\",\n      \"type\": \"boolean\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"A[0] \\u003C B[0] and A[1] \\u2265 B[1]\"\n    },\n    {\n      \"name\": \"gaps\",\n      \"signature\": \"gaps(n)\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"missing periods among the last n\"\n    },\n    {\n      \"name\": \"abs\",\n      \"signature\": \"abs(x)\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"\",\n      \"unit\": \"none\",\n      \"description\": \"|x|, element-wise for series\"\n    },\n    {\n      \"name\": \"rolling_sum\",\n      \"signature\": \"rolling_sum(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"S[n\\u22121] \\u002B \\u2026 \\u002B S[0]\"\n    },\n    {\n      \"name\": \"percentile\",\n      \"signature\": \"percentile(S, n, p, [method])\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"nearest-rank (default) or linear percentile of S[0] \\u2026 S[n\\u22121]\"\n    },\n    {\n      \"name\": \"percentile_rank\",\n      \"signature\": \"percentile_rank(S, n)\",\n      \"type\": \"series\",\n      \"scope\": \"venue\",\n      \"layer\": \"candles\",\n      \"unit\": \"none\",\n      \"description\": \"share of S[0] \\u2026 S[n\\u22121] that are \\u2264 S[0]\"\n    },\n    {\n      \"name\": \"age\",\n      \"signature\": \"age(F)\",\n      \"type\": \"duration\",\n      \"scope\": \"venue\",\n      \"layer\": \"\",\n      \"unit\": \"none\",\n      \"description\": \"T \\u2212 received_at of the value used for F\"\n    },\n    {\n      \"name\": \"status\",\n      \"signature\": \"status(F)\",\n      \"type\": \"status\",\n      \"scope\": \"venue\",\n      \"layer\": \"\",\n      \"unit\": \"none\",\n      \"description\": \"state of F\\u0027s layer at T\"\n    },\n    {\n      \"name\": \"depth_bid\",\n      \"signature\": \"depth_bid(band)\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quantity\",\n      \"description\": \"bid quantity within band of mid\",\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"depth_ask\",\n      \"signature\": \"depth_ask(band)\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quantity\",\n      \"description\": \"ask quantity within band of mid\",\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"depth_bid_value\",\n      \"signature\": \"depth_bid_value(band)\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quote\",\n      \"description\": \"bid value (price \\u00D7 size) within band of mid\",\n      \"not_published_on\": []\n    },\n    {\n      \"name\": \"depth_ask_value\",\n      \"signature\": \"depth_ask_value(band)\",\n      \"type\": \"number\",\n      \"scope\": \"venue\",\n      \"layer\": \"book\",\n      \"unit\": \"quote\",\n      \"description\": \"ask value (price \\u00D7 size) within band of mid\",\n      \"not_published_on\": []\n    }\n  ],\n  \"venues\": [\n    \"HYPERLIQUID\",\n    \"KRAKEN-FUTURES\"\n  ],\n  \"currencies\": [\n    \"USD\",\n    \"USDC\"\n  ],\n  \"assets\": [\n    \"\",\n    \"BTC\",\n    \"CYPH\",\n    \"DOGE\",\n    \"ETH\",\n    \"GTLB\",\n    \"KSTR\",\n    \"MSTU\",\n    \"OURA\",\n    \"SOL\",\n    \"XRP\"\n  ],\n  \"instruments\": [\n    \"-PERP\"\n  ],\n  \"timeframes\": [\n    \"1m\",\n    \"5m\",\n    \"15m\",\n    \"30m\",\n    \"1h\",\n    \"4h\",\n    \"12h\",\n    \"1d\"\n  ],\n  \"bands\": [\n    \"10bps\",\n    \"25bps\",\n    \"50bps\",\n    \"100bps\"\n  ],\n  \"freshness_defaults\": {\n    \"ticker\": \"30s\",\n    \"mark\": \"30s\",\n    \"funding\": \"300s\",\n    \"oi\": \"30s\",\n    \"book\": \"30s\",\n    \"stats\": \"120s\"\n  },\n  \"limits\": {\n    \"source_bytes\": 8192,\n    \"nodes\": 256,\n    \"depth\": 24,\n    \"quantifiers_and_aggregates\": 16,\n    \"series_calls\": 32,\n    \"timeframes\": 3,\n    \"window\": 500,\n    \"bars_per_atom\": 2000,\n    \"cost\": 10000,\n    \"in_list\": 32,\n    \"select\": 16,\n    \"order_by\": 4,\n    \"freshness_min\": \"1s\",\n    \"freshness_max\": \"604800s\",\n    \"screen_limit\": 500,\n    \"endpoints\": {\n      \"snapshots_listings\": 500,\n      \"history_listings\": 100,\n      \"history_rows_per_layer\": 2000,\n      \"history_raw_rows\": 100000,\n      \"candles_listings\": 100,\n      \"candles_per_listing\": 1500,\n      \"books_listings\": 100,\n      \"book_depth\": 25,\n      \"stream_listings\": 500,\n      \"response_bytes\": 8388608\n    }\n  },\n  \"settle_after\": 120,\n  \"earliest_retained\": \"2026-09-14T00:00:00Z\",\n  \"units\": [\n    \"published\",\n    \"base\"\n  ],\n  \"number_formats\": [\n    \"json\",\n    \"string\"\n  ],\n  \"instruments_note\": \"10 more, cut here for length\"\n}\n```\n\n## POST /v2/dql/parse\n\nA query checked but not run: what it means, what it reads, what it costs.\n\nIt touches no market data and needs no key, which makes it the right thing for an editor to call on every keystroke — and the right way to see a query's cost before spending it.\n\n**No key.** What exists is not a paid fact.\n\n### What it takes\n\n| field | type | required | meaning |\n| --- | --- | --- | --- |\n| `query` | string or object | yes | The query, as text or as the machine form of specification §3.1. |\n| `dql` | string | — | The language version. Only `1` exists. |\n| `context` | string | — | What the query is for. Only `screen` exists. |\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `dql` | string | The language version. |\n| `query` | object | The query in both forms, canonical. |\n| `atoms` | object | What the query reads, by scope. Useful for showing a reader which data a query depends on. |\n| `timeframes` | array | Every period the query reads. |\n| `complexity` | object | What the query costs, against the catalogue's limits. |\n\n### An answer\n\n```json\n{\n  \"query\": \"any(venues where funding \\u003E 0)\"\n}\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"query\": {\n    \"string\": \"any(venues where funding \\u003E 0)\",\n    \"json\": {\n      \"dql\": \"1\",\n      \"condition\": {\n        \"type\": \"any\",\n        \"where\": {\n          \"type\": \"cmp\",\n          \"op\": \"\\u003E\",\n          \"left\": {\n            \"type\": \"field\",\n            \"name\": \"funding\"\n          },\n          \"right\": {\n            \"type\": \"number\",\n            \"value\": 0\n          }\n        }\n      }\n    }\n  },\n  \"atoms\": {\n    \"instrument\": [],\n    \"venue\": [\n      \"funding\"\n    ]\n  },\n  \"timeframes\": [],\n  \"complexity\": {\n    \"nodes\": 4,\n    \"bars\": 0,\n    \"cost\": 4\n  }\n}\n```\n\n## GET /v2/plans\n\nEvery self-serve plan and its limits, in the order of the Compare-plans table.\n\nThe plan table itself, so a client compares plans by the numbers the platform enforces rather than by a copy of the pricing page. A null limit is no limit: every venue, every instrument, no cap on how far back the plan reads; `agent: null` is a plan without Agent. A plan changed in the table shows here within a minute.\n\n**No key.** What exists is not a paid fact.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `items` | array | The plans, in the order of the table. |\n\n## POST /v2/screen\n\nRun a DQL query across venues and return what matched.\n\nThe endpoint the language exists for. Everything else on this page is a projection of it.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it takes\n\n| field | type | required | meaning |\n| --- | --- | --- | --- |\n| `query` | string | — | The query in DQL. |\n| `query_object` | object | — | The same query in the machine form of specification §3.1. |\n| `limit` | integer | — | How many instruments to return in one page. The catalogue states the ceiling your plan allows. |\n| `cursor` | string | — | A cursor from a previous answer's `page.next_cursor`. It pins the instant, so page two sees the world page one saw. |\n| `include_unknown` | boolean | — | Also return the instruments the data could not decide, with `result: unknown`, instead of dropping them. Ask for this whenever coverage matters. |\n| `include_atoms` | boolean | — | Also return, for every value the platform computed, the values it was computed from — each with its own venue, receipt time, age and status. `derived: true` … |\n| `units` | `published`, `base` | — | What quantities are expressed in. `published` leaves each venue's own unit alone; `base` converts to the base asset, and gives null with `unit_unknown` where a … |\n| `number_format` | `json`, `string` | — | `string` returns every number as a string with the same digits, for a client whose JSON parser would round them. |\n| `allow_stale` | boolean | — | ADR-025: return a stale value under `withheld` — never in the value field. Off by default: a stale value is not in the answer at all, only its status, reason … |\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `dql` | string | The query in canonical form — what the platform understood, which may differ in spacing and clause order from what was sent. |\n| `query` | object | The query echoed in both forms, so a client that sent text can keep the machine form and a client that sent the machine form can show the text. |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `as_of` | `NullableInstant` |  |\n| `settled` | boolean | Whether the instant is far enough in the past that late arrivals can no longer change the answer. A false here means the same query may answer differently in … |\n| `timeframe` | string | The period the query's series were read at, when it asked for one. |\n| `normalisation_version` | `NormalisationVersion` | Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store. |\n| `freshness` | object | ADR-025: the query's own `freshness` bound per layer, or null where it sets none — every value then has only its own horizon (`valid_until`). The bound only … |\n| `listings_as_of` | `NullableInstant` | When the set of listings was last known to change. Present when asking about the past. |\n| `capabilities_as_of` | `NullableInstant` | When what each venue publishes was last known to change. |\n| `instruments` | array | The instruments that matched, each with the venues it was read on. With `include_unknown`, also those the data could not decide. |\n| `page` | `Page` | The page that was returned and the cursor for the next. |\n\n### An answer\n\n```json\n{\n  \"query\": \"any(venues where funding \\u003E 0)\",\n  \"limit\": 2\n}\n```\n\n```json\n{\n  \"dql\": \"1\",\n  \"query\": {\n    \"string\": \"any(venues where funding \\u003E 0)\",\n    \"json\": {\n      \"dql\": \"1\",\n      \"condition\": {\n        \"type\": \"any\",\n        \"where\": {\n          \"type\": \"cmp\",\n          \"op\": \"\\u003E\",\n          \"left\": {\n            \"type\": \"field\",\n            \"name\": \"funding\"\n          },\n          \"right\": {\n            \"type\": \"number\",\n            \"value\": 0\n          }\n        }\n      }\n    }\n  },\n  \"evaluated_at\": \"2026-09-23T12:00:05Z\",\n  \"as_of\": null,\n  \"settled\": false,\n  \"normalisation_version\": \"2026-10-12\",\n  \"freshness\": {\n    \"ticker\": null,\n    \"mark\": null,\n    \"oi\": null,\n    \"book\": null,\n    \"stats\": null,\n    \"funding\": null\n  },\n  \"instruments\": [\n    {\n      \"instrument\": \"BTC-PERP\",\n      \"result\": \"true\",\n      \"values\": {},\n      \"scopes\": {\n        \"any(venues where funding \\u003E 0)\": {\n          \"venues_listed\": 4,\n          \"venues_in_scope\": 4,\n          \"excluded\": []\n        }\n      },\n      \"venues\": [\n        {\n          \"venue\": \"BYBIT-PERP\",\n          \"symbol\": \"BTCUSDT\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": null,\n              \"unit\": \"fraction\",\n              \"venue\": \"BYBIT-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T11:52:00Z\",\n              \"age_ms\": 485000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T11:57:00Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"stale\",\n              \"reason\": \"horizon_passed\"\n            }\n          }\n        },\n        {\n          \"venue\": \"HYPERLIQUID\",\n          \"symbol\": \"BTC\",\n          \"quote\": \"USDC\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000013,\n              \"unit\": \"fraction\",\n              \"venue\": \"HYPERLIQUID\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"KRAKEN-FUTURES\",\n          \"symbol\": \"PF_XBTUSD\",\n          \"quote\": \"USD\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.00001,\n              \"unit\": \"fraction\",\n              \"venue\": \"KRAKEN-FUTURES\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        },\n        {\n          \"venue\": \"OKX-PERP\",\n          \"symbol\": \"BTC-USDT-SWAP\",\n          \"quote\": \"USDT\",\n          \"values\": {\n            \"funding\": {\n              \"value\": 0.000054,\n              \"unit\": \"fraction\",\n              \"venue\": \"OKX-PERP\",\n              \"layer\": \"funding\",\n              \"venue_ts\": null,\n              \"received_at\": \"2026-09-23T12:00:04Z\",\n              \"age_ms\": 1000,\n              \"venue_age_ms\": null,\n              \"valid_until\": \"2026-09-23T12:05:04Z\",\n              \"horizon_source\": \"assumed\",\n              \"anchor\": \"receipt\",\n              \"status\": \"present\"\n            }\n          }\n        }\n      ]\n    }\n  ],\n  \"page\": {\n    \"limit\": 2,\n    \"returned\": 2,\n    \"next_cursor\": \"eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkVUSC1QRVJQIiwicSI6IjExZDhjM2VmZWNkZGNjNTYifQ\"\n  },\n  \"instruments_note\": \"1 more, cut here for length\"\n}\n```\n\n## POST /v2/snapshots\n\nThe latest reading of each layer for the selected listings.\n\nWhen you want the state of things rather than an answer to a question. It also returns the instrument-venue pairs you asked for that do not exist, rather than leaving you to infer them from a short answer.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it takes\n\n| field | type | required | meaning |\n| --- | --- | --- | --- |\n| `where` | `Selection` | — |  |\n| `kind` | `perpetual`, `spot`, `all` | — | Market kind to select. Defaults to perpetual, preserving the prior V2 selection. `all` includes spot and perpetual listings. |\n| `units` | `published`, `base` | — | What quantities are expressed in. |\n| `number_format` | `json`, `string` | — | `string` returns every number as a string with the same digits. |\n| `include_synthetic` | boolean | — | Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra. |\n| `layers` | array | — | Which layers to read. Every layer when omitted. |\n| `include_raw` | boolean | — | Also return each layer's message as the venue sent it. |\n| `allow_stale` | boolean | — | ADR-025: return a stale value under `withheld` — never in the value field. Off by default: a stale value is not in the answer at all, only its status, reason … |\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `units` | `published`, `base` | The unit mode applied. |\n| `normalisation_version` | `NormalisationVersion` | Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store. |\n| `freshness` | object | ADR-025: the request's own bound per layer, or null where none was set — every value has its own horizon (`valid_until`) either way, and a bound only tightens … |\n| `items` | array | One object per listing. |\n| `missing` | array | The instrument-venue pairs that do not exist. |\n\n## POST /v2/snapshots/history\n\nThe same snapshot as it stood in the past: one row per period, per named instant, or per message as it arrived.\n\nThree different questions, and the endpoint makes you say which. `raw` is every row as received — the thing to use when you are checking the platform rather than the market. `interval` and `raw` take `from` and `to`; `at` takes only the instants, and refuses both. A `raw` layer lists under `gaps` what the range missed (a hole the platform recorded, with its cause, or the time before `retention_from`); `interval` shows the same holes as gap rows. `summary: true` with `interval` answers a layer with its min, max, first and last per field and the number of readings instead of the rows, a few hundred characters per listing instead of a series; its extremes are the highest and lowest value observed at the interval's samples, not a settled amount. An `at` row is what history had recorded as of the instant, in a snapshot's words; a live answer can be one reading newer, until that reading's window closes (see Receipts and replay).\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it takes\n\n| field | type | required | meaning |\n| --- | --- | --- | --- |\n| `where` | `Selection` | — |  |\n| `kind` | `perpetual`, `spot`, `all` | — | Market kind to select. Defaults to perpetual, preserving the prior V2 selection. `all` includes spot and perpetual listings. |\n| `units` | `published`, `base` | — | What quantities are expressed in. |\n| `number_format` | `json`, `string` | — | `string` returns every number as a string with the same digits. |\n| `include_synthetic` | boolean | — | Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra. |\n| `layers` | array | — | Which layers to read. |\n| `interval` | string | — | One row per period of this length, each holding the last reading in it. |\n| `at` | array | — | One row per instant, strictly ascending: what history had recorded as of it — the last stored reading visible then (a sampled reading counts from the end of its … |\n| `raw` | boolean | — | Every row as it arrived, unsampled. |\n| `from` | `Instant` | with `interval`/`raw` | Start of the window. Required with `interval` and `raw`; refused with `at`. |\n| `to` | `Instant` | with `interval`/`raw` | End of the window. Required with `interval` and `raw`; refused with `at`. |\n| `include_gaps` | boolean | — | Keep the rows that have no reading. Keeping them is the default because dropping them turns a gap into a shorter series. |\n| `summary` | boolean | — | With `interval`: answer one object per layer of each listing instead of its rows: the number of readings and, per numeric field, the min, max, first and last … |\n| `fields` | array | — | With `summary: true`: only these fields of the layers asked for (default: every numeric field). `[\"funding_8h\"]` is the one to compare venues' funding by: it … |\n| `freshness` | string | — | Override the freshness bound for every layer asked for. |\n| `allow_stale` | boolean | — | ADR-025: return a stale value under `withheld` — never in the value field. Off by default: a stale value is not in the answer at all, only its status, reason … |\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `settled` | boolean | Whether the window is far enough in the past that a late arrival can no longer change it. |\n| `items_sha256` | string | SHA-256 of `items` as serialised. |\n| `mode` | `interval`, `at`, `raw`, `summary` | Which question was asked. |\n| `interval` | string | The period, in `interval` mode. |\n| `from` | `NullableInstant` | The window, in `interval` and `raw` modes. Absent in `at` mode. |\n| `to` | `NullableInstant` |  |\n| `units` | `published`, `base` | The unit mode applied. |\n| `normalisation_version` | `NormalisationVersion` | Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store. |\n| `field_units` | object | In `summary` mode: what each field counts. |\n| `freshness` | object | ADR-025: the request's own bound per layer, or null where none was set — every value has its own horizon (`valid_until`) either way, and a bound only tightens … |\n| `listings_as_of` | `NullableInstant` | When the set of listings was last known to change. Present when asking about the past. |\n| `capabilities_as_of` | `NullableInstant` | When what each venue publishes was last known to change. |\n| `items` | array | One object per listing. |\n\n## POST /v2/candles\n\nCompleted candles, in any stored period and price type.\n\nOne-minute candles are the venue's own klines; every longer period is rolled up from them. A period with every base minute is a complete bar; a closed period with only some of them (a venue drop inside it) is a bar too, marked `\"partial\": true`, and DQL indicators use it; a period with no base minute at all is a `gap`. A partial bar becomes complete when the missing minutes are backfilled. Gaps are rows, not holes. A `1h`, `4h` or `1d` bar from before the platform began collecting a listing is the venue's own kline, fetched afterwards (issue 576), and says so: `\"origin\": \"backfill\"` on the bar; a bar the platform observed itself has no `origin`. A backfilled bar is the venue's word, it is not part of any anchored day's root, and a plan's reach (`retention` and, on Free, Mini and Standard, the depth of the bar's timeframe: Free 1m 48 hours up to 4h and 1d 90 days, Mini 1m 7 days up to 4h and 1d 180 days, Standard a year) applies to it as to every other bar.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it takes\n\n| field | type | required | meaning |\n| --- | --- | --- | --- |\n| `where` | `Selection` | — |  |\n| `kind` | `perpetual`, `spot`, `all` | — | Market kind to select. Defaults to perpetual, preserving the prior V2 selection. `all` includes spot and perpetual listings. |\n| `units` | `published`, `base` | — | What quantities are expressed in. |\n| `number_format` | `json`, `string` | — | `string` returns every number as a string with the same digits. |\n| `include_synthetic` | boolean | — | Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra. |\n| `timeframe` | string | yes | The period. `1m` comes from the venue's own klines; every longer period is rolled up from them. |\n| `price_type` | `trade`, `mark`, `index` | — | Which price. |\n| `from` | `Instant` | yes |  |\n| `to` | `Instant` | yes |  |\n| `include_gaps` | boolean | — | Keep the periods with no candle, as gap rows. |\n| `closed_only` | boolean | — | Accepted and has no effect: only closed minutes are stored, so there is never a forming candle to return. |\n| `trade` | boolean | — | Reserved. |\n| `as_of` | `Instant` | — | Receipt-time availability cutoff. to bounds candle closes; as_of bounds when their input was available. Defaults to now. |\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `settled` | boolean | Whether the window is far enough in the past that a late arrival can no longer change it. |\n| `items_sha256` | string | SHA-256 of `items` as serialised. Two answers with the same hash are the same answer, which is how a client can skip work rather than re-parse. |\n| `timeframe` | string | The period returned. |\n| `price_type` | `trade`, `mark`, `index` | Which price the candles are of. |\n| `from` | `Instant` |  |\n| `to` | `Instant` |  |\n| `units` | `published`, `base` | The unit mode applied. |\n| `normalisation_version` | `NormalisationVersion` | Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store. |\n| `listings_as_of` | `NullableInstant` | When the set of listings was last known to change. Present when asking about the past. |\n| `capabilities_as_of` | `NullableInstant` | When what each venue publishes was last known to change. |\n| `items` | array | One object per listing. |\n| `data_as_of` | `Instant` |  |\n\n## POST /v2/liquidations\n\nLiquidations, one by one, in a window of up to a week.\n\nA liquidation is an event, so this is a list and not a series: the events of `(from, to]` in time order, each once, the venue's own word for the side of the forced order (`buy` closes a short, `sell` closes a long) and the digits as stored. A window with no event is an empty list under `status: present`; where the list is known to be incomplete — older than what is kept, or a hole the platform recorded — `gaps` says so, with the cause, so a quiet stretch is never read as a quiet market. `limit` keeps the newest events of a listing and `truncated` says there were more. The totals over the same window are `liquidation_count`, `liquidation_volume` and `liquidation_value` (and their `_long_` and `_short_` forms) in a query. One limit of what an empty list proves: the platform does not record when it began collecting the layer for a venue, so `retention_from` is the oldest week the retention class holds, not the day collection started, and a venue whose collector has not run yet answers an empty list under `present`.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it takes\n\n| field | type | required | meaning |\n| --- | --- | --- | --- |\n| `where` | `Selection` | — |  |\n| `units` | `published`, `base` | — | What quantities are expressed in. |\n| `number_format` | `json`, `string` | — | `string` returns every number as a string with the same digits. |\n| `include_synthetic` | boolean | — | Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra. |\n| `from` | `Instant` | — | The start of the window, exclusive. Without it: an hour before `to`, or as far back as the key's plan reads when that is less. At most a week before `to`. |\n| `to` | `Instant` | — | The end of the event window, inclusive. Without it, or later than the availability cutoff: the cutoff (as_of, or now). |\n| `limit` | integer | — | The newest events of each listing to return. When there were more in the window, `truncated` is true on its item and the events shown are the newest. |\n| `include_gaps` | boolean | — | Write out, per listing, where the feed is known to be incomplete (`gaps`). |\n| `as_of` | `Instant` | — | Receipt-time availability cutoff. from/to bound event times; as_of bounds when events were received. Defaults to now; future cutoffs are refused. |\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `to`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `settled` | boolean | Whether the window is far enough in the past, and written far enough, that a late arrival can no longer change it. |\n| `items_sha256` | string | SHA-256 of `items` as serialised. Two answers with the same hash are the same answer, which is how a client can skip work rather than re-parse. |\n| `from` | `Instant` | The start of the window actually read (exclusive). |\n| `to` | `Instant` | The end of the window actually read (inclusive). |\n| `units` | `published`, `base` | The unit mode applied. |\n| `normalisation_version` | `NormalisationVersion` | Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store. |\n| `listings_as_of` | `NullableInstant` | When the set of listings was last known to change. Present when asking about the past. |\n| `capabilities_as_of` | `NullableInstant` | When what each venue publishes was last known to change. |\n| `items` | array | One object per listing. |\n| `data_as_of` | `Instant` | The explicit receipt-time availability cutoff; present when as_of was requested. |\n\n## GET /v2/funding/settlements\n\nFunding settlement prints, one row per print of a listing: the rate as published, the interval in force, the origin, the cap and floor.\n\nFunding as events rather than a sampled layer: the rows are the settlements themselves, each with the instant the venue states, `rate` and `rate_8h`, and the `interval` in force at that print. `interval_check` compares that interval, derived from the gap to the previous print, with the one the venue publishes; a `mismatch` is flagged on the row and never corrected. `origin` is `live` for a print recorded as it settled and `backfill` for one read afterwards from the venue's own history (Binance, Bybit, OKX, Kraken Futures and Hyperliquid, 90 days); neither is part of an anchored day. `cap`, `floor` and `at_cap` are as the venue's API published them at the print. A venue of the selection with no prints is named under `not_recorded` with the reason. The window is `(from, to]`, a week by default, and depth is the plan's history as for `POST /v2/snapshots/history` (`PLAN_LIMIT` with `earliest_from` and `retry_with`). Page with `next_cursor`.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `from` | `Instant` | The start of the window actually read (exclusive). Pinned by the first page and the same on every page of a cursor. |\n| `to` | `Instant` | The end of the window actually read (inclusive). |\n| `order` | `asc`, `desc` | The order of `items` by `time` (then instrument). |\n| `listings` | integer | How many listings the selection named. |\n| `items_sha256` | string | SHA-256 of `items` as serialised. |\n| `not_recorded` | array | The venues of the selection the platform holds no settlement prints for, each with why. An empty page of such a venue is not a quiet venue. |\n| `items` | array | The prints. |\n| `next_cursor` | string or null | Opaque continuation cursor. Null means this is the last page. Keep the other options unchanged; a stale or foreign cursor returns `DQL_CURSOR` and the read … |\n\n## POST /v2/books\n\nOrder books to the depth the plan allows, with the depth resting in each band around the mid.\n\nPrices and sizes are strings, always. A book is where a rounded digit becomes a wrong order.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it takes\n\n| field | type | required | meaning |\n| --- | --- | --- | --- |\n| `where` | `Selection` | — |  |\n| `kind` | `perpetual`, `spot`, `all` | — | Market kind to select. Defaults to perpetual, preserving the prior V2 selection. `all` includes spot and perpetual listings. |\n| `units` | `published`, `base` | — | What quantities are expressed in. |\n| `number_format` | `json`, `string` | — | `string` returns every number as a string with the same digits. |\n| `include_synthetic` | boolean | — | Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra. |\n| `depth` | integer | — | Levels per side. Clamped to what the plan allows; the answer states what was applied. |\n| `allow_stale` | boolean | — | ADR-025: return a stale value under `withheld` — never in the value field. Off by default: a stale value is not in the answer at all, only its status, reason … |\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `resolved_from` | `ResolvedFrom` |  |\n| `trial` | `Trial` |  |\n| `units` | `published`, `base` | The unit mode applied. |\n| `normalisation_version` | `NormalisationVersion` | Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store. |\n| `depth` | integer | How many levels per side were returned, after the plan's ceiling was applied. |\n| `liquidity_note` | string | How the depth figures relate to the levels shown, in one sentence. |\n| `items` | array | One object per listing. |\n\n### Which venues carry a book sequence\n\n`sequence` is the venue's own number of the book update the levels are of, exactly as the venue sent it, and\n`sequence_kind` says what that number counts. They travel together: both are set, or both are null.\n\n- `venue_sequence` — the exchange's own update id of its book feed.\n- `engine_sequence` — the counter of an off-chain matching engine. It orders that engine's messages and is\n  not a block height.\n- `block` — reserved for a chain's block height. No venue we collect publishes its book at one, so nothing\n  carries it today.\n\nThe number is in the venue's units and is not normalised: one venue counts every message, another only the\nupdates of one book, another the versions of a snapshot it serves on request. Use it to tell whether two\nanswers are the same book update and which of them is later, not to count updates between them.\n\n**A venue without a book sequence answers null, and that is a fact about the venue, not a gap in our data.**\nThe platform does not make a number up where the venue sends none: a counter of ours would let you believe\nyou were watching the venue's feed when you were watching ours. The same goes for a venue whose only number\nis not one — `null` there is deliberate.\n\n| venue | book `sequence` | `sequence_kind` | what it is, or why there is none |\n| --- | --- | --- | --- |\n| `ASTER-PERP` | number | `venue_sequence` | `u`, the final update id of the depth stream (the same feed as Binance USD-M). |\n| `BINANCE-USDM` | number | `venue_sequence` | `u`, the final update id of the depth stream. |\n| `BITGET-PERP` | number | `venue_sequence` | The depth response carries no number. |\n| `BYBIT-PERP` | number | `venue_sequence` | `u`, the update id of the order book stream. |\n| `DERIBIT-PERP` | number | `venue_sequence` | `change_id`, the venue's book update id on a complete top-10 snapshot. It may jump; it does not count intervening updates or link deltas. |\n| `EDGEX-PERP` | number | `engine_sequence` | `endVersion` of the matching engine; `startVersion` links a delta to the previous update. |\n| `GATE-PERP` | number | `venue_sequence` | The depth response the platform reads carries times and no number. |\n| `KRAKEN-FUTURES` | number | `venue_sequence` | `seq` of the book feed, one counter per product, +1 on every message. |\n| `LIGHTER-PERP` | number | `engine_sequence` | `nonce` of the matching engine; `begin_nonce` links a delta to the previous update. |\n| `MEXC-PERP` | number | `venue_sequence` | `version` of the depth response. |\n| `OKX-PERP` | number | `venue_sequence` | `seqId` of the books channel. |\n| `SYNTHETIX-PERP` | number | `engine_sequence` | `meseq`, the counter of Synthetix's off-chain matching engine. Not a block: it says nothing about the chain. |\n| `WEEX-FUTURES` | number | `venue_sequence` | `u`, the final update id of the depth stream. |\n| `AVANTIS-PERP` | null | null | No order book: an oracle-priced venue. |\n| `BITUNIX-PERP` | null | null | The book channels carry a time and no number: every frame is a whole snapshot of the best 15 levels. |\n| `COINBASE-INTX` | null | null | No order book is collected (its WebSocket needs a key), so the book is not served at all. |\n| `DYDX-PERP` | null | null | The indexer's only counter, `message_id`, counts messages of one connection and restarts on every reconnect. It orders nothing about the book, so it is not shown. |\n| `GMX-PERP` | null | null | No order book: an oracle-priced venue. |\n| `HYPERLIQUID` | null | null | The book stream carries a time and no number. |\n| `NADO-PERP` | null | null | The book stream's chain fields are nanosecond timestamps (about 1.8e18), too large for a JSON number in most clients. They are not shown as a sequence. |\n\nOnly the latest number is served, with the levels it belongs to. Book sequences are not stored: not in the\nhistory behind `POST /v2/snapshots/history` (order books have none), and not per update on `GET /v2/stream`.\nKeeping them in history is a separate piece of work that has not been done.\n\nThe number is per listing and per feed. Never compare it across venues, or across two listings of one venue.\nA venue may restart its numbering, after its own maintenance for one; a smaller number than before is that,\nnot time running backwards.\n\n## GET /v2/account\n\nWhat this key sees and what is left of it today: the plan, the platform's venues, layers and limits, and today's counters.\n\nFree: the call is not counted against the day's requests (it takes a token of the per-second limit), and it needs a key. `venues.included` lists the platform's venues; all plans can query every listed venue and instrument. `today.requests.remaining` is what `requests_per_day` has left; `today.dql.tokens_remaining` is the bucket of `/v2/screen` and `/v2/dql/parse` now. Read it before a long job.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `plan` | object | The key's plan. |\n| `venues` | object | Every venue available to this key, by public code. Every plan can read every venue on the platform. |\n| `instruments` | object | How the plan picks its instruments. |\n| `layers` | array | The snapshot layers a request may name. No plan gates a layer; `instruments` says per listing which a venue publishes. |\n| `limits` | object | What the account is allowed: its plan's limits, or its own where `custom` names one. |\n| `today` | object | Today's counters (UTC) against those limits. |\n| `plans` | string | Where the plans and their prices are. |\n\n## GET /v2/agent/state\n\nThe state of the account's Agent rules, polled: true, false or unknown, and what this key was told last time.\n\nFor a bot that would rather ask than be told. `previous_state` is what this key was given the last time it asked about the rule, one row per key and rule, so a poll sees the change since its own previous poll whatever other keys asked. A plan with push (a Runner) gets the rule's last scheduled evaluation and its `evaluated_at`, free; `fresh=true` evaluates now and is charged against the plan's evaluations a day. A rule is never checked faster than its instruments are collected: `effective_interval` is the largest of the plan's interval, the rule's own cadence and the cadence of its instruments. Without a key the call can be paid per rule with x402 (`rule_id`, one to 100). Poll at the interval a rule is checked at, not faster: between two checks nothing changes.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `evaluations` | `AgentStateEvaluations` | Absent on a call paid with x402 and no key: it paid for what it asked, and has no budget. |\n| `agent` | `on`, `stopped` | Whether Agent runs on the account: `stopped` when the user switched it off, and then no rule is checked. With a key only, and only when Agent answered in time. |\n| `items` | array | One per rule, oldest first. |\n\n## GET /v2/agent/result\n\nA persisted live candle decision for one rule, instrument and UTC candle close.\n\nRequires the account's user key and `rule_id`, `instrument`, `bar_end` query parameters. Returns `true`, `false` or `unknown` with a reason, `final`, rule version, attempt, `data_as_of`, actual calculation times and receipt. No new evaluation is performed. Results are retained seven days; an absent row is `unknown` / `not_measured`, never false. Foreign rules return 404. Counts as an ordinary API reference request; Agent keys and x402 are refused. See the #300 temporal contract for retries and replay limits.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `rule_id` | string | The rule the decision belongs to. |\n| `instrument` | string | The instrument the decision is for. |\n| `bar_end` | `AgentResultInstant` |  |\n| `verdict` | `true`, `false`, `unknown` | `true`, `false` or `unknown`. `unknown` is its own answer: the data needed to decide was missing or not current, and it is never written as `false`. |\n| `reason` | string or null | Why the verdict is `unknown`; null otherwise. |\n| `final` | boolean | Whether the decision is final for its bar. |\n| `version` | string | The version of the rule the decision was made under. |\n| `nominal_t` | `AgentResultInstant` |  |\n| `data_as_of` | `AgentResultInstant` |  |\n| `started_at` | `AgentResultInstant` |  |\n| `finished_at` | `AgentResultInstant` |  |\n| `attempt` | integer | Which attempt at the bar produced this decision. |\n| `receipt_id` | string or null | The receipt of the evaluation; null when none was recorded. |\n\n## GET /v2/archive\n\nThe files of the archive for one listing: the day, the rows, the size, the sha256, how many gaps the day has, and where to fetch it.\n\nThe tick-level history of the core and top-100 groups — trades, ticker, mark and the book's derived figures — as one Parquet file per listing, layer and UTC day, for the days Postgres no longer holds the raw rows and for the days it still does. `?listing=BINANCE:BTCUSDT` is required (the venue's code, a colon, the venue's symbol); `layer` (default: all four), `from` and `to` (days, default the last thirty) narrow it. Free with any key and counted against nothing: the list is how you find what to ask for. Only files that were read back from storage and checked are listed. A day on which nothing was observed is listed with `available: false` and the gaps that say why. `anchored` is `false` until the files are anchored.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n| `evaluated_at` | `Instant` | The instant the platform evaluated this answer at (UTC). |\n| `served_at` | `ServedAt` | The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`. |\n| `receipt_id` | `ReceiptId` | Names this exact response. Log it next to the decision made from it. |\n| `listing` | string | The listing, as `VENUE:SYMBOL`, the venue by the code the platform publishes. |\n| `from` | string | The first UTC day of the span. |\n| `to` | string | The last UTC day of the span. |\n| `truncated` | boolean | More days exist inside the span than the 400 returned; ask for a shorter span. |\n| `items` | array | Oldest first, a day's layers in alphabetical order. |\n\n## GET /v2/archive/{listing}/{layer}/{day}\n\nOne file of the archive, as a `302` to a link that works for fifteen minutes.\n\n`{listing}` is `VENUE:SYMBOL` as one path segment (the colon as `%3A`, a slash in the symbol as `%2F`); the `download` of the list is exactly this path. The answer is a redirect: follow it to download. `X-Debyko-Sha256` carries the file's hash and `Link` points at the day's entry in the list; the body, for a client that does not follow redirects, says the same and holds the link. A key spends one of its plan's files for the month (Free and Mini none, Standard 100, Pro 1 000, Pro Plus 10 000; a calendar month, UTC): past them the answer is `402` with the price of this file, `X-Debyko-Archive-Remaining` says what is left. Without a key, when x402 is on, a file costs 0.10 USDC (core) or 0.05 (top-100), one payment, one file. The link reads this one file and nothing else. The contents are never paged through the API.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n## GET /v2/stream\n\nA live stream of the selected listings, as server-sent events.\n\nOne `snapshot` per listing and layer, then an `update` for every change — including a change of status with no new value, because a listing going stale is news: the update says `stale` and why, and carries no value (`allow_stale=true` puts it under `withheld`). A heartbeat every fifteen seconds means silence is a broken connection, not a quiet market.\n\n**Needs a key.** Refuses with `401` without one, `429` when the plan's rate is used up.\n\n### What it answers\n\n| field | type | meaning |\n| --- | --- | --- |\n\n\n\n# Freshness and cadence\n\nEvery value of a snapshot layer says how long it is good for. Past that, it is not returned as a value.\n\n## What a value states\n\n| field | what it says |\n| --- | --- |\n| `received_at` | when the platform received it |\n| `venue_ts` | the venue's own timestamp, when it sends one |\n| `age_ms` | how old it is: the instant asked about minus its anchor — `venue_ts` where the horizon counts from the venue's clock, `received_at` otherwise |\n| `venue_age_ms` | how old it is by **the venue's** clock, whatever the anchor: the instant minus `venue_ts`; null without one |\n| `valid_until` | the instant after which it is no longer treated as current |\n| `horizon_source` | where `valid_until` comes from (below) |\n| `anchor` | which clock the horizon counts from: `venue` (its own timestamp) or `receipt` (ours) |\n\nThere is one definition of age, and `age_ms`, `age(F)` in DQL, a query's `freshness` bound and every page of the\nsite use it: a value is as old as the venue's own timestamp says wherever the venue dates the value, and as old as\nour receipt only where it does not. Where the venue's timestamp dates the publication of the value (or, for a\nsettled rate, its settlement), the horizon and the age count from it (`anchor: \"venue\"`): a quote whose timestamp\nstops advancing grows old and goes stale however often we poll it — COINBASE-INTX's quotes stood on one timestamp\nfrom 2026-10-01 09:00:29 UTC for a week while we read them every two seconds. Where the venue sends no time, or its\ntime dates something else, both count from our receipt (`anchor: \"receipt\"`) and `venue_ts` stays what the venue\nsaid, with its own age: Aster's open interest carries the instant the venue last changed the figure, so for a quiet\nsymbol `venue_age_ms` is how long the figure has stood still, tens of minutes, while `age_ms` is how long ago the\nplatform read it. The pairs that count from our receipt are listed below.\n\n| `horizon_source` | meaning |\n| --- | --- |\n| `venue_declared` | the venue said when the next value comes: a settled funding rate and the interval it publishes with it |\n| `measured` | a cadence the platform measured |\n| `documented` | the venue's documentation |\n| `assumed` | a cadence the platform assumes. It is written down below, with what it rests on |\n| `connection` | the venue pushes only when the value changes: the value holds while the connection that delivered it is alive, up to its pair's no-update threshold (`valid_until`) |\n| null | no fact covers the value: it is stale, `horizon_unknown` |\n\n## How long a value is good for\n\n- **Polled or streamed:** twice the longer of its interval and the history window it is kept at (a second to a\n  minute by the listing's group and the layer, the table below; funding never less than ten seconds). A stored\n  reading is the last of its window, so a horizon shorter than two windows would make every stored reading of a\n  fast feed stale the moment it is kept.\n- **Settled** (a funding rate the venue has fixed): until the next settlement is due — the listing's own funding\n  interval (1 h, 4 h, 8 h, from the registry, and only from it: a listing without one has no horizon,\n  `horizon_unknown`) after the settlement the rate belongs to — and five minutes more, twice the longest a settlement was measured to take to reach us. Its age\n  is the settlement's: forty minutes into an hourly period a current rate is forty minutes old, so ask\n  `status(funding) = present`, not `age(funding) < 2m`.\n- **Pushed only on change:** while the connection lives, and no longer than its pair's **no-update threshold**\n  after its anchor (the table below). A quiet socket means \"nothing changed\", for a while: past the threshold —\n  longer than any listing of the pair was measured to stay quiet while alive — a value whose timestamp has not moved\n  is stale, `no_update`, though its connection lives. The value stops being current the moment the platform records\n  a disconnection of that venue, a collector going down or restarting, a bus outage, or its own projection lagging,\n  and for the last only while the lag lasts: once State has caught up, a value that did not change is as current as\n  it was, unless a disconnection, a collector going down or a bus outage was recorded inside the lag's window. A\n  socket on which nothing at all arrives — no data, no reply, no heartbeat — for longer than its venue guarantees it\n  speaks is a disconnection too: the collector drops it and reconnects, and every value on it is `connection_lost`.\n  The platform never sends a fake heartbeat to keep such a value fresh. A disconnection is recorded for the venue as\n  a whole, not for one socket, so any reconnect ends every such value of that venue until the next value arrives (on\n  Kraken, about 0.07 % of the time, never more than about two seconds at once, measured 2026-09-29).\n- **A value no fact covers** is stale. No proof, no value.\n\nAt `valid_until` itself the value is still current. A query's own `freshness` bound can only make a value stale\nsooner; it never extends a horizon.\n\n## A stale value is not a value\n\nPast `valid_until` the layer's `status` is `stale` and the value is **not** in the value field: `values` is empty\n(`value` is null on a DQL value object), and the reading is still dated — `received_at`, `age_ms` and\n`valid_until` say what it was and when it stopped being current. The value itself is written under a separate\nkey, `withheld`, only when the request sets `allow_stale: true` (`allow_stale=true` on `GET /v2/stream`). The\ndefault is false. `withheld` is for post-mortems; do not feed it into a live decision.\n\n| reason | why the value is stale |\n| --- | --- |\n| `horizon_passed` | no new value within its horizon |\n| `connection_lost` | the connection that delivered it was recorded lost — a disconnection, or a socket on which nothing at all arrived for longer than its venue guarantees it speaks |\n| `no_update` | it is pushed only on change, its connection lives, and its timestamp has not moved for longer than its pair's no-update threshold (the table below) |\n| `state_lag` | **our** live projection fell behind; the venue and the connection were fine |\n| `source_error` | the **venue** refused our requests for this layer (an error status, not a rate limit) since the value arrived, so nothing newer could come |\n| `horizon_unknown` | no fact covers it, or the connection's liveness could not be read |\n| `freshness_bound` | older (`age_ms`) than the bound the query set itself |\n| `halted` | the **venue** said, at the instant asked about, that it does not trade the listing: its figures are its last, not a market, in every layer (it outranks every other reason) |\n\nThe five states stay distinct everywhere — the live answer, history, DQL: `present`, `stale`, `missing`,\n`not_published`, `off`. None of them becomes another, or a zero, or the previous value.\n\nIn DQL a stale value compares as **unknown**, `and`/`or`/`not` treat it as unknown, `any` and `all` give\nunknown, `count` does not count it, and `status(F) = stale` is true and never unknown.\n\n## Series over values pushed on change\n\nA sampled series (`last` at `1m`) over a value pushed only on change carries the value into the periods in which\nit did not change, as long as its connection lived — and says so: `carried: true` on the history row and on the\nseries value, and `carried(S, n)` in DQL, the number of the last `n` periods whose value was carried rather than\nobserved. `carried(last, 1) = 0` is true only when the newest period was observed. Candles are never carried.\n\n## Replay\n\nA replay with `as_of = served_at` reads the facts and the connection breaks as they were recorded by that\ninstant, so a value withheld in an answer is withheld in its replay, with the same reason and `valid_until`. A\nfact corrected later changes what is read from then on, never the past.\n\n## How often history keeps a value\n\nEvery tick of every layer is in the live answer, whatever follows. History keeps the **last value of each window** of\na fixed length, and the length depends on the listing's group:\n\n- `core` — the five main instruments of every venue (what the owner calls the majors);\n- `top-100` — the hundred busiest listings of the rest by 24 h turnover, chosen once a day. A listing enters\n  when it is busier than the weakest member by a margin and leaves when it is not, so one on the border does not\n  change places every morning; a listing that moves keeps what was already stored, under the window it was stored at;\n- `tail` — everything else the platform collects.\n\nEvery stored row says the window it was sampled at (`cadence` on the row), so a series' spacing is data, never\ninferred. A window in which a layer was not observed has no row: the absence is what a query reads as `stale`.\n\n| layer | `core` | `top-100` | `tail` |\n| --- | --- | --- | --- |\n| ticker, book prices | `10s`, kept 6 months | `1s`, kept 1 week | `15s`, kept 1 month |\n| mark | `10s`, kept 6 months | `1s`, kept 1 week | `1m`, kept 1 month |\n| funding | `1m`, kept 2 years | `15s`, kept 1 month | `1m`, kept 1 month |\n| oi | `10s`, kept 6 months | `15s`, kept 1 month | `1m`, kept 1 month |\n| stats | `10s`, kept 6 months | `15s`, kept 1 month | `1m`, kept 1 month |\n| book bands | `10s`, kept 6 months | `15s`, kept 1 month | not collected |\n| venue_depth | `10s`, kept 6 months | `15s`, kept 1 month | `1m`, kept 1 month |\n| trade | every event, kept 1 week | every event, kept 7 days | not collected |\n| candles | every event, kept 1 year | every event, kept 1 month | every event, kept 1 month |\n| liquidation | every event, kept 2 years | every event, kept 2 years | every event, kept 2 years |\n| live answer (`md.state`, `/v2/stream`, \"now\") | every tick | every tick | the last tick of each second, as it was received |\n| raw order book | raw book kept 4 hours | raw book kept 1 hour | none |\n\nA layer that is not collected for a group is `off` in its answers (`policy: \"off\"`): the tail's book bands are not collected at all.\nThe tail's trades and raw book are collected only where a venue's ticker is made of them: `BINANCE-USDM`, `ASTER-PERP`, `BINANCE-SPOT`, `HYPERLIQUID` publish\nno ticker until they have seen a trade, so the tail keeps the trade stream there (and stores none of it); `EDGEX-PERP`, `DYDX-PERP`, `NADO-PERP`, `SYNTHETIX-PERP`, `WEEX-FUTURES` make\nthe ticker of the book, so the tail keeps its raw book for an hour. On every other venue the ticker comes whole on its own channel and the tail\nhas neither. The same is said per listing and layer by `history_cadence` on `GET /v2/instruments`.\n\n## Retention, and what a question beyond it is told\n\nWhat is kept is the `kept` of the table, per group and layer: the `core` six months (funding two years, candles a year, liquidations two years), the\n`top-100` a week of its second-level ticker and mark, a month of the rest and seven days of its trades, the `tail` a month. The trades of the\n`top-100` are stored in partitions of a day and dropped seven days after the day's end, so a trade is on disk seven to eight days (the\nweekly classes keep a row seven to fourteen). The length is a class of the policy, not of the code. A layer's `retention_from` on `GET /v2/instruments`\nsays since when it is kept for that listing. A question that reaches back past it — an `as_of`, a window, a history row — is not answered with\nsilence and is not answered as a quiet market: the layer is `missing` with the reason `not_retained`. A layer kept for longer, asked at the same\ninstant, is only empty (`no_value`) where nothing was recorded. A listing that moves between groups keeps what it was already stored, each row for\nas long as the class it was written under.\n\n## Every pair, and what its horizon rests on\n\n122 pairs today, 46 of them on an **assumed** cadence and\n37 living on their connection. `GET /v2/instruments` states the same fact\nper layer (`horizon`), as known at the instant asked about.\n\n| venue | dataset (layer) | mode | interval | label | venue time dates | what it rests on |\n| --- | --- | --- | --- | --- | --- | --- |\n| ASTER-PERP | depth-derived (book bands) | stream | 10 s | **assumed** | publication | the same feed as Binance (depth20@100ms), not cited for Aster; rows 10/10 s; git ba64921 |\n| ASTER-PERP | funding (funding) | stream | 3 s | measured | publication | the same markPrice frame (r and T), every 3 s, live 2026-09-30, dated by E; was REST every 15 s; git 3703db0 |\n| ASTER-PERP | mark (mark) | stream | 3 s | measured | publication | WS {symbol}@markPrice: a frame every 3 s, live 2026-09-30 (aster-perp.md, Датасеты), dated by E; was REST every 15 s; git 3703db0 |\n| ASTER-PERP | open-interest (oi) | poll | 300 s | measured | none | REST openInterest every 300 s, through a CloudFront cache (Age header 1-4 s); the response's time is when the figure last moved, not when the venue published it: DOTUSDT 12-28 minutes old with the same value in all 44 reads, TRXUSDT 17-32 minutes, BTCUSDT 12-33 s behind each change (live 2026-10-01 11:44-11:59Z, five symbols every 20 s); counted from it a figure read seconds ago stood stale (8 symbols in 14 minutes, at ages of 24-296 s), so the horizon counts from our receipt and venue_age_ms still says how old the figure is; 0048 read the lag as the cache's; git ba64921 |\n| ASTER-PERP | stats (stats) | on change | — | measured | publication | WS {symbol}@ticker and !ticker@arr: a frame only after a trade in the symbol (the venue's trade counter n rose in 3 524 of 3 555 consecutive frames) and no heartbeat; live 2026-10-01 11:24-11:49Z, 26 symbols: BTCUSDT every 4.2 s on average (longest silence 28 s), ASTERUSDT 2.0 s (50 s), the quiet tail minutes apart (DOTUSDT first frame after 447 s, LTCUSDT after 491 s, TRXUSDT two frames in 25 minutes); dated by E; 0060 stated a frame every 1000 ms (the stream of Binance's protocol, no rate cited for Aster), which no symbol sends; git 3703db0; no_update after 6 h: the longest spell without a new value, no break of the connection and no restart in it, 7 681 s (TRXUSDT, the least traded of 26 at USD 61 thousand a day, 2026-10-03 02:38-04:46Z; 59 spells over 30 minutes of TRXUSDT alone, and every spell that long is of a listing under USD 1.5 million a day; BTCUSDT and ETHUSDT none over 65 s), 2026-10-01 to 10-08; twice it is 4.3 h |\n| ASTER-PERP | ticker (ticker, book prices) | on change | — | measured | publication | aster-perp.md:78: frames only on change, 11–54 in 8 s; git ba64921; no_update after 1 h: the longest quiet spell 1 595 s (TRXUSDT, the least traded, 2026-10-04 02:31-02:58Z; DOTUSDT, the next, 240 s), 2026-10-01 to 10-08; twice it is 53 minutes |\n| AVANTIS-PERP | funding (funding) | poll | 20 s | **assumed** | none | REST /v2/trading every 20 s; the SDK says the snapshot is rebuilt ≈ every 30 min (venue card :34-37, :185-186); no venue time; git 52077ac |\n| AVANTIS-PERP | open-interest (oi) | poll | 20 s | **assumed** | none | REST /v2/trading every 20 s; the SDK says the snapshot is rebuilt ≈ every 30 min (venue card :34-37, :185-186); no venue time; git 52077ac |\n| AVANTIS-PERP | venue-depth (venue_depth) | poll | 20 s | **assumed** | none | REST /v2/trading every 20 s; the SDK says the snapshot is rebuilt ≈ every 30 min (venue card :34-37, :185-186); no venue time; git 52077ac |\n| BINANCE-SPOT | depth-derived (book bands) | on change | — | measured | none | WS depth20@100ms, the partial book, pushed at most every 100 ms and not while the top twenty is unchanged; no venue time in the frame; binance-spot.md: 780 frames in 80 s on BTCUSDT, mean 100 ms, longest silence 0.38 s, 474 on ADAUSDT, 1.20 s, 537 on LINKUSDT, 1.0 s; measured on one machine, not on production; git c55d9a9; no_update after 5 min, as the ticker: the top twenty moves whenever the best level does (it is the same book), so it is never quieter than the book ticker; its bands are not kept in history at the listings' group to measure apart |\n| BINANCE-SPOT | stats (stats) | on change | — | measured | publication | WS ticker, at most once a second (docs web-socket-streams: update speed 1000 ms) and silent while a pair does not move; binance-spot.md: 78 frames in 80 s on BTCUSDT, longest silence 1.16 s, 70 on ADAUSDT, 5.0 s, 73 on LINKUSDT, 2.0 s; measured on one machine, not on production; git c55d9a9; no_update after 5 min: the longest spell without a new value 115 s (HYPEUSDC, the least traded of 12, 2026-10-07 22:54Z), no break in it, 2026-10-05 to 10-08; twice it is 230 s |\n| BINANCE-SPOT | ticker (ticker, book prices) | on change | — | measured | none | WS bookTicker, real-time on every change of the best level (docs web-socket-streams: update speed real-time), with the last price of the trade stream; no venue time in the frame; binance-spot.md: 9448 frames in 80 s on BTCUSDT, longest silence 0.76 s, 1795 on ADAUSDT, 5.59 s, 1749 on LINKUSDT, 2.08 s; measured on one machine, not on production; git c55d9a9; no_update after 5 min: the longest spell 103 s, inside a bus outage (2026-10-07 12:19Z), 74 s without one (HYPEUSDC, the least traded of 12), 2026-10-05 to 10-08; twice it is 206 s |\n| BINANCE-USDM | depth-derived (book bands) | stream | 100 ms | documented | publication | WS depth20@100ms: binance-usdm.md:236-237; git 1520761 |\n| BINANCE-USDM | funding (funding) | stream | 3 s | documented | publication | the same markPrice frame (r and T), every 3 s, documented, dated by E; was REST every 15 s; git 3703db0 |\n| BINANCE-USDM | mark (mark) | stream | 3 s | documented | publication | WS {symbol}@markPrice: every 3 s by default, documented (binance-usdm.md, Mark / Funding), dated by E; was REST every 15 s; git 3703db0 |\n| BINANCE-USDM | open-interest (oi) | poll | 300 s | measured | publication | REST openInterest every 300 s; rows 300/301.6 s; git 1520761 |\n| BINANCE-USDM | stats (stats) | stream | 1 s | documented | publication | WS {symbol}@ticker: every 1000 ms, documented (binance-usdm.md, Stats), dated by E; was REST every 15 s; git 3703db0 |\n| BINANCE-USDM | ticker (ticker, book prices) | on change | — | **assumed** | publication | WS bookTicker: cadence undocumented, a frame on change; git 1520761; no_update after 5 min: the longest spell without a new value 58 s over 44 listings (BCHUSDC, the least traded at USD 6 million a day, among them), 2026-10-05 to 10-08; twice it is 116 s |\n| BITGET-PERP | depth-derived (book bands) | stream | 100 ms | measured | publication | WS books: a snapshot, then an update every 100 ms (bitget-perp.md, depth-raw; 223 updates of two symbols in 12 s, live 2026-09-30); was REST merge-depth every 300 s; git f24877b |\n| BITGET-PERP | funding (funding) | stream | 10 s | **assumed** | publication | WS ticker, the adapter's comment (:12-13); git c4b1eda |\n| BITGET-PERP | mark (mark) | stream | 10 s | **assumed** | publication | the WS ticker frame that carries the venue's ticker, open-interest, stats and funding (markPrice and indexPrice, dated by its ts): their fact, not measured apart from them; git 7642462 |\n| BITGET-PERP | open-interest (oi) | stream | 10 s | **assumed** | publication | WS ticker \"several times a second\": only the adapter's comment (:12-13); rows 10.0/10.1 s; git c4b1eda |\n| BITGET-PERP | stats (stats) | stream | 10 s | **assumed** | publication | WS ticker \"several times a second\": only the adapter's comment (:12-13); rows 10.0/10.1 s; git c4b1eda |\n| BITGET-PERP | ticker (ticker, book prices) | stream | 10 s | **assumed** | publication | WS ticker \"several times a second\": only the adapter's comment (:12-13); rows 10.0/10.1 s; git c4b1eda |\n| BITUNIX-PERP | depth-derived (book bands) | stream | 330 ms | measured | publication | docs/engineering/venues/bitunix-perp.md: WS depth_book15, a whole snapshot of 15 levels per side on a clock of about 330 ms for every listing, quiet or not (median 317 ms and longest gap 375 ms on 25 listings in 120 s); dated by the frame ts (ms). |\n| BITUNIX-PERP | funding (funding) | poll | 60 s | measured | none | docs/engineering/venues/bitunix-perp.md: REST funding_rate/batch every 60 s, the rate in force in percent (BTCUSDT changed between 11:11 and 11:15 UTC and no listing changed within 20 s; the refresh period is not measured); the response has no venue time, so the host stamps receipt. |\n| BITUNIX-PERP | mark (mark) | stream | 500 ms | measured | publication | docs/engineering/venues/bitunix-perp.md: WS price, mark and index about every 505 ms on every listing (the longest gap on 25 listings in 120 s was 554 ms), dated by the frame ts (ms). |\n| BITUNIX-PERP | stats (stats) | on change | — | measured | publication | docs/engineering/venues/bitunix-perp.md: the same tickers frame as the ticker (24 h volumes, open, high, low, change in percent); only on change; dated by the frame ts (ms). No-update threshold assumed 5 minutes, as the ticker. |\n| BITUNIX-PERP | ticker (ticker, book prices) | on change | — | measured | publication | docs/engineering/venues/bitunix-perp.md: WS tickers, one symbol per frame, only on change and no heartbeat; WS capture of 2026-11-12 11:10-11:12 UTC (BTC, ETH) and a 120-second capture of the 25 assigned listings: BTCUSDT every 1.5 s, the quietest listings a median of 4.5 s and a longest gap of 16.6 s; dated by the frame ts (ms). No-update threshold assumed 5 minutes, above the 30-second socket watchdog; not a long-run measurement. |\n| BYBIT-PERP | depth-derived (book bands) | stream | 190 ms | measured | publication | bybit-perp.md:209-210: the book ≈5.3 frames/s; git 9136b4c |\n| BYBIT-PERP | funding (funding) | stream | 10 s | **assumed** | publication | WS tickers: cadence undocumented (bybit-perp.md:68-73); rows 10.0/10.5 s (10 s window); git 9136b4c |\n| BYBIT-PERP | mark (mark) | stream | 10 s | **assumed** | publication | WS tickers: cadence undocumented (bybit-perp.md:68-73); rows 10.0/10.5 s (10 s window); git 9136b4c |\n| BYBIT-PERP | open-interest (oi) | stream | 10 s | **assumed** | publication | WS tickers: cadence undocumented (bybit-perp.md:68-73); rows 10.0/10.5 s (10 s window); git 9136b4c |\n| BYBIT-PERP | stats (stats) | stream | 10 s | **assumed** | publication | WS tickers: cadence undocumented (bybit-perp.md:68-73); rows 10.0/10.5 s (10 s window); git 9136b4c |\n| BYBIT-PERP | ticker (ticker, book prices) | stream | 10 s | **assumed** | publication | WS tickers: cadence undocumented (bybit-perp.md:68-73); rows 10.0/10.5 s (10 s window); git 9136b4c |\n| BYBIT-SPOT | depth-derived (book bands) | stream | 200 ms | measured | publication | WS orderbook.1000 every 200 ms (docs websocket/public/orderbook: spot level 1000 push frequency 200 ms); bybit-spot.md: 380 frames in 75 s on BTCUSDT, mean 201 ms; git f83d0fc |\n| BYBIT-SPOT | stats (stats) | on change | — | measured | publication | WS tickers, snapshot-only and pushed only when a field changes, at most every 50 ms (docs websocket/public/ticker); bybit-spot.md: 135 frames in 75 s on BTCUSDT, mean 0.56 s, longest silence 2.0 s; measured on one machine, not on production; git f83d0fc; no_update after 5 min: the longest spell 79 s, inside a bus outage (2026-10-06 13:20Z), none over 65 s (the history window) without one, the least traded of 10 included, 2026-10-05 to 10-08; twice it is 158 s |\n| BYBIT-SPOT | ticker (ticker, book prices) | on change hb | 3 s | documented | publication | WS orderbook.1 (the best level) on every change and again after 3 s without one (docs websocket/public/orderbook; bybit-spot.md: 531 frames in 75 s, longest silence 2.99 s), dated by its ts, with the last price of tickers (longest silence 2.0 s); git f83d0fc |\n| COINBASE-INTX | funding (funding) | settle | the listing's (registry) | measured | settlement | a settled rate, good until the next settlement: source_time is the settlement, the venue publishes the interval (funding_interval, measured 1 h, coinbase-perp.md:243) |\n| COINBASE-INTX | mark (mark) | poll | 2 s | **assumed** | publication | published by the 2 s quote loop that carries the ticker (the declared 30 s loop only repeats it); the interval is the adapter's, not measured on production; task 128 |\n| COINBASE-INTX | open-interest (oi) | poll | 15 s | measured | publication | REST /instruments every 15 s; rows 15.0/15.8 s; git 5076512 |\n| COINBASE-INTX | stats (stats) | poll | 60 s | **assumed** | publication | REST bulk /instruments row (qty_24hr, notional_24hr, dated by its quote timestamp) read by the 60 s loop the adapter declares; not measured on production; git 37647d0 |\n| COINBASE-INTX | ticker (ticker, book prices) | poll | 2 s | **assumed** | publication | REST quote every 2 s, 24 listings at 12 requests a second against a budget of 20 (the one-second loop of 0048 needed 24 a second); the interval is the adapter's, not measured on production; task 128 |\n| DERIBIT-PERP | depth-derived (book bands) | on change | — | measured | publication | Public book channel emits full top-10 snapshots with venue update id change_id and a timestamp. The id may jump and does not count intervening updates or link deltas. Top-10 is not full-depth. |\n| DERIBIT-PERP | funding (funding) | on change | — | documented | publication | Coinbase/Deribit migration documentation: continuous accrual and 8-hour-normalized published rate; no next settlement instant. |\n| DERIBIT-PERP | mark (mark) | on change | — | measured | publication | Official Coinbase Derivatives ticker publishes mark_price and index_price with venue timestamps; mark is dated by that publication. |\n| DERIBIT-PERP | open-interest (oi) | on change | — | measured | publication | Official Coinbase Derivatives public ticker carries open_interest and a venue timestamp. |\n| DERIBIT-PERP | stats (stats) | on change | — | measured | publication | Official Coinbase Derivatives public ticker carries trailing 24-hour stats and a venue timestamp. |\n| DERIBIT-PERP | ticker (ticker, book prices) | on change | — | measured | publication | Official Coinbase Derivatives public ticker channel observed on the authenticated-free gateway; venue timestamps are published with updates. 5-minute no-update threshold is conservative and not a venue guarantee. |\n| DYDX-PERP | depth-derived (book bands) | stream | 250 ms | documented | none | WS v4_orderbook batches every 250 ms: dydx-perp.md:229; git c338165 |\n| DYDX-PERP | funding (funding) | settle | the listing's (registry) | measured | settlement | a settled rate, good until the next settlement: hourly settlement measured (dydx-perp.md:103), source_time is the settlement's effectiveAt |\n| DYDX-PERP | open-interest (oi) | on change | — | measured | none | WS v4_markets: the trading update comes every 30 s (49 in 25 minutes, 27.1-32.4 s, live 2026-10-01 11:24-11:49Z) but lists only the markets whose field changed: openInterest was listed for 4 of 25 assigned markets in 25 minutes, for the other 21 never after the reply; the value holds while the connection lives; no venue time in the frame; 0062 (on_change_hb, 30 s) rested on an adapter that republished the held value at each update, a forward fill under the tick's clock, rolled back the same day (the republishing commit was f4ccb90); no_update after 24 h: a market's figure is named only when it moves, and the quiet markets stand for hours with the connection alive: the longest spell without a new value, no break of the markets socket and no restart in it, 38 828 s (AVAX-USD, 2026-10-04 08:57-19:44Z), PEPE-USD (the least traded, USD 1 thousand a day) 35 045 s, BTC-USD 5 530 s, 2026-10-01 to 10-08; twice it is 21.6 h |\n| DYDX-PERP | stats (stats) | on change | — | measured | none | the same trading update, carrying volume24H (the 24 h notional in USD): listed for 10 of 25 assigned markets in 25 minutes, for 15 never after the reply; the value holds while the connection lives; no venue time in the frame; was on_change_hb in 0062, see open interest; no_update after 36 h: the longest quiet spell 54 096 s (XLM-USD, USD 7 thousand a day, 2026-10-04 11:44Z to 10-05 02:45Z), UNI-USD 51 271 s, BTC-USD 1 834 s, 2026-10-01 to 10-08; twice it is 30.1 h |\n| DYDX-PERP | ticker (ticker, book prices) | derived from depth-derived | — | documented | none | the host assembles the ticker from the book; git c338165 |\n| EDGEX-PERP | depth-derived (book bands) | on change | — | measured | none | docs/engineering/venues/edgex-perp.md: 30-second BTC/ETH WS capture; no publication timestamp or fixed cadence. No-update threshold assumed 5 minutes, longer than the 30-second socket watchdog; not a measured guarantee. |\n| EDGEX-PERP | funding (funding) | settle | the listing's (registry) | documented | settlement | docs/engineering/venues/edgex-perp.md: metadata fundingRateIntervalMin per listing; settled ticker rate dated by fundingTime. |\n| EDGEX-PERP | mark (mark) | on change | — | measured | none | docs/engineering/venues/edgex-perp.md: 30-second BTC/ETH WS capture; no publication timestamp or fixed cadence. No-update threshold assumed 5 minutes, longer than the 30-second socket watchdog; not a measured guarantee. |\n| EDGEX-PERP | open-interest (oi) | on change | — | measured | none | docs/engineering/venues/edgex-perp.md: 30-second BTC/ETH WS capture; no publication timestamp or fixed cadence. No-update threshold assumed 5 minutes, longer than the 30-second socket watchdog; not a measured guarantee. |\n| EDGEX-PERP | stats (stats) | on change | — | measured | none | docs/engineering/venues/edgex-perp.md: 30-second BTC/ETH WS capture; no publication timestamp or fixed cadence. No-update threshold assumed 5 minutes, longer than the 30-second socket watchdog; not a measured guarantee. |\n| EDGEX-PERP | ticker (ticker, book prices) | derived from depth-derived | — | documented | none | docs/engineering/venues/edgex-perp.md: recorded ticker updates omit quotes; existing host builds ticker from live book and tape. Verified by 30-second live gate on five symbols, including reconnect. |\n| GATE-PERP | depth-derived (book bands) | stream | 100 ms | measured | publication | WS futures.order_book, 100 levels without aggregation: a full book on each change, about every 100 ms (gate-perp.md, depth-raw; live 2026-09-30), dated by t; was REST order_book every 300 s; git d20998a |\n| GATE-PERP | funding (funding) | stream | 13 s | **assumed** | publication | WS futures.tickers ≈1/s by the adapter (:14-15), not in the venue card; rows (OI) 10/13 s; git c4b1eda |\n| GATE-PERP | mark (mark) | stream | 13 s | **assumed** | publication | the WS futures.tickers frame that carries the venue's funding and open-interest (mark_price and index_price, dated by its t): their fact, ≈1/s by the adapter, not in the venue card; git 8599467 |\n| GATE-PERP | open-interest (oi) | stream | 13 s | **assumed** | publication | WS futures.tickers ≈1/s by the adapter (:14-15), not in the venue card; rows (OI) 10/13 s; git c4b1eda |\n| GATE-PERP | stats (stats) | stream | 13 s | **assumed** | publication | the WS futures.tickers frame that carries the venue's funding, open-interest and mark (volumes, high, low, change, dated by its t): their fact, ≈1/s by the adapter, not in the venue card; git fbf7eb4 |\n| GATE-PERP | ticker (ticker, book prices) | on change | — | **assumed** | publication | WS futures.book_ticker: every change of the best level (adapter :14); git c4b1eda; no_update after 10 min: the longest spell without a new value 185 s (TRX_USDT, the least traded of 25, 2026-10-06 15:16-15:19Z), no break in it, 2026-10-05 to 10-08; twice it is 370 s |\n| GMX-PERP | funding (funding) | poll | 15 s | documented | none | REST arbitrum.gmxapi.io every 15 s, venue cache 0.3–1 s: gmx-perp.md:54; no venue time; git b49e1ee |\n| GMX-PERP | mark (mark) | poll | 15 s | **assumed** | none | markPrice of the /markets/tickers message that carries the ticker, REST every 15 s (the adapter's SnapshotIntervalSeconds): its fact (gmx-perp.md:54), not measured apart; no venue time; git 81af140 |\n| GMX-PERP | open-interest (oi) | poll | 15 s | documented | none | REST arbitrum.gmxapi.io every 15 s, venue cache 0.3–1 s: gmx-perp.md:54; no venue time; git b49e1ee |\n| GMX-PERP | stats (stats) | poll | 15 s | documented | none | REST arbitrum.gmxapi.io every 15 s, venue cache 0.3–1 s: gmx-perp.md:54; no venue time; git b49e1ee |\n| GMX-PERP | ticker (ticker, book prices) | poll | 15 s | documented | none | REST arbitrum.gmxapi.io every 15 s, venue cache 0.3–1 s: gmx-perp.md:54; no venue time; git b49e1ee |\n| HYPERLIQUID | depth-derived (book bands) | stream | 6 s | measured | publication | hyperliquid.md:97-101: the book per block, measured ≈5 s; rows 5/6 s; git 7724303 |\n| HYPERLIQUID | funding (funding) | poll | 60 s | **assumed** | none | activeAssetCtx + REST predictedFundings every 60 s; its next_funding_at is in the past (a known defect) and is not used; git 7724303 |\n| HYPERLIQUID | mark (mark) | on change | — | **assumed** | none | activeAssetCtx: cadence undocumented, looks like on change; no venue time in the frame; git 7724303; no_update after 5 min: the longest spell 120 s, every listing at once (2026-10-08 17:58-18:00Z), none over 65 s (the history window) otherwise, the least traded of 25 (TRX) included, 2026-10-05 to 10-08; twice it is 240 s |\n| HYPERLIQUID | open-interest (oi) | on change | — | **assumed** | none | activeAssetCtx: cadence undocumented, looks like on change; no venue time in the frame; git 7724303; no_update after 5 min: the longest spell 120 s, every listing at once (2026-10-08 17:58-18:00Z), none over 65 s (the history window) otherwise, the least traded of 25 (TRX) included, 2026-10-05 to 10-08; twice it is 240 s |\n| HYPERLIQUID | stats (stats) | on change | — | **assumed** | none | activeAssetCtx: cadence undocumented, looks like on change; no venue time in the frame; git 7724303; no_update after 5 min: the longest spell 120 s, every listing at once (2026-10-08 17:58-18:00Z), none over 65 s (the history window) otherwise, the least traded of 25 (TRX) included, 2026-10-05 to 10-08; twice it is 240 s |\n| HYPERLIQUID | ticker (ticker, book prices) | stream | 2500 ms | measured | publication | hyperliquid.md:64: bbo ≈7.9/s; production 24 h: rows 1.01/2.50 s (1 s window); git 7724303 |\n| KRAKEN-FUTURES | depth-derived (book bands) | stream | 1 s | measured | publication | kraken-futures.md:151: ≈847 book frames/s; the host publishes depth-derived at most once a second; rows 1.00/1.00 s; git 2dfea5a |\n| KRAKEN-FUTURES | funding (funding) | on change | — | measured | publication | the same ticker frame (kraken-futures.md:149), only on change; git 6ac5963; no_update after 10 min: the longest spell without a new value, no break and no restart in it, 157 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 462 s inside the outage of 2026-10-06 07:00-07:08Z (bus_unavailable, ws_disconnected); the least traded (PF_GBPUSD, PF_CHFUSD, no volume) none over 65 s, 2026-10-05 to 10-08; twice it is 314 s |\n| KRAKEN-FUTURES | mark (mark) | on change | — | measured | publication | the same ticker frame (kraken-futures.md:149), only on change; git 6ac5963; no_update after 10 min: the longest spell without a new value, no break and no restart in it, 157 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 462 s inside the outage of 2026-10-06 07:00-07:08Z (bus_unavailable, ws_disconnected); the least traded (PF_GBPUSD, PF_CHFUSD, no volume) none over 65 s, 2026-10-05 to 10-08; twice it is 314 s |\n| KRAKEN-FUTURES | open-interest (oi) | on change | — | measured | publication | the same ticker frame (kraken-futures.md:149), only on change; git 6ac5963; no_update after 10 min: the longest spell without a new value, no break and no restart in it, 157 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 462 s inside the outage of 2026-10-06 07:00-07:08Z (bus_unavailable, ws_disconnected); the least traded (PF_GBPUSD, PF_CHFUSD, no volume) none over 65 s, 2026-10-05 to 10-08; twice it is 314 s |\n| KRAKEN-FUTURES | stats (stats) | on change | — | measured | publication | the same ticker frame (kraken-futures.md:149); git 35c7fe7; no_update after 10 min: the longest spell without a new value, no break and no restart in it, 157 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 462 s inside the outage of 2026-10-06 07:00-07:08Z (bus_unavailable, ws_disconnected); the least traded (PF_GBPUSD, PF_CHFUSD, no volume) none over 65 s, 2026-10-05 to 10-08; twice it is 314 s |\n| KRAKEN-FUTURES | ticker (ticker, book prices) | on change | — | measured | publication | kraken-futures.md:149: the ticker frame, ≈3.25/s, only on change; production 24 h to 2026-09-29: rows 1.06/2.28 s; git d7f4d61; no_update after 10 min, as the rest of the ticker frame: the longest quiet spell 111 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 434 s inside the outage of 2026-10-06 07:00-07:08Z; the least traded none over 65 s, 2026-10-05 to 10-08 |\n| LIGHTER-PERP | depth-derived (book bands) | on change | — | measured | publication | docs/engineering/venues/lighter-perp.md: Host-derived from snapshot/deltas: BTC 466 and ETH 436 updates in 30 seconds. No-update threshold assumed 5 minutes, longer than the 90-second watchdog; not a measured guarantee. |\n| LIGHTER-PERP | funding (funding) | settle | the listing's (registry) | documented | settlement | docs/engineering/venues/lighter-perp.md: https://docs.lighter.xyz/trading/funding: hourly settlement; funding_timestamp is its source time. |\n| LIGHTER-PERP | mark (mark) | on change | — | measured | publication | docs/engineering/venues/lighter-perp.md: 30-second market_stats capture: BTC 30 and ETH 28 updates; no guaranteed fixed interval. No-update threshold assumed 5 minutes, longer than the 90-second watchdog; not a measured guarantee. |\n| LIGHTER-PERP | open-interest (oi) | poll | 15 s | **assumed** | none | docs/engineering/venues/lighter-perp.md: REST orderBookDetails every 15 seconds, native quantity; no publication timestamp. |\n| LIGHTER-PERP | stats (stats) | on change | — | measured | publication | docs/engineering/venues/lighter-perp.md: 24-hour statistics on the same captured market_stats channel. No-update threshold assumed 5 minutes, longer than the 90-second watchdog; not a measured guarantee. |\n| LIGHTER-PERP | ticker (ticker, book prices) | on change | — | measured | publication | docs/engineering/venues/lighter-perp.md: 30-second WS capture: BTC 322 and ETH 492 ticker updates; no guaranteed fixed interval. No-update threshold assumed 5 minutes, longer than the 90-second watchdog; not a measured guarantee. |\n| MEXC-PERP | depth-derived (book bands) | stream | 250 ms | measured | publication | WS sub.depth.full, 50 levels: a full book about every 250 ms (mexc-perp.md, live 2026-09-30); was REST every 600 s; git 5f61088 |\n| MEXC-PERP | funding (funding) | on change hb | 60 s | measured | publication | WS sub.funding.rate: the first frame about 20 s after the subscription, then once a minute or on change (mexc-perp.md, live 2026-09-30), dated by the frame's ts; was REST every 60 s; git 5f61088 |\n| MEXC-PERP | mark (mark) | stream | 11400 ms | **assumed** | publication | the WS sub.ticker frame that carries the venue's ticker (fairPrice and indexPrice, dated by the frame's timestamp): its fact; git e473ed5 |\n| MEXC-PERP | open-interest (oi) | stream | 11400 ms | **assumed** | publication | the WS sub.ticker frame that carries the venue's ticker (holdVol, dated by the frame's timestamp): its fact; git e473ed5 |\n| MEXC-PERP | stats (stats) | stream | 11400 ms | **assumed** | publication | the WS sub.ticker frame that carries the venue's ticker, mark and open-interest (volume24, amount24, high, low, dated by the frame's timestamp): their fact; git ccb0c59 |\n| MEXC-PERP | ticker (ticker, book prices) | stream | 11400 ms | **assumed** | publication | WS sub.ticker \"several times a second\": the adapter (:12-13); rows 10.8/11.4 s; git f2cf05b |\n| NADO-PERP | depth-derived (book bands) | stream | 12 s | **assumed** | publication | WS: undocumented; rows 10/12 s; git e071473 |\n| NADO-PERP | funding (funding) | stream | 20 s | documented | none | recomputed ≈ every 20 s: nado-perp.md:210; source_time is the last settlement, so the value is dated by receipt; git e071473 |\n| NADO-PERP | mark (mark) | poll | 15 s | **assumed** | none | REST /v2/contracts every 15 s (the adapter's MarkPollIntervalSeconds); the page carries no venue time; not measured on production; git c4ce646 |\n| NADO-PERP | open-interest (oi) | poll | 15 s | **assumed** | none | REST /v2/contracts every 15 s, the one cycle of mark, open interest and stats (the adapter's ContractsPollIntervalSeconds); the page carries no venue time; not measured on production; was every 60 s; git 3d3a1b9 |\n| NADO-PERP | stats (stats) | poll | 15 s | **assumed** | none | REST /v2/contracts every 15 s, the page that carries mark and open interest (the adapter's ContractsPollIntervalSeconds); the page carries no venue time; not measured on production; git 3d3a1b9 |\n| NADO-PERP | ticker (ticker, book prices) | derived from depth-derived | — | **assumed** | publication | the host assembles the ticker from the book; git e071473 |\n| OKX-PERP | depth-derived (book bands) | stream | 130 ms | measured | publication | okx-perp.md:79: 148 frames in ≈19 s; git 187383c |\n| OKX-PERP | funding (funding) | stream | 90 s | measured | publication | okx-perp.md:89,92: every 30–90 s; rows 60/86 s; git 187383c |\n| OKX-PERP | mark (mark) | on change hb | 10 s | documented | publication | okx-perp.md:90-91: within 200 ms of a change, otherwise every 10 s; git 187383c |\n| OKX-PERP | open-interest (oi) | stream | 20 s | **assumed** | publication | WS open-interest: undocumented; rows 13.2/20.0 s; git 187383c |\n| OKX-PERP | stats (stats) | stream | 150 ms | **assumed** | publication | the tickers channel that carries the venue's ticker (vol24h, open24h, high24h, low24h, dated by the frame's ts): its fact (okx-perp.md:71, ≈6.5 frames/s), not measured apart; git 6765c89 |\n| OKX-PERP | ticker (ticker, book prices) | stream | 150 ms | measured | publication | okx-perp.md:71: ≈6.5 frames/s; git 187383c |\n| OKX-SPOT | depth-derived (book bands) | on change | — | documented | publication | WS books: incremental data is pushed every 100 ms for the changes in the order book during that period (docs ws order book channel), a book that did not change pushes nothing; okx-spot.md: 620 frames in 75 s on BTC-USDT, mean 119 ms, longest silence 0.60 s; git 926ab2d; no_update after 5 min, as the ticker: the book moves whenever its best level does, so it is never quieter than the ticker; its bands are not kept in history at the listings' group to measure apart |\n| OKX-SPOT | stats (stats) | on change | — | documented | publication | the same tickers frame as the ticker layer (okx-spot.md), only on change; git 926ab2d; no_update after 5 min: the longest spell 74 s, inside a bus outage (2026-10-07 19:42Z), none over 65 s (the history window) without one, the least traded of 10 included, 2026-10-05 to 10-08; twice it is 148 s |\n| OKX-SPOT | ticker (ticker, book prices) | on change | — | documented | publication | WS tickers: the fastest rate is 1 update per 100 ms and there is no update when nothing triggered one, a trade or a change of the best bid or ask (docs ws tickers channel); okx-spot.md: 468 frames in 75 s on BTC-USDT, longest silence 0.48 s, 370 on LINK-USDT, 0.70 s; git 926ab2d; no_update after 5 min: the longest spell without a new value 41 s over 10 listings, the least traded (LTC-USDT) included, 2026-10-05 to 10-08; twice it is 82 s |\n| SYNTHETIX-PERP | depth-derived (book bands) | stream | 35 s | **assumed** | publication | WS: undocumented, a thin book; rows 10/35 s; git 6756c33 |\n| SYNTHETIX-PERP | funding (funding) | stream | 1 s | measured | publication | WS marketPrices ≈1/s: synthetix-perp.md:96; git 6756c33 |\n| SYNTHETIX-PERP | mark (mark) | stream | 1 s | measured | publication | WS marketPrices ≈1/s: synthetix-perp.md:96; git 6756c33 |\n| SYNTHETIX-PERP | open-interest (oi) | poll | 15 s | measured | publication | REST every 15 s; rows 15.0/15.3 s; git e3c946c |\n| SYNTHETIX-PERP | stats (stats) | poll | 15 s | measured | publication | REST every 15 s; rows 15.0/15.3 s; git e3c946c |\n| SYNTHETIX-PERP | ticker (ticker, book prices) | derived from depth-derived | — | **assumed** | publication | the host assembles the ticker from a thin book; git 6756c33 |\n| WEEX-FUTURES | depth-derived (book bands) | stream | 10 s | **assumed** | publication | WS depth200: undocumented; rows 10/10 s (10 s window); git 581b41f |\n| WEEX-FUTURES | funding (funding) | poll | 60 s | measured | none | REST every 60 s (F-01); rows 60/61 s; git f4e309c |\n| WEEX-FUTURES | mark (mark) | stream | 10 s | **assumed** | publication | moved from the REST /tickers poll to the ticker channel that carries stats (m and i, dated by E), so it has the fact of stats: a frame about every 0.6 s (weex-futures.md), interval as depth-derived, not measured on production; git ed1c5f2 |\n| WEEX-FUTURES | open-interest (oi) | poll | 300 s | measured | none | REST every 300 s; rows 300/304 s; git 581b41f |\n| WEEX-FUTURES | stats (stats) | stream | 10 s | **assumed** | publication | the ticker channel of the v3 socket (weex-futures.md: a frame about every 0.6 s, dated by E); interval as the venue's other push layer, depth-derived (the 10 s history window), not measured on production; git 0cf2f5a |\n| WEEX-FUTURES | ticker (ticker, book prices) | derived from depth-derived | — | **assumed** | publication | the host assembles the ticker from the book; git 43a01e7 |\n\n## Values pushed only on change\n\n37 pairs come only when the value changes, and their horizon is the connection. Each has a **no-update\nthreshold**: how long its anchor (`anchor` above) may stand still on a live connection before the value is stale,\n`no_update`. It is measured on production per pair, from the longest spell any listing of the pair went without a new\nvalue over several days — breaks of the connection set aside — and checked against the least traded listings\ncollected, so that a quiet market that is alive is not called stale; what each rests on is in its row. The socket a\nvalue comes on is watched as well: when nothing at all arrives on it — no data, no reply, no heartbeat of the venue, no\nanswer to our keepalive — for longer than the venue guarantees it speaks (`silent socket after`), the collector treats\nit as lost and reconnects, and every value on it is `connection_lost`, not `no_update`. A protocol-level ping of the\nvenue does not count: it never reaches the collector. `—`: the socket is not watched.\n\n| venue | dataset (layer) | no-update threshold | silent socket after | what the threshold rests on |\n| --- | --- | --- | --- | --- |\n| ASTER-PERP | stats (stats) | 6 h | 60 s | no_update after 6 h: the longest spell without a new value, no break of the connection and no restart in it, 7 681 s (TRXUSDT, the least traded of 26 at USD 61 thousand a day, 2026-10-03 02:38-04:46Z; 59 spells over 30 minutes of TRXUSDT alone, and every spell that long is of a listing under USD 1.5 million a day; BTCUSDT and ETHUSDT none over 65 s), 2026-10-01 to 10-08; twice it is 4.3 h |\n| ASTER-PERP | ticker (ticker, book prices) | 1 h | 60 s | no_update after 1 h: the longest quiet spell 1 595 s (TRXUSDT, the least traded, 2026-10-04 02:31-02:58Z; DOTUSDT, the next, 240 s), 2026-10-01 to 10-08; twice it is 53 minutes |\n| BINANCE-SPOT | depth-derived (book bands) | 5 min | 60 s | no_update after 5 min, as the ticker: the top twenty moves whenever the best level does (it is the same book), so it is never quieter than the book ticker; its bands are not kept in history at the listings' group to measure apart |\n| BINANCE-SPOT | stats (stats) | 5 min | 60 s | no_update after 5 min: the longest spell without a new value 115 s (HYPEUSDC, the least traded of 12, 2026-10-07 22:54Z), no break in it, 2026-10-05 to 10-08; twice it is 230 s |\n| BINANCE-SPOT | ticker (ticker, book prices) | 5 min | 60 s | no_update after 5 min: the longest spell 103 s, inside a bus outage (2026-10-07 12:19Z), 74 s without one (HYPEUSDC, the least traded of 12), 2026-10-05 to 10-08; twice it is 206 s |\n| BINANCE-USDM | ticker (ticker, book prices) | 5 min | 60 s | no_update after 5 min: the longest spell without a new value 58 s over 44 listings (BCHUSDC, the least traded at USD 6 million a day, among them), 2026-10-05 to 10-08; twice it is 116 s |\n| BITUNIX-PERP | stats (stats) | 5 min | 30 s | — |\n| BITUNIX-PERP | ticker (ticker, book prices) | 5 min | 30 s | — |\n| BYBIT-SPOT | stats (stats) | 5 min | 60 s | no_update after 5 min: the longest spell 79 s, inside a bus outage (2026-10-06 13:20Z), none over 65 s (the history window) without one, the least traded of 10 included, 2026-10-05 to 10-08; twice it is 158 s |\n| DERIBIT-PERP | depth-derived (book bands) | 5 min | 60 s | — |\n| DERIBIT-PERP | funding (funding) | 5 min | 60 s | — |\n| DERIBIT-PERP | mark (mark) | 5 min | 60 s | — |\n| DERIBIT-PERP | open-interest (oi) | 5 min | 60 s | — |\n| DERIBIT-PERP | stats (stats) | 5 min | 60 s | — |\n| DERIBIT-PERP | ticker (ticker, book prices) | 5 min | 60 s | — |\n| DYDX-PERP | open-interest (oi) | 24 h | 120 s | no_update after 24 h: a market's figure is named only when it moves, and the quiet markets stand for hours with the connection alive: the longest spell without a new value, no break of the markets socket and no restart in it, 38 828 s (AVAX-USD, 2026-10-04 08:57-19:44Z), PEPE-USD (the least traded, USD 1 thousand a day) 35 045 s, BTC-USD 5 530 s, 2026-10-01 to 10-08; twice it is 21.6 h |\n| DYDX-PERP | stats (stats) | 36 h | 120 s | no_update after 36 h: the longest quiet spell 54 096 s (XLM-USD, USD 7 thousand a day, 2026-10-04 11:44Z to 10-05 02:45Z), UNI-USD 51 271 s, BTC-USD 1 834 s, 2026-10-01 to 10-08; twice it is 30.1 h |\n| EDGEX-PERP | depth-derived (book bands) | 5 min | 30 s | — |\n| EDGEX-PERP | mark (mark) | 5 min | 30 s | — |\n| EDGEX-PERP | open-interest (oi) | 5 min | 30 s | — |\n| EDGEX-PERP | stats (stats) | 5 min | 30 s | — |\n| GATE-PERP | ticker (ticker, book prices) | 10 min | 60 s | no_update after 10 min: the longest spell without a new value 185 s (TRX_USDT, the least traded of 25, 2026-10-06 15:16-15:19Z), no break in it, 2026-10-05 to 10-08; twice it is 370 s |\n| HYPERLIQUID | mark (mark) | 5 min | 90 s | no_update after 5 min: the longest spell 120 s, every listing at once (2026-10-08 17:58-18:00Z), none over 65 s (the history window) otherwise, the least traded of 25 (TRX) included, 2026-10-05 to 10-08; twice it is 240 s |\n| HYPERLIQUID | open-interest (oi) | 5 min | 90 s | no_update after 5 min: the longest spell 120 s, every listing at once (2026-10-08 17:58-18:00Z), none over 65 s (the history window) otherwise, the least traded of 25 (TRX) included, 2026-10-05 to 10-08; twice it is 240 s |\n| HYPERLIQUID | stats (stats) | 5 min | 90 s | no_update after 5 min: the longest spell 120 s, every listing at once (2026-10-08 17:58-18:00Z), none over 65 s (the history window) otherwise, the least traded of 25 (TRX) included, 2026-10-05 to 10-08; twice it is 240 s |\n| KRAKEN-FUTURES | funding (funding) | 10 min | 60 s | no_update after 10 min: the longest spell without a new value, no break and no restart in it, 157 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 462 s inside the outage of 2026-10-06 07:00-07:08Z (bus_unavailable, ws_disconnected); the least traded (PF_GBPUSD, PF_CHFUSD, no volume) none over 65 s, 2026-10-05 to 10-08; twice it is 314 s |\n| KRAKEN-FUTURES | mark (mark) | 10 min | 60 s | no_update after 10 min: the longest spell without a new value, no break and no restart in it, 157 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 462 s inside the outage of 2026-10-06 07:00-07:08Z (bus_unavailable, ws_disconnected); the least traded (PF_GBPUSD, PF_CHFUSD, no volume) none over 65 s, 2026-10-05 to 10-08; twice it is 314 s |\n| KRAKEN-FUTURES | open-interest (oi) | 10 min | 60 s | no_update after 10 min: the longest spell without a new value, no break and no restart in it, 157 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 462 s inside the outage of 2026-10-06 07:00-07:08Z (bus_unavailable, ws_disconnected); the least traded (PF_GBPUSD, PF_CHFUSD, no volume) none over 65 s, 2026-10-05 to 10-08; twice it is 314 s |\n| KRAKEN-FUTURES | stats (stats) | 10 min | 60 s | no_update after 10 min: the longest spell without a new value, no break and no restart in it, 157 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 462 s inside the outage of 2026-10-06 07:00-07:08Z (bus_unavailable, ws_disconnected); the least traded (PF_GBPUSD, PF_CHFUSD, no volume) none over 65 s, 2026-10-05 to 10-08; twice it is 314 s |\n| KRAKEN-FUTURES | ticker (ticker, book prices) | 10 min | 60 s | no_update after 10 min, as the rest of the ticker frame: the longest quiet spell 111 s (PF_USDCUSD, 2026-10-05 02:44Z) over 198 listings, 434 s inside the outage of 2026-10-06 07:00-07:08Z; the least traded none over 65 s, 2026-10-05 to 10-08 |\n| LIGHTER-PERP | depth-derived (book bands) | 5 min | 90 s | — |\n| LIGHTER-PERP | mark (mark) | 5 min | 90 s | — |\n| LIGHTER-PERP | stats (stats) | 5 min | 90 s | — |\n| LIGHTER-PERP | ticker (ticker, book prices) | 5 min | 90 s | — |\n| OKX-SPOT | depth-derived (book bands) | 5 min | 45 s | no_update after 5 min, as the ticker: the book moves whenever its best level does, so it is never quieter than the ticker; its bands are not kept in history at the listings' group to measure apart |\n| OKX-SPOT | stats (stats) | 5 min | 45 s | no_update after 5 min: the longest spell 74 s, inside a bus outage (2026-10-07 19:42Z), none over 65 s (the history window) without one, the least traded of 10 included, 2026-10-05 to 10-08; twice it is 148 s |\n| OKX-SPOT | ticker (ticker, book prices) | 5 min | 45 s | no_update after 5 min: the longest spell without a new value 41 s over 10 listings, the least traded (LTC-USDT) included, 2026-10-05 to 10-08; twice it is 82 s |\n\n## Ages counted from our receipt\n\n32 pairs count a value's age from our receipt, because the venue's timestamp, where it sends one, dates\nsomething other than the value (`venue time dates: none` above): ASTER-PERP open-interest, AVANTIS-PERP funding, AVANTIS-PERP open-interest, AVANTIS-PERP venue-depth, BINANCE-SPOT depth-derived, BINANCE-SPOT ticker, BITUNIX-PERP funding, DYDX-PERP depth-derived, DYDX-PERP open-interest, DYDX-PERP stats, DYDX-PERP ticker, EDGEX-PERP depth-derived, EDGEX-PERP mark, EDGEX-PERP open-interest, EDGEX-PERP stats, EDGEX-PERP ticker, GMX-PERP funding, GMX-PERP mark, GMX-PERP open-interest, GMX-PERP stats, GMX-PERP ticker, HYPERLIQUID funding, HYPERLIQUID mark, HYPERLIQUID open-interest, HYPERLIQUID stats, LIGHTER-PERP open-interest, NADO-PERP funding, NADO-PERP mark, NADO-PERP open-interest, NADO-PERP stats, WEEX-FUTURES funding, WEEX-FUTURES open-interest.\nEvery other pair counts from the venue's timestamp, and falls back to our receipt only for a value that arrives\nwithout one.\n\nThe `-SPOT` venues are collected and shown in the site and `/v2` market-data endpoints. Since change set 37,\n`/v2/venues`, `/v2/instruments` and measurement requests support `kind=spot` or `kind=all`; DQL and Agent\nremain perpetual-only. The retired public market-data `/v1` routes no longer serve these rows.\n\nThe history before 2026-09-26 is covered by facts reconstructed from the platform's own record of how each\nvenue was collected, labelled assumed; the page shows the version in force now.\n\n\n# Limits\n\nEvery limit below is served as data by `GET /v2/dql/catalogue`. Read it from there rather than carrying\na copy: these are what the platform runs on today, and a client that hard-codes them will be wrong on\nthe day they change. The sentences here say what to do when you meet one.\n\nNothing is silently truncated. A request past a limit is refused with `DQL_LIMIT` or `DQL_COMPLEXITY`\nand the message states both your figure and the ceiling — because a short answer that looks complete is\nworse than a refusal.\n\n## What a query may be\n\n| limit | value | what it means |\n| --- | --- | --- |\n| `source_bytes` | 8,192 | The longest query text accepted. |\n| `nodes` | 256 | Nodes in the parsed query. A condition with dozens of clauses meets this before it meets anything else. |\n| `depth` | 24 | How deeply the expression may nest. |\n| `quantifiers_and_aggregates` | 16 | How many `any`, `all`, `count`, `max`, `min` and `sum` one query may hold together. |\n| `series_calls` | 32 | How many series functions one query may call. |\n| `timeframes` | 3 | How many different periods one query may read. Reading three is a heavy query; reading four is a different question asked twice. |\n| `window` | 500 | The largest window a series function may ask for, in periods — `sma(close, 500)` is the longest average there is. |\n| `bars_per_atom` | 2,000 | The most bars one series read may cost. |\n| `cost` | 10,000 | What the whole query may cost. `POST /v2/dql/parse` returns a query's cost without running it, so this can be seen before it is hit. |\n| `in_list` | 32 | The longest `in (…)` list. |\n| `select` | 16 | How many values one `select` may return. |\n| `order_by` | 4 | How many keys one `order by` may have. |\n| `reference_targets` | 4 | How many different listings `ref(INSTRUMENT, expr [, VENUE])` may read in one query: distinct (instrument, venue) pairs, where `ref(X, …)` without a venue is the pair (X, the venue evaluated). |\n| `freshness_min` | 1 s | The shortest freshness bound a query may set. Below this you are asking about jitter, not about staleness. |\n| `freshness_max` | 7 d | The longest. Past it, `stale` stops meaning anything. |\n| `screen_limit` | 500 | The largest page `POST /v2/screen` returns. Use `page.next_cursor` for the rest; the cursor pins the instant, so page two sees the world page one saw. |\n| `screen_sampled_rows` | 150,000 | The stored rows the sampled series of one screen may read: selected listings × the window of each sampled field ÷ its retained granularity (a row a second; funding, a row per ten seconds). A 60-bar hourly series of a ticker field is 219,600 rows per listing. Narrow `where`, or read candles, which cost a row per bar. |\n\n## What one request may ask for\n\n| limit | value | endpoint |\n| --- | --- | --- |\n| `snapshots_listings` | 500 | `POST /v2/snapshots` — or every listing of a single venue, however many that is. |\n| `history_listings` | 100 | `POST /v2/snapshots/history`. |\n| `history_rows_per_layer` | 2,000 | `POST /v2/snapshots/history`, in `interval` and `at` modes. |\n| `history_raw_rows` | 100,000 | `POST /v2/snapshots/history`, in `raw` mode, across every listing and layer together. |\n| `candles_listings` | 100 | `POST /v2/candles`. |\n| `candles_per_listing` | 1,500 | `POST /v2/candles`. |\n| `liquidations_listings` | 100 | `POST /v2/liquidations`. |\n| `liquidations_per_listing` | 1,000 | `POST /v2/liquidations` — the newest events of each listing; `truncated` says there were more. |\n| `liquidations_window` | 7 d | `POST /v2/liquidations` — the longest `(from, to]` one request reads. Without `from`, an hour. |\n| `settlements_listings` | 500 | `GET /v2/funding/settlements`. |\n| `settlements_per_page` | 1,000 | `GET /v2/funding/settlements` — rows of a page (500 by default); follow `next_cursor` for the rest. |\n| `books_listings` | 100 | `POST /v2/books`. |\n| `book_depth` | 25 | `POST /v2/books` — levels per side. A larger `depth` is clamped to this and the answer states what was applied. |\n| `stream_listings` | 500 | `GET /v2/stream` — listings on one connection. |\n| `response_bytes` | 8,388,608 | Any endpoint. A response that would be larger is refused rather than cut. |\n\n## Plan limits are a different thing\n\nThe numbers above are the same for everyone: they are what one request may ask the platform to do at\nonce. How far back you may look, how often you may ask, and how many streams you may hold are set by\nthe plan, and are refused with `PLAN_LIMIT` or `RATE_LIMITED` instead. A `429` carries `Retry-After`.\n\n## The per-second limit is a token bucket\n\nEach key has a bucket that holds up to its **burst** and is refilled at the plan's **sustained** rate, in requests a second. A client that has been quiet may send a burst at once (an AI client's three to five parallel calls), then is held to the sustained rate. The burst is 4 times the rate, and at least 10: Free is 2 a second sustained and a burst of 10, Mini 5 and 20. Both numbers are in `GET /v2/plans` (`requests_per_second`, `requests_burst`) and, for your own account, in `limits` of `GET /v2/account`.\n\nWhen the bucket is empty the request is a `429` `RATE_LIMITED` with `limit` set to `requests_per_second` and a `Retry-After` of the seconds until a token is back. The other plan limits keep their own names in `limit`: `requests_per_day`, `dql_per_minute` (a bucket of its own, per minute) and `stream_connections`.\n\n## What one paid call costs\n\nA call without a key can be paid for with x402 instead: USDC on Base, one payment per request, no account. The price is by\nthe class of the endpoint and is the same for everyone. A paid call is answered as Pro answers it, for that one request.\nYou pay for what we recorded, not for what we missed.\nIt is **on in production since 2026-10-02**: a request without a key to one of these endpoints is answered `402` with the price.\n[How it works](https://docs.debyko.com/api/x402/).\n\n| class | price (USDC) | endpoint |\n| --- | --- | --- |\n| `agent_state` | 0.01 | `GET /v2/agent/state` (per rule named) |\n| `archive` | 0.10 | `GET /v2/archive/{listing}/{layer}/{day}` (per file: core) |\n| `candles` | 0.005 | `POST /v2/candles` |\n| `history` | 0.02 | `POST /v2/snapshots/history` |\n| `screen` | 0.01 | `POST /v2/screen` |\n| `snapshots` | 0.005 | `POST /v2/snapshots` |\n| `archive_top100` | 0.05 | `GET /v2/archive/{listing}/{layer}/{day}` (per file: top-100) |\n\n`attest` is priced (0.05) and has no endpoint yet. `GET /v2/stream`, `/v2/books`, `/v2/liquidations` and the DQL helpers are not payable: they need a key.\n\n\n# Errors\n\nEvery failure answers in the same shape: a list, because one request can be wrong in several places at\nonce, and each entry says what is wrong, where, and what to do instead.\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_UNKNOWN_FIELD\",\n      \"message\": \"unknown field 'fundng' at 1:18; did you mean 'funding'?\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 18,\n        \"offset\": 17,\n        \"length\": 6\n      },\n      \"hint\": \"did you mean 'funding'?\"\n    }\n  ]\n}\n```\n\nBranch on `code`. It is stable. `message` explains and may be reworded between releases, and `hint`\nis advice, not a contract. `position` is present whenever the fault has a place in the query text:\n`line` and `column` are 1-based, `offset` is 0-based, and `length` covers the offending token, so an\neditor can underline it exactly.\n\n## What the language refuses\n\nEach of these was produced by running the query beside it through the parser. The messages are the\nserver's own.\n\n### DQL_SYNTAX\n\nThe text is not a query. The position is where reading stopped and the message names what was expected there.\n\n```dql\nfunding > \n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_SYNTAX\",\n      \"message\": \"unexpected end of input at 1:11; expected an expression\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 11,\n        \"offset\": 10,\n        \"length\": 0\n      },\n      \"hint\": \"expected an expression\",\n      \"next\": \"example of a valid query: any(venues where funding > 0)\"\n    }\n  ]\n}\n```\n\nUnderline the position. `POST /v2/dql/parse` answers this without running anything, which is what an editor should call on every keystroke.\n\n### DQL_UNKNOWN_FIELD\n\nA name that is not a field. The message suggests the nearest one it knows.\n\n```dql\nany(venues where fundng > 0)\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_UNKNOWN_FIELD\",\n      \"message\": \"unknown field 'fundng' at 1:18; did you mean 'funding'?\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 18,\n        \"offset\": 17,\n        \"length\": 6\n      },\n      \"hint\": \"did you mean 'funding'?\"\n    }\n  ]\n}\n```\n\nRead `GET /v2/dql/catalogue` for the fields that exist rather than carrying a list in your client.\n\n### DQL_UNKNOWN_FUNCTION\n\nA name that is not a function.\n\n```dql\nany(venues where emma(close, 20) > 0)\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_UNKNOWN_FUNCTION\",\n      \"message\": \"unknown function 'emma' at 1:18; did you mean 'ema'?\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 18,\n        \"offset\": 17,\n        \"length\": 15\n      },\n      \"hint\": \"did you mean 'ema'?\"\n    }\n  ]\n}\n```\n\nThe catalogue lists every function with its signature.\n\n### DQL_UNKNOWN_VENUE\n\nA venue code the platform does not have. The message lists the ones it does and the hint names the nearest. Common names (`BINANCE-PERP`, `BINANCE-FUTURES`, `OKX-SWAP` and the like) are not errors: they resolve to the registry code, and the response says so under `resolved_from`.\n\n```dql\nany(venues where venue = BINANCE-USDT)\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_UNKNOWN_VENUE\",\n      \"message\": \"unknown venue 'BINANCE-USDT' at 1:26; known: BYBIT-PERP, HYPERLIQUID, KRAKEN-FUTURES, OKX-PERP\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 26,\n        \"offset\": 25,\n        \"length\": 12\n      },\n      \"hint\": \"known: BYBIT-PERP, HYPERLIQUID, KRAKEN-FUTURES, OKX-PERP\"\n    }\n  ]\n}\n```\n\nRead `GET /v2/venues`. A venue the platform is still onboarding is not queryable until it appears there.\n\n### DQL_UNKNOWN_CURRENCY\n\nA quote currency that exists on no listing.\n\n```dql\nany(venues where quote = USDD)\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_UNKNOWN_CURRENCY\",\n      \"message\": \"unknown currency 'USDD'\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 26,\n        \"offset\": 25,\n        \"length\": 4\n      },\n      \"hint\": \"did you mean 'USD'?\"\n    }\n  ]\n}\n```\n\nThe catalogue's `currencies` is the whole set. DQL never converts between them, so the spelling has to match.\n\n### DQL_UNKNOWN_ASSET\n\nA base asset the platform does not have.\n\n```dql\nbase = BITCOIN\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_UNKNOWN_ASSET\",\n      \"message\": \"unknown asset 'BITCOIN'\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 8,\n        \"offset\": 7,\n        \"length\": 7\n      },\n      \"hint\": \"known: BTC, ETH, SOL\"\n    }\n  ]\n}\n```\n\nThe catalogue's `assets` is the whole set.\n\n### DQL_UNKNOWN_INSTRUMENT\n\nAn instrument code that does not exist — often the base asset written where the instrument belongs.\n\n```dql\ninstrument = BTC\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_UNKNOWN_INSTRUMENT\",\n      \"message\": \"unknown instrument 'BTC'\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 14,\n        \"offset\": 13,\n        \"length\": 3\n      },\n      \"hint\": \"known: BTC-PERP, ETH-PERP, SOL-PERP\"\n    }\n  ]\n}\n```\n\nInstruments are `BTC-PERP`, not `BTC`. The catalogue's `instruments` lists them.\n\n### DQL_SCOPE\n\nA venue-scoped field used as though it belonged to the instrument. Funding is a fact about one venue's listing; an instrument has several.\n\n```dql\nfunding > 0\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_SCOPE\",\n      \"message\": \"'funding' is venue-scoped; wrap it in any(venues where …), all(…), count(…) or an aggregate\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 1,\n        \"offset\": 0,\n        \"length\": 7\n      },\n      \"hint\": \"wrap in any(venues where ...) / all(...) / count(...) or an aggregate\"\n    }\n  ]\n}\n```\n\nSay which venues you mean: `any(venues where funding > 0)`, or `all`, `count`, or an aggregate.\n\n### DQL_NESTING\n\nA quantifier inside a quantifier. There is one level of venues, so the inner one would have nothing to range over.\n\n```dql\nany(venues where any(venues where funding > 0))\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_NESTING\",\n      \"message\": \"quantifiers cannot be nested\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 18,\n        \"offset\": 17,\n        \"length\": 29\n      }\n    }\n  ]\n}\n```\n\nFlatten the condition.\n\n### DQL_TYPE\n\nAn operation on a value of the wrong kind. Summing prices across venues is a category error, not a small inaccuracy — the result would be a number with no meaning.\n\n```dql\nsum(venues, mark) > 0\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_TYPE\",\n      \"message\": \"sum requires an additive field; mark is a price\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 1,\n        \"offset\": 0,\n        \"length\": 17\n      },\n      \"hint\": \"additive: oi, volume_24h, turnover_24h, bid_size, ask_size, volume, the depth functions, or arithmetic over those\"\n    }\n  ]\n}\n```\n\nSum only additive fields; the catalogue's `additive` says which. For a price across venues, use `max`, `min` or an average of your own.\n\n### DQL_TIMEFRAME_REQUIRED\n\nA series function with no period to read at. A moving average is a different number on every timeframe, so the platform will not choose one for you.\n\n```dql\nany(venues where ema(close, 20) > close)\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_TIMEFRAME_REQUIRED\",\n      \"message\": \"series function 'ema' needs a timeframe: add 'timeframe 15m' or a trailing argument\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 18,\n        \"offset\": 17,\n        \"length\": 14\n      }\n    }\n  ]\n}\n```\n\nAdd `timeframe 1h` to the query, or give the function its own: `ema(close, 20, 1h)`.\n\n### DQL_TIMEFRAME_UNSUPPORTED\n\nA period the platform does not store. The message lists the ones it does.\n\n```dql\nany(venues where sma(close, 3) > 0) timeframe 7m\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_TIMEFRAME_UNSUPPORTED\",\n      \"message\": \"timeframe '7m' is not supported; supported: 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 37,\n        \"offset\": 36,\n        \"length\": 9\n      }\n    }\n  ]\n}\n```\n\nUse a period from the catalogue's `timeframes`.\n\n### DQL_TIMEFRAME_MISMATCH\n\nTwo series of different periods compared as though they lined up. They do not: one bar of the first is not one bar of the second.\n\n```dql\nany(venues where crossover(ema(close, 20, 1h), ema(close, 50, 4h)))\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_TIMEFRAME_MISMATCH\",\n      \"message\": \"series timeframes differ (1h vs 4h)\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 18,\n        \"offset\": 17,\n        \"length\": 49\n      }\n    }\n  ]\n}\n```\n\nRead both at the same period.\n\n### DQL_ARGUMENT\n\nAn argument outside what the function accepts. The message states the range.\n\n```dql\nany(venues where ema(close, 0) > 0) timeframe 1h\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_ARGUMENT\",\n      \"message\": \"argument 'n' of ema must be an integer in 1…500\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 29,\n        \"offset\": 28,\n        \"length\": 1\n      }\n    }\n  ]\n}\n```\n\nUse a window inside the stated range.\n\n### DQL_DUPLICATE_CLAUSE\n\nA clause given twice. The platform will not guess which one you meant.\n\n```dql\nvenues_listed > 0 timeframe 1h timeframe 4h\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_DUPLICATE_CLAUSE\",\n      \"message\": \"clause 'timeframe' given twice\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 32,\n        \"offset\": 31,\n        \"length\": 9\n      },\n      \"hint\": \"each clause may appear at most once\"\n    }\n  ]\n}\n```\n\nGive it once.\n\n### DQL_AS_OF_RANGE\n\nAn instant outside what can be answered — in the future, or before the earliest data retained.\n\n```dql\nany(venues where funding > 0) as of 2030-01-01T00:00:00Z\n```\n\n```json\n{\n  \"errors\": [\n    {\n      \"code\": \"DQL_AS_OF_RANGE\",\n      \"message\": \"as_of is in the future\",\n      \"position\": {\n        \"line\": 1,\n        \"column\": 31,\n        \"offset\": 30,\n        \"length\": 2\n      },\n      \"hint\": \"the server clock is 2026-09-23T12:00:05Z\"\n    }\n  ]\n}\n```\n\nThe catalogue's `earliest_retained` is the floor; the present is the ceiling.\n\n## What the request refuses\n\nThese are about the request rather than about the query, so no query produces them and none is shown.\n\n| code | status | what it means |\n| --- | --- | --- |\n| `DQL_JSON_SCHEMA` | 400 | The request body is not the shape the endpoint takes. `path` points at the offending member, as a JSON pointer. |\n| `DQL_VERSION` | 400 | A language version other than `1` was asked for. There is only one. |\n| `DQL_LIMIT` | 400 | The request is within the grammar but past a batch limit — too many listings, too many rows, or a response too large. The message states both the figure and the limit. |\n| `DQL_COMPLEXITY` | 400 | The query is within the grammar but costs more than the limits allow. `POST /v2/dql/parse` returns a query's cost, so this can be seen before it is hit. |\n| `AUTH_REQUIRED` | 401 | The endpoint needs a key and none was sent. |\n| `AUTH_INVALID` | 401 | The key is unknown, revoked, expired, or the header is not `Bearer <key>`. |\n| `ACCOUNT_DISABLED` | 403 | The key belongs to a disabled account. |\n| `KEY_IN_URL` | 400 | A key was sent as a query parameter. Query strings are written to logs and browser history, so the key should be treated as compromised and replaced. |\n| `PLAN_LIMIT` | 403 | The request is valid but reaches past what the plan includes — usually further back in history. Carries `next` with the earliest instant the plan reads for that request and the plan that reads further and, for `POST /v2/candles`, `earliest_from` and `retry_with` (the same request with `from` moved there). Free, Mini and Standard read every timeframe, each as deep as its timeframe allows (Free `1m` 48 hours, `5m` and `15m` 7 days, `1h` 30 days, `4h` and `1d` 90 days; Mini 7, 30, 90 and 180 days; Standard a year); everything without a timeframe reaches 7 days on Free, 30 on Mini. |\n| `PAYMENT_REQUIRED` | 402 | A payable endpoint was called with no credentials, or with an x402 payment that was not accepted. The body carries what to pay (`accepts`) and, beside it, the way out with a key; `error` says what was wrong with a payment that was sent. Only when the operator has switched x402 on. You pay for what we recorded, not for what we missed. A key whose plan's archive files for the month are spent (or that has none) is also answered 402, in the same code and without `accepts`: `limit` is `archive_files_per_month` and `price_usd` the price of the file. |\n| `PAYMENT_MALFORMED` | 400 | The `PAYMENT-SIGNATURE` header is not a payment: not base64, not JSON, not an x402 version 2 payment of the `exact` scheme, or a field of it cannot be what it says. Nothing was asked of the facilitator. |\n| `NOT_FOUND` | 404 | There is nothing at this path to give: an archive file that does not exist (not archived yet, or a day on which nothing was observed, or a layer the archive does not hold), or any archive path while the archive is off. |\n| `RATE_LIMITED` | 429 | A limit of the plan stopped the request; `limit` in the error names it (`requests_per_second`, `requests_per_day`, `dql_per_minute`, `stream_connections`, or `x402_challenges_per_minute` and `x402_unpaid_in_flight_per_payer` for a request without a key). `Retry-After` says when to come back. |\n| `UNAVAILABLE` | 503 | The platform cannot answer yet; retry in a minute. |\n| `ANCHOR_NOT_FOUND` | 404 | `GET /v2/anchors/...` asked about a day with no anchor (a day is anchored within 24 hours of its end), a listing with no history, or a row that was never stored or that retention has dropped (the day's root stays). |\n| `ANCHOR_NOT_YET` | 404 | `GET /v2/anchors/proof` asked about a day whose root is not on the chain yet (not computed, computed, submitted, or in conflict). Answered at once, before any history is read; the message names the first anchored day of the network, or says none is yet. |\n| `ANCHOR_CHANGED` | 409 | A proof was asked for a row whose part of the day no longer matches what was anchored: history was changed after the anchor. The day's root and the proofs made before the change still stand. |\n\nA `400` from `POST /v2/dql/parse` is not a failure of the API: it is the answer you asked for.\n\n\n# How the language behaves\n\nHow the language behaves, executably.\n\nEvery case below is a query, the dataset it runs on, and the answer it must give. They are not\nillustrations: `src/Debyko.Dql.Tests` runs each one on every build, and a release that answered any of\nthem differently would not have shipped. If you want to know what DQL does in a corner, this is the\nplace that cannot be out of date.\n\nThe dataset is synthetic — four venues, three instruments, values chosen so that every result can be\nchecked by hand. Those venue codes exist only here: a query you send to the platform must name a venue\nfrom [Venues in DQL](#venues-in-dql).\n\n## The dataset\n\nEvaluation instant `T = 2026-09-21T09:30:05.000Z` unless a query says otherwise. Freshness\ndefaults as in §8.4. Timeframe set as in §3.4. Candle layer `off` for GMX-PERP's group; all other\nlayers `on` for all groups. Retention covers everything below. `settle_after = 60`.\n\nVenues: `BINANCE-USDM`, `BYBIT-PERP`, `HYPERLIQUID`, `GMX-PERP`. Capability: GMX-PERP does not\npublish the book layer. Instruments and listings at `T`: `BTC` on all four; `ETH` on\nBINANCE-USDM, BYBIT-PERP, GMX-PERP; `SOL` on HYPERLIQUID.\n\nSnapshot values. \"P\" = received at `2026-09-21T09:30:04.000Z` (age 1 000 ms, present). Quote:\nBINANCE-USDM and BYBIT-PERP `USDT`; HYPERLIQUID and GMX-PERP `USDC`. `funding_interval` is `8h`\non BINANCE-USDM and BYBIT-PERP, `1h` on HYPERLIQUID and GMX-PERP.\n\n| Instrument | Venue | mark | funding | oi | bid / ask |\n|---|---|---|---|---|---|\n| BTC | BINANCE-USDM | 65000 P | 0.0001 received 09:29:35.000 (age 30 000 ms, present) | 1000 P | 64999 / 65001 P |\n| BTC | BYBIT-PERP | 65010 P | 0.0002 received 09:20:00.000 (age 605 000 ms, **stale**) | 800 P | 65005 / 65015 P |\n| BTC | HYPERLIQUID | **missing** | 0.00005 P | 500 P | 64990 / 65010 P |\n| BTC | GMX-PERP | 65020 P | −0.00003 P | 200 P | not_published |\n| ETH | BINANCE-USDM | 3200 P | 0.0003 P | 5000 P | 3199.9 / 3200.1 P |\n| ETH | BYBIT-PERP | 3201 P | 0.0001 P | 4000 P | 3200.5 / 3201.5 P |\n| ETH | GMX-PERP | 3199 P | **missing** | 1000 P | not_published |\n| SOL | HYPERLIQUID | 150 P | 0.0002 P | 30000 P | 149.99 / 150.01 P |\n\nDerived: BTC/BINANCE `spread = 2/65000 = 3.0769230769230769e-5`; BTC/BYBIT `spread = 10/65010 =\n1.5382248884786956e-4`; BTC/HYPERLIQUID `spread = 20/65000 = 3.076923076923077e-4`; BTC/GMX\n`spread` null (not_published). `funding_8h`: BINANCE BTC 0.0001, BYBIT BTC 0.0002 (stale),\nHYPERLIQUID BTC 0.0004, GMX BTC −0.00024.\n\nCandles (15m, UTC-aligned). Candle `k` has period `[end − 15m, end)`, `received_at = end + 0.4 s`,\n`open = previous close`, `high = close + 100`, `low = close − 100`, `volume = 10`.\n\n- BTC / BINANCE-USDM: 10 candles, ends `07:15, 07:30, …, 09:30`; `close = 60000` for the first\n  nine and `66000` for the candle ending `09:30`.\n- BTC / BYBIT-PERP: same ends and closes (all `60000`), except the candle ending `08:45` is\n  **absent** (gap).\n- BTC / HYPERLIQUID: 3 candles, ends `09:00, 09:15, 09:30`, closes `59000, 59500, 60000`.\n- BTC / GMX-PERP: layer `off`.\n- ETH and SOL: no candles received on any venue (status `missing`).\n\nCadence facts (ADR-025, added 2026-09-29). Every listing polls every layer, good for exactly the old per-layer\nbound (30 s ticker, mark, oi, book; 120 s stats; 300 s funding) — so every case above reads as it did — except the\nstats layer:\n\n- ETH / BINANCE-USDM and ETH / BYBIT-PERP stats: pushed only on change (`on_change`, horizon source\n  `connection`), last value received `09:29:00` (volume 150 and 140); on BYBIT-PERP a disconnection of the segment\n  is recorded at `09:29:30` (recorded `09:29:30.200`): **stale, `connection_lost`**; on BINANCE-USDM the connection\n  lives: **present**, `valid_until` null, carried into the `09:30` minute.\n- ETH / GMX-PERP stats: volume 90, received P: present, `valid_until` `09:32:04`.\n- BTC / HYPERLIQUID stats: volume 7000, received `09:27:00` (185 s old, past its 120 s) while the platform's\n  projection was recorded lagging from `09:27:30` (recorded `09:27:45`): **stale, `state_lag`**.\n- BTC / GMX-PERP stats: volume 300, received P, but no fact covers the pair: **stale, `horizon_unknown`**.\n\n## The cases\n\n**This table is generated from `src/Debyko.Dql.Tests/Corpus.cs` and checked against it by\n`CorpusSpecTests`: a case added to the tests and not to this table, or the other way round, fails\nthe build.** Numbering is continuous across the origins — 01–47 from draft 1, 48–72 from change\nset 01, 73–82 from change set 02, 83–88 from change set 03, 89–95 from change set 04, 109–115 from ADR-025, 116–128 from change set 34 (`ref`), 129–131 from the amendment of 2026-10-09 (issue #247, `ref` of a series),\nand the lettered ones (14a, 20a, 62a, 82a, 94a …) added while implementing, each pinning a decision of the\nimplementation notes.\n\nEvery state has a case (ADR-025): `present` 109 (a live connection value, `valid_until` null) and 01; `stale` —\n`horizon_passed` 05, 17 and 20b, `connection_lost` 109 and 111, `state_lag` 110, `horizon_unknown` 110, `freshness_bound` 115; `missing`\n108 (`not_retained`) and 24; `not_published` 07; `off` 28. `count` does not count a stale value (112), `all` over\none is unknown (111), `status(F) = stale` is never unknown (110), `freshness` only tightens (20b, 115), and `carried`\ntells an observed value from a carried one (113, 114).\n\n\"Result\" is the set of instruments whose result is true, written as market codes (C4-01). Cases run\nwith `units: base` unless the row says otherwise.\n\n| # | Query | Expected |\n|---|---|---|\n| 01 | `any(venues where funding > 0)` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 02 | `all(venues where funding > 0)` | SOL-PERP (ETH-PERP unknown) |\n| 03 | `count(venues where funding > 0) >= 3` | none |\n| 04 | `count(venues where funding > 0) >= 2` | BTC-PERP, ETH-PERP |\n| 05 | `count(venues where status(funding) = stale) = 1` | BTC-PERP |\n| 06 | `any(venues where status(funding) = missing)` | ETH-PERP |\n| 07 | `any(venues where status(bid) = not_published)` | BTC-PERP, ETH-PERP |\n| 08 | `all(venues where status(bid) = not_published or spread < 5bps)` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 09 | `all(venues where spread < 5bps)` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 10 | `venues_answered >= 3` | BTC-PERP, ETH-PERP |\n| 11 | `venues_answered < venues_listed` | BTC-PERP |\n| 12 | `max(venues, mark) - min(venues, mark) > 15` | BTC-PERP |\n| 13 | `max(venues where quote = USDT, mark) - min(venues where quote = USDT, mark) > 5` | BTC-PERP (SOL-PERP unknown) |\n| 14a | `sum(venues, oi) > 2000` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 14b | `sum(venues, oi) > 5000` | ETH-PERP, SOL-PERP |\n| 15 | `sum(venues, mark) > 0` | error `DQL_TYPE` |\n| 16 | `funding > 0` | error `DQL_SCOPE` |\n| 17 | `any(venues where venue = HYPERLIQUID and funding_8h > 3bps)` | BTC-PERP, SOL-PERP |\n| 18 | `any(venues where funding > 0 and age(funding) < 10s)` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 19 | `any(venues where age(funding) < 10s) freshness 10s` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 20a | `any(venues where funding > 0) freshness 1d` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 20b | `count(venues where funding > 0) >= 3 freshness 1d` | none (freshness only tightens: BYBIT-PERP stays stale, BTC-PERP counts 2) |\n| 21 | `any(venues where sma(close, 3) = 62000) timeframe 15m` | BTC-PERP |\n| 22 | `any(venues where ema(close, 2) = 64000) timeframe 15m` | BTC-PERP |\n| 23 | `any(venues where venue = BYBIT-PERP and sma(close, 3) = 60000) timeframe 15m` | BTC-PERP |\n| 24 | `any(venues where venue = BYBIT-PERP and sma(close, 5) > 0) timeframe 15m` | none (BTC-PERP unknown, gap) |\n| 25 | `any(venues where venue = BYBIT-PERP and gaps(10) = 1) timeframe 15m` | BTC-PERP |\n| 26 | `any(venues where venue = HYPERLIQUID and ema(close, 2) > 0) timeframe 15m` | none (BTC-PERP unknown, insufficient_history) |\n| 27 | `any(venues where venue = HYPERLIQUID and sma(close, 3) = 59500) timeframe 15m` | BTC-PERP |\n| 28 | `any(venues where status(close) = off) timeframe 15m` | BTC-PERP |\n| 29 | `any(venues where crossover(close, sma(close, 3))) timeframe 15m` | BTC-PERP |\n| 30 | `any(venues where rsi(close, 2) = 100) timeframe 15m` | BTC-PERP |\n| 31 | `any(venues where atr(2) = 3150) timeframe 15m` | BTC-PERP |\n| 32 | `any(venues where stdev(close, 3) > 2828.42 and stdev(close, 3) < 2828.43) timeframe 15m` | BTC-PERP |\n| 33 | `any(venues where change(close, 1) = 6000 and roc(close, 1) = 0.1 and prev(close, 1) = 60000 and highest(close, 3) = 66000 and lowest(close, 3) = 60000) timeframe 15m` | BTC-PERP |\n| 34 | `any(venues where ema(close, 20) > 0)` | error `DQL_TIMEFRAME_REQUIRED` |\n| 35 | `any(venues where sma(close, 3) = 60000 and venue = BINANCE-USDM) timeframe 15m as of 2026-09-21T09:30:00Z` | BTC-PERP |\n| 36 | `any(venues where crossover(close, sma(close, 3))) timeframe 15m as of 2026-09-21T09:30:00Z` | none |\n| 37 | `any(venues where funding > 0) as of 2030-01-01T00:00:00Z` | error `DQL_AS_OF_RANGE` |\n| 38 | `venues_listed >= 1 order by sum(venues, oi) desc` | SOL-PERP, ETH-PERP, BTC-PERP (in this order) |\n| 39 | `venues_listed >= 1 order by max(venues where quote = USDT, mark) desc` | BTC-PERP, ETH-PERP, SOL-PERP (in this order) |\n| 40 | `any(venues where quote in (USDT, USDC) and funding > 0) or venues_answered = 0` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 41 | `any(venues where funding > 0 and not (status(funding) = stale))` | BTC-PERP, ETH-PERP, SOL-PERP |\n| 42 | `not any(venues where funding < 0)` | SOL-PERP |\n| 43 | `any(venues where funding > 0) AND venues_listed > 1` | error `DQL_SYNTAX` |\n| 44 | `any(venues where 5min > 0)` | error `DQL_SYNTAX` |\n| 45 | `any( venues where funding>=0.0001 and (spread<5bps) )  // note` | canonical `any(venues where funding >= 0.0001 and spread < 0.0005)` |\n| 46 | `any( venues where funding>=0.0001 and (spread<5bps) )  // note` | canonical `any(venues where funding >= 0.0001 and spread < 0.0005)` |\n| 47 | `any(venues where funding > 0)` | response shape: BTC-PERP lists all four venues with provenance |\n| 48 | `any(venues where sma(mark, 5) = 64986) timeframe 1m` | BTC-PERP |\n| 49 | `any(venues where sma(mark, 6) > 0) timeframe 1m` | none (BTC-PERP unknown, gap) |\n| 50 | `any(venues where change(mark, 4) = 10 and prev(mark, 1) = 64970 and highest(mark, 5) = 65010 and lowest(mark, 5) = 64960) timeframe 1m` | BTC-PERP |\n| 51 | `any(venues where mark > sma(mark, 5)) timeframe 1m` | BTC-PERP |\n| 52 | `any(venues where percentile(mark, 5, 50%) = 64990 and percentile(mark, 5, 95%) = 65010 and percentile(mark, 5, 20%) = 64960) timeframe 1m` | BTC-PERP |\n| 53 | `any(venues where percentile_rank(mark, 5) = 0.8) timeframe 1m` | BTC-PERP |\n| 54 | `any(venues where rolling_sum(abs(change(mark, 1)), 4) = 150 and abs(change(mark, 4)) = 10) timeframe 1m` | BTC-PERP |\n| 55 | `any(venues where abs(change(mark, 4)) / rolling_sum(abs(change(mark, 1)), 4) > 0.06 and abs(change(mark, 4)) / rolling_sum(abs(change(mark, 1)), 4) < 0.07) timeframe 1m` | BTC-PERP |\n| 56 | `any(venues where age(mark) = 1s and age(mark, 1m) = 5500ms and status(mark, 1m) = present)` | BTC-PERP |\n| 57 | `any(venues where sma(mark, 2) = 64990) timeframe 1m as of 2026-09-21T09:29:59Z` | BTC-PERP |\n| 58 | `any(venues where status(mark) = stale) as of 2026-09-21T09:29:59Z` | BTC-PERP |\n| 59 | `any(venues where bid_size = 2 and ask_size = 1.5)` | BTC-PERP |\n| 60 | `any(venues where depth_bid(1bps) = 5 and depth_ask(1bps) = 4 and depth_bid_value(1bps) = 324992 and depth_ask_value(1bps) = 260006.5)` | BTC-PERP |\n| 61 | `any(venues where depth_bid(10bps) > 0)` | none (BTC-PERP unknown, band_truncated) |\n| 62a | `any(venues where depth_bid(0) > 0)` | error `DQL_ARGUMENT` |\n| 62b | `any(venues where depth_bid(6%) > 0)` | error `DQL_ARGUMENT` |\n| 63 | `sum(venues, depth_bid(1bps)) = 5` | BTC-PERP |\n| 64 | `any(venues where tick_size / mark < 1bps and lot_size = 0.001)` | BTC-PERP |\n| 65 | `any(venues where quote in (USDT, USDC)) select venues_listed, sum(venues, oi), funding_8h` | BTC-PERP, ETH-PERP, SOL-PERP (as corpus test 14) |\n| 66 | `venues_listed >= 1 order by venues_answered desc, sum(venues, oi) asc` | BTC-PERP, ETH-PERP, SOL-PERP (in this order) |\n| 67 | `venues_listed >= 1 order by max(venues where quote = USDT, mark) desc, venues_listed asc` | BTC-PERP, ETH-PERP, SOL-PERP (in this order) |\n| 68 | `any(venues where sma(quote, 3) > 0) timeframe 1m` | error `DQL_TYPE` |\n| 69 | `any(venues where sma(venues_listed, 3) > 0) timeframe 1m` | error `DQL_TYPE` |\n| 70 | `any(venues where percentile(mark, 5, 1.5) > 0) timeframe 1m` | error `DQL_ARGUMENT` |\n| 71 | `count(venues where roc(mark, 5) > 0.5%) >= 3 select venues_listed timeframe 1m order by venues_listed desc` | canonical `count(venues where roc(mark, 5) > 0.005) >= 3 timeframe 1m order by venues_listed desc select venues_listed` |\n| 72 | `any(venues where venue = BYBIT-PERP) select spread, bid` | spread prints 0.000153822489, bid prints 65005 |\n| 73 | `any(venues where sma(mark, 5) = 64986) timeframe 1m` | BTC-PERP |\n| 74 | `any(venues where lowest(change(mark, 1), 3) > 0) timeframe 1m` | none (BTC-PERP false) |\n| 75 | `any(venues where mark_close - close = 10) timeframe 15m` | BTC-PERP |\n| 76 | `any(venues where venue = BYBIT-PERP and status(mark_close) = not_published) timeframe 15m` | BTC-PERP |\n| 77 | `any(venues where sma(mark_close, 3) = 62010) timeframe 15m` | BTC-PERP |\n| 78 | `any(venues where percentile(mark, 5, 90%, linear) > 65005.99 and percentile(mark, 5, 90%, linear) < 65006.01) timeframe 1m` | BTC-PERP |\n| 79 | `any(venues where percentile(mark, 5, 50%, linear) = 64990) timeframe 1m` | BTC-PERP |\n| 80 | `any(venues where percentile(mark, 5, 50%, midrank) > 0) timeframe 1m` | error `DQL_ARGUMENT` |\n| 81 | `any(venues where sma(close, 3) > 0) timeframe 7m` | error `DQL_TIMEFRAME_UNSUPPORTED` |\n| 82a | `any(venues where percentile(mark, 5, 90%, nearest) > 0) timeframe 1m` | canonical `any(venues where percentile(mark, 5, 0.9) > 0) timeframe 1m` |\n| 82b | `any(venues where percentile(mark, 5, 90%, linear) > 0) timeframe 1m` | canonical `any(venues where percentile(mark, 5, 0.9, linear) > 0) timeframe 1m` |\n| 83 | `any(venues where depth_bid(25bps) > 0)` | error `DQL_ARGUMENT` |\n| 84 | `any(venues where depth_bid(50bps) > 0)` | none (BTC-PERP unknown, band_truncated) |\n| 85 | `any(venues where sma(mark_volume, 3) = 0) timeframe 15m` | BTC-PERP |\n| 86 | `any(venues where venue = BYBIT-PERP and status(mark_volume) = not_published) timeframe 15m` | BTC-PERP |\n| 87 | `any(venues where depth_bid_value(1bps) = 324992) as of 2026-09-21T09:30:04Z` | BTC-PERP |\n| 88 | `any(venues where depth_bid_value(1bps) > 0) as of 2026-09-21T09:30:03Z` | none (BTC-PERP unknown, no_value) |\n| 89 | `any(venues where funding > 0) where venue = HYPERLIQUID` | BTC-PERP, SOL-PERP |\n| 90 | `venues_listed = 1 where venue = BINANCE-USDM` | BTC-PERP, ETH-PERP |\n| 91 | `any(venues where mark > 0) where symbol = \"BTCUSDT\"` | BTC-PERP |\n| 92 | `any(venues where mark > 0) where symbol = BTCUSDT` | error `DQL_TYPE` |\n| 93 | `any(venues where mark > 0) where venue = \"HYPERLIQUID\"` | error `DQL_TYPE` |\n| 94a | `sum(venues, oi) > 0` | error `DQL_TYPE`; with `units: published` |\n| 94b | `sum(venues, oi) > 0` | BTC-PERP, ETH-PERP, SOL-PERP (as corpus test 14) |\n| 95 | `any(venues where funding > 0) where base = BTC timeframe 1m` | canonical `any(venues where funding > 0) timeframe 1m where base = BTC` |\n| 96 | `any(venues where crossunder(sma(close, 3), close)) timeframe 15m` | BTC-PERP |\n| 97 | `all(venues where crossunder(close, sma(close, 3))) timeframe 15m` | none |\n| 98 | `any(venues where basis > 0.001)` | BTC-PERP |\n| 99 | `any(venues where index > 64000)` | BTC-PERP |\n| 100 | `count(venues where funding_interval = 8h) >= 2` | ETH-PERP |\n| 101 | `any(venues where time_to_funding < 1h)` | BTC-PERP |\n| 102 | `any(venues where volume_24h > 10000)` | BTC-PERP |\n| 103 | `any(venues where turnover_24h > 800000000)` | BTC-PERP |\n| 104 | `any(venues where change_24h < 0)` | BTC-PERP |\n| 105 | `any(venues where min_qty <= 0.001)` | BTC-PERP |\n| 106 | `any(venues where index_close > 0) timeframe 15m` | none |\n| 107 | `any(venues where index_volume > 0) timeframe 15m` | none |\n| 108 | `any(venues where volume_24h > 0) where base = SOL` | none |\n| 109 | `any(venues where volume_24h > 100) where base = ETH` | ETH-PERP |\n| 110 | `count(venues where status(volume_24h) = stale) >= 2` | BTC-PERP |\n| 111 | `all(venues where volume_24h > 0) where base = ETH` | none (ETH-PERP unknown) |\n| 112 | `count(venues where volume_24h > 0) = 2 where base = ETH` | ETH-PERP |\n| 113 | `any(venues where carried(volume_24h, 1) = 1) where base = ETH timeframe 1m` | ETH-PERP |\n| 114 | `any(venues where venue = BYBIT-PERP and carried(volume_24h, 1) = 0) where base = ETH timeframe 1m` | ETH-PERP |\n| 115 | `all(venues where volume_24h > 0) where base = ETH freshness 30s` | none (ETH-PERP unknown: freshness_bound on BINANCE-USDM) |\n| 116 | `any(venues where venue = BINANCE-USDM and ref(BTC-PERP, mark) = 65000) where base = ETH` | ETH-PERP (BTC-PERP is read on BINANCE-USDM, the venue evaluated, and is not in the answer) |\n| 117 | `any(venues where venue = BINANCE-USDM and ref(BTC-PERP, mark, BYBIT-PERP) = 65010) where base = ETH` | ETH-PERP (BTC-PERP is read on the venue named, not the one evaluated) |\n| 118 | `ref(BTC-PERP, mark, BINANCE-USDM) = 65000 where base = ETH` | ETH-PERP (at instrument scope the venue is written) |\n| 119 | `ref(BTC-PERP, mark) > 0` | error `DQL_SCOPE` |\n| 120 | `any(venues where ref(BTC-SWAP, mark) > 0)` | error `DQL_UNKNOWN_INSTRUMENT` |\n| 121 | `any(venues where ref(BTC-PERP, mark, BINANCE-USDT) > 0)` | error `DQL_UNKNOWN_VENUE` |\n| 122 | `any(venues where ref(SOL-PERP, mark) > 0) where base = ETH` | none (ETH-PERP unknown: SOL-PERP is listed on none of ETH-PERP's venues, `not_in_scope`) |\n| 123 | `any(venues where venue = BINANCE-USDM and ref(BTC-PERP, mark) > 0) where base = ETH` | none (ETH-PERP unknown: BTC-PERP is halted on BINANCE-USDM, `not_in_scope`; the §16.1 dataset with that listing halted from 09:00:00) |\n| 124 | `any(venues where ref(BTC-PERP, ref(BTC-PERP, mark)) > 0)` | error `DQL_NESTING` |\n| 125 | `any(venues where ref(BTC-PERP, any(venues where mark > 0)))` | error `DQL_NESTING` |\n| 126 | `any(venues where ref(BTC-PERP, mark) > 0 and ref(ETH-PERP, mark) > 0 and ref(SOL-PERP, mark) > 0 and ref(BTC-PERP, mark, BINANCE-USDM) > 0 and ref(ETH-PERP, mark, BINANCE-USDM) > 0)` | error `DQL_COMPLEXITY` |\n| 127 | `any(venues where venue = BINANCE-USDM and ref(BTC-PERP, close) > ref(BTC-PERP, sma(close, 3)) and ref(BTC-PERP, close) = 66000) where base = ETH timeframe 15m` | ETH-PERP (a regime filter: BTC-PERP's close 66000 above its three-bar average 62000, on the venue evaluated) |\n| 128 | `any( venues where ref( BTC-PERP ,mark_close>ema(mark_close,50,4h) ) and ref(ETH-PERP,mark,BYBIT-PERP)>1e3 ) timeframe 15m // regime` | canonical `any(venues where ref(BTC-PERP, mark_close > ema(mark_close, 50, 4h)) and ref(ETH-PERP, mark, BYBIT-PERP) > 1000) timeframe 15m` |\n| 129 | `any(venues where ref(BTC-PERP, sma(mark_close, 20)) > 0) timeframe 15m` | canonical `any(venues where ref(BTC-PERP, sma(mark_close, 20)) > 0) timeframe 15m` (the series function inside `ref`: accepted, a number) |\n| 130 | `any(venues where sma(ref(BTC-PERP, mark_close), 20) > 0) timeframe 15m` | error `DQL_TYPE` (a `ref` is a value at `T`, not a series) |\n| 131 | `any(venues where venue = BINANCE-USDM and ref(BTC-PERP, mark_close) > 66000) where base = ETH timeframe 15m` | ETH-PERP (BTC-PERP's latest mark bar close, 66010, on the venue evaluated; the bars before it close at 60010) |\n\n---\n\n\n# Decided, deferred and not planned\n\nWhat the language has decided, what it has deferred, and what it will not do.\n\nA language's edges are as much a part of it as its middle. Everything below was decided rather than\nforgotten, and each row says where the decision is written down. Nothing here is a bug, and nothing here\nis a promise.\n\nDraft 1 ended with ten open questions; change set 04 answered most, the implementation settled\nseveral more, and the platform measured two. Each row below is either **decided**, with the section\nthat now states it, or **open**, with what is missing.\n\n| # | Question | Status |\n|---|---|---|\n| 1 | `as of` on every layer | **decided**: the engine reads cold storage for every layer (ADR-018); §11 |\n| 2 | Instrument identity | **decided**: an instrument is a market code, `BTC-PERP`; §8.1 |\n| 3 | Capability registry history | **decided**: not versioned; a historical answer uses the registry as it stands. **Open in part**: the decision said a response would state that moment as `capabilities_as_of`, and nothing writes it (§26) |\n| 4 | Units of `oi`, `volume_24h`, depth | **decided**: requested per query, every value states its own; §8.5 |\n| 5 | Funding on oracle venues | **deferred**: no oracle venue is collected |\n| 6 | Derived candle rule | **decided**: a derived candle exists only when every base minute exists; §7.2 |\n| 7 | Freshness defaults | **decided**: measured cadences sit well inside them; §8.4 |\n| 8 | Settle window | **decided**: measured, 120 s; §11.5 |\n| 9 | Spot selection in DQL and trade-tape functions | **DQL remains perpetual-only**; market endpoints support spot and trade events have separate V2 endpoints; §17.1 below |\n| 10 | Public tags | **moot**: alerts left the API; §12.3 |\n| 11 | Mark and index candles | **decided**: Kraken publishes them, Hyperliquid does not; §8.6 |\n| 12 | Cross-instrument references | **decided** in the bounded form `ref(INSTRUMENT, expr [, VENUE])` (C34-01, task 317); §7.4c. The join form stays out, §17.1 |\n| 13 | Book levels under `as of` | **decided**: metrics only, never the raw book; §7.4a |\n| 14 | Contract rules per listing | **decided**: in the reference layer where the venue publishes them; §8.2 |\n| 15 | ADR-016 supersession | **decided**: yes (ADR-018) |\n| 17 | Funding normalisation | **decided**: identity on both venues |\n| 18 | v1 aliasing | **decided**: no |\n| 19 | Batch and rate numbers | **decided**: §13.1 |\n| 21 | Band reference price | **decided**: the mid; §7.4a |\n| 22 | Band sets per group | **decided**: platform-wide; §7.4a |\n| 23 | Book cadence | **decided**: live |\n| 25 | Kraken's funding interval | **decided** 2026-10-09 (owner): the documented constant `1h` in the registry, provenance `venue_documentation` (C29-02) |\n| 26 | `capabilities_as_of` | **open**: decided in C4-03, absent from the code. Either every `/v2` answer carries the registry instant it was resolved against, or the decision is withdrawn and §11.2 says the registry is always current |\n| 27 | Which venues `/v2` shows | **open**: `/v2` shows a venue only once its public code is *published*. Bybit and OKX are collected and invisible there. Either publishing is part of bringing a venue online, or the language shows collected venues and marks them unpublished |\n\n### 17.1 Not yet\n\nDeliberately absent from DQL, with the reason. None of these is a gap to be filled quietly: each\nwould change what a query means, so each needs a change set of its own.\n\n| Feature | Why not yet |\n|---|---|\n| Boolean series and `count_if(condition, n)` | A boolean series would need a second type of series with its own null rules; the useful cases (`crossover`, `gaps`) are already functions |\n| Cross-instrument references as a join (`BTC-PERP.mark` inside an `ETH-PERP` row, anywhere, over any number of instruments) | Evaluation is per instrument by construction (§5); a free reference makes the universe a join and the cost unbounded. Since change set 34 the bounded form exists: `ref(INSTRUMENT, expr [, VENUE])` reads one listing, at most four targets a query (§7.4c) |\n| Sub-minute sampling | The stored granularity is one second for snapshot layers, but a series at a sub-minute period would imply candles nobody published; `snapshots/history` with an interval answers the same question honestly |\n| `mark_sampled` and other synthetic series | A series built by DEBYKO from its own samples is not what a venue published, and the language's rule is that a value is what a venue published |\n| Spot instruments, trade-tape functions (VWAP, trade counts) | DQL has room for future market filters (`market = spot`, `trades_1m`), but these are not part of the language. Since change set 37, market-data endpoints list and read spot alongside perpetuals with `kind=spot` or `kind=all`; the default remains perpetual. Spot venues, instruments and selected measurements carry their actual market kind. DQL parsing and screening, and Agent, remain perpetual-only and reject a market-kind selector. Stored trade events are available through the separate V2 trade-history and trade-stream endpoints; they do not add trade-tape functions to DQL. See [change set 37](query-language-changes-37.md). Liquidations are not tape functions: a venue publishes them as events of their own, and their totals are §7.4b (C8-01) |\n| User-defined functions, variables, `let` | A query is one expression on purpose: it can be printed, canonicalised, hashed and replayed |\n\n---\n\n\n# Language changelog\n\nHow DQL changed, set by set.\n\nThe language reached its current shape through four change sets. They are kept because a client written\nagainst an earlier one needs to know what moved, and because a decision is easier to argue with when you\ncan see when it was taken.\n\nNothing in a change set was a breaking change to a released client: the platform had no public clients\nwhile they were made. From here on, a change that would break one gets its own note here first, under\n\"Announced breaking changes\", before it ships.\n\n**2026-11-01. Breaking: 2m and 3m timeframes are retired** (owner, #780, C45-01). Candles `timeframe`, history `interval` and DQL series accept `1m`, `5m`, `15m`, `30m`, `1h`, `4h`, `12h`, `1d`. Requests for `2m` or `3m` return `DQL_TIMEFRAME_UNSUPPORTED` (400), naming the supported periods including `1m` and `5m`. Maintenance builds neither retired rollup; existing rows are left unchanged to expire with their class. Duration literals such as `freshness 2m` remain valid. Strategy examples use a denser 1m grid with duration-equivalent windows; stored Agent rules are not rewritten.\n\n**2026-11-01 (issue #781).** Anchor schema version 2 excludes flagged synthetic dummy/test listings from new roots. Already submitted/anchored version-1 roots and chunks stay unchanged; their proofs use version-1 membership. Canonical rows and hash algorithms are unchanged. `/v2/anchors` and proofs report the stored version; clients must use it when rebuilding partition leaves.\n\n**2026-11-01.** Partial bars (owner). A rolled-up candle (`2m` and longer) whose period has closed with some but not all of its one-minute candles is stored and served, with `\"partial\": true` on the bar in `/v2/candles`; before, such a period was a `gap`. Only a period with no minute at all is a `gap` now. DQL indicators read partial bars like any other, so a few missing minutes no longer make a `1h` indicator unknown for its whole lookback. A partial bar is replaced by the complete one when its minutes are backfilled. Additive: a client that ignores unknown members is unaffected.\n\n**2026-11-01.** The Standard trial opens on the first refusal of any of three Free caps, not only of history depth: the number of Agent rules, DQL screening requests a minute (`/v2/screen`, `/v2/dql/parse`) and requests a day. The request is admitted under Standard instead of refused, and its answer's `trial` member names the cap in `cap` (`agent_rules`, `dql_per_minute`, `requests_per_day`) with Free's number in `limit`; a history refusal carries no `cap`. A rule saved over the cap answers with `trial` (`message`: \"Free allows 3 rules, this is your 4th.\"). The per-second burst (429 `requests_per_second`) is not a cap and opens nothing. Still one trial per account, ever.\n\n**2026-10-31.** The Standard trial. A Free account that has never had a trial and is refused by its plan's history depth (403 `PLAN_LIMIT`) is answered instead, by the same request run under Standard, and Standard is open on the account for 4 days. That answer carries a new member `trial` (`plan`, `until`, and `layer` and `asked_days` of the request that opened it); no other answer does. `GET /v2/account` gets `plan.trial_until` (the end of the open trial, null when none). One trial per account, ever; staff and test accounts, the Agent key, 429 and DQL errors never open one, and neither does a request Standard refuses too (data before the venue's first day, the hot window). At `trial_until` the account is Free again and its limits apply at once. Additive: a client that ignores unknown members is unaffected.\n\n**2026-10-30. Breaking: the timeframe `3m` is removed** (owner, issue #722). `/v2/candles` `timeframe`, the history `interval` and a DQL `timeframe` accept `1m`, `2m`, `5m`, `15m`, `30m`, `1h`, `4h`, `12h` and `1d`; `3m` is `DQL_TIMEFRAME_UNSUPPORTED` (400) with that list. The 3-minute rollups were about a third of the stored rollup rows, and no API, MCP, Studio or agent request asked for them in the call log (14 to 30 October). `GET /v2/instruments` lists the timeframes that remain. Nothing else changes.\n\n**2026-10-30 (shape).** `plan.history` of `GET /v2/account` is an object where it was a sentence: a client that reads it as a string must change. `history.layers` and `history.candles` give, per layer and candle timeframe, `hot_days` (days the database holds it, from the retention classes in force: the shortest of any collected listing; `hot_days_longest` where listings differ), `reads_days` (the smaller of that and the plan's own cap; Free and Mini keep theirs) and `archive_since` (the first day with a verified archive file; null for a layer the archive does not hold). `history.archive.files_per_month` is the plan's files, `history.not_swept` lists `funding_settlement` and `liquidation`. Every plan of `GET /v2/plans` carries the same object. `PLAN_LIMIT` on a request that lies wholly before the hot window of everything it asks for (`POST /v2/snapshots/history` in every mode, `POST /v2/trades`, `POST /v2/candles`) names the layer, the window in days and the earliest hot instant (`earliest_from`) and says one of three things: the exact `GET /v2/archive/{listing}/{layer}/{day}` when the day has a verified file; `no data before <date>` when the venue has none that early; or that the archive has no file for the day. Liquidations and funding settlements are not swept and have no window: they are refused only with `no data before <date>` when the whole request is before the venue's first data. Before this such a request answered `not_retained` row by row; a request that reaches into the window of any listing and layer still does, with the archive pointer where a file exists. `GET /v2/venues` items carry `hot_days` (days each layer is held for that venue) beside `since`. `plan.history_days` and `history_from` are unchanged.\n\n**2026-10-30 (values).** Three response strings change, a client that compares them exactly must follow. `plan.history` of `GET /v2/account` is `the database window` where it was `all history` (Pro, Pro Plus) or `one year of history` (Standard); other plans keep `N days of history`. The `PLAN_LIMIT` message and its `next` name the plan as reading `the database window` instead of `all history` or `365 days`. Studio's `history` label changes the same way. No limit changed: `history_days` is still `null` for Pro and Pro Plus and `365` for Standard.\n\n**2026-10-30.** Plan wording only; no limit, price or answer changed. \"All history\" and \"365 days\" are no longer how the plans are described. The database window, by layer: trades 7 days; 1 s ticker and mark 7 days; snapshots, funding, open interest, stats and depth 30 days; candles `1m` 30 days, `5m` and above 365 days. Older than the window is `not_retained` with the archive pointer, and the data is served as archive files, not as Parquet through the other endpoints: Standard 100 a month, Pro 1,000, Pro Plus 10,000, per file with x402 without a key. `funding_settlement` and `liquidation` are not swept.\n\n**2026-10-27.** `POST /v2/snapshots/history` takes `summary: true` with `interval` (and `fields`, to name the fields): a layer of each listing answers with the number of readings, `n`, and for each numeric field its min, max, first and last as `[value, time]`, over the window, instead of the rows. `mode` is `summary`. Funding is the same `funding_8h` basis the rows use. The extremes are the highest and lowest value observed at the interval's samples (the last reading of each period), not a settled amount; a layer with no reading says why with its state and `n: 0`. Plan depth, limits and x402 pricing are those of the same request without `summary`. The MCP `history` tool takes both. Additions only; nothing is removed or renamed.\n\n**2026-10-27.** Free, Mini and Standard read every candle timeframe, limited by depth and not by resolution. Free: `1m` 48 hours, `5m` and `15m` 7 days, `1h` 30 days, `4h` and `1d` 90 days. Mini: `1m` 7 days, `5m` and `15m` 30 days, `1h` 90 days, `4h` and `1d` 180 days. Standard: one year for every timeframe. Pro and Pro Plus read all history. A timeframe between two takes the one below it. Everything read without a timeframe (snapshots, history, trades, liquidations, funding settlements, `screen`) reaches 7 days on Free (was 48 hours), 30 on Mini, 365 on Standard. A `PLAN_LIMIT` on candles names the depth the plan has for that timeframe and the cheapest plan that reads further. `GET /v2/plans` adds `candle_history_days`, the depth for each timeframe, to every plan; `history_days` is unchanged. Nothing is removed or renamed.\n\n**2026-10-26.** The plan's history edge is read loosely by one bar and five minutes: a request may start at the plan's floor rounded down to the bar of the request (the candle `timeframe`, the history `interval`) less 5 minutes, so \"exactly the last 48 hours\" asked a few minutes late no longer gets `PLAN_LIMIT`. `earliest_from`, `retry_with` and `next` name that edge (the first grid instant at or after it for candles and history intervals). Nothing is removed or renamed.\n\n**2026-10-26.** Common venue names resolve to the registry code (an explicit table: `BINANCE-PERP`, `BINANCE-FUTURES` for `BINANCE-USDM`, `OKX-SWAP` for `OKX-PERP`, `HYPERLIQUID-PERP` for `HYPERLIQUID`, `KRAKEN-PERP` for `KRAKEN-FUTURES` and the like; no fuzzy matching), and every `/v2` answer to a request that used one carries a top-level `resolved_from` object, the name written and the code it was answered as. Errors say what was probably meant: an unknown venue names the nearest code, `symbol = BTC-PERP` says `symbol` is the venue's own symbol and suggests `instrument = BTC-PERP`, and `instrument = PERP` or `perpetual` points at the `kind` option. Additions only; a request that was an error before (`DQL_UNKNOWN_VENUE` for such a name) now succeeds.\n\n**2026-10-26.** Documentation only: Kraken Futures' live funding is the venue's predicted rate for the hour in progress; the rate that settled is the venue's own figure, which `GET /v2/funding/settlements` uses (`rate_source: venue_history`). Live samples taken before the hour differed from it on 95 of 98 prints. See Funding normalisation and Funding settlements. No field changes.\n\n**2026-10-23 (issue 619).** `GET /v2/funding/settlements`: funding as events, one row per settlement print of a listing with the rate as the venue published it, the interval in force and its cross-check against the venue's published one, `origin` (`live` or `backfill`), and the cap and floor at the time. Prints are recorded live from the venues' funding data from now on and backfilled for 90 days from Binance USD-M, Bybit, OKX, Kraken Futures and Hyperliquid; they are in no anchored day. Plan depth is the plan's history, with `PLAN_LIMIT`, `earliest_from` and `retry_with`. The MCP server has a `funding_settlements` tool. Additions only; nothing is removed or renamed.\n\n**2026-10-22 (issue 576).** `agent_rule_get` and `agent_rule_create` carry `history`: how many times the rule would have fired in the last 30 days of recorded history (the Agent's own replay), when it last would have, and what the history lacked. A fact of the past, not a forecast. `POST /v2/candles` marks a 1h, 4h or 1d bar fetched from the venue's own history after the fact with `\"origin\": \"backfill\"`. Additions only; nothing is removed or renamed.\n\n**2026-10-13 (issue 335).** Agent endpoint response contracts are now documented in `schemas.json` for MCP clients. API answers are unchanged.\n\n**Historical route note (2026-10-12, change set 37 / issue 307).** References to the public market-data `/v1`\nroutes below describe behavior at the time of each dated change; those routes and the `/lab` demo are retired\nby change set 37. This does not apply to `/runner/v1/*` or third-party venue API paths.\n\n## Announced breaking changes\n\n### Funding caps: `funding_cap`, `funding_floor`, `funding_at_cap` on the funding layer and on `/v2/instruments` — additive, takes effect when issue 365 is deployed (2026-10-13)\n\n`POST /v2/snapshots`, `POST /v2/snapshots/history`, `GET /v2/stream`, `GET /v2/instruments`, and DQL on `POST /v2/screen`. The funding layer's `values` gain `funding_cap`, `funding_floor`, `funding_cap_8h`, `funding_floor_8h` and `funding_at_cap` (a boolean or null); a listing in `/v2/instruments` gains `funding_cap`, `funding_floor`, `funding_cap_observed_at` and `funding_cap_reason`. Nothing that was there changes.\n\n**What you will see.** `funding_at_cap` is true when the funding value sits on the cap or floor the venue's API publishes (the one in force when the value was received, never a later one), false between two known bounds, and null with a reason when no bound had been observed (`not_retained`), the venue's API publishes none (`venue_capability`) or the platform does not collect it yet (`no_value`). The five names are also fields of DQL; `funding_at_cap` is its first boolean field.\n\n**What to change on your side.** Nothing. A client that validates responses against a closed list of `values` keys should add these five.\n\n### x402: you pay for what we recorded, not for what we missed — additive, takes effect when task 321 is deployed (2026-10-13)\n\n`POST /v2/snapshots`, `POST /v2/snapshots/history`, `POST /v2/candles`, `POST /v2/screen`, when paid with x402. The answers do not change by a byte; only the settlement does. This replaces the 2026-10-12 wording (\"an answer with no present value is not charged\"): a `stale` row is a row we recorded.\n\nYou pay for what we recorded, not for what we missed.\n\n**What changes.** A `200` paid with x402 is settled when its answer holds at least one recorded row: a value or row with `status: present` or `stale` (a stale row of any reason, `halted` included, is one we wrote), a bar, or a raw observation. It is not settled, and the same signed payment may be presented again, exactly as for a `400` or a `5xx`, when the answer holds no recorded row: the period is before `retention_from`, or inside a `collector_gap`, or the answer holds only `missing`, `not_published` or `off` (an `at` instant inside a collector gap has no recorded row of its own: it shows the last value before the hole, stale, beside the hole's `gap_cause`). No ledger row is written for an unsettled call. The archive file is unchanged (paid when the file exists, `302`), and so is `GET /v2/agent/state`.\n\n**What to change on your side.** Nothing. A client that read a settled payment from every `200` should not expect one when the answer holds no recorded row.\n\n### `gaps` on a `raw` history layer — additive, takes effect when task 321 is deployed (2026-10-13)\n\n`POST /v2/snapshots/history` in `raw` mode. Nothing is removed or changes meaning. Every layer of a `raw` answer carries a `gaps` array: the stretches of `(from, to]` the platform recorded as a hole (`reason: collector_gap`, `gap_cause` says what, `from`/`to` clipped to the range, `to` null when the end was never recorded) and the stretch older than the layer's `retention_from` (`reason: not_retained`), in the shape `gaps` has on `/v2/trades` and `/v2/liquidations`. It is empty when nothing was missed or with `include_gaps: false`. `interval` mode already lists the same holes as gap rows (`collector_gap`, `gap_cause`), and `at` mode beside a stale reading.\n\n**What to change on your side.** Nothing. A client that rejects unknown properties must accept `gaps` on a `raw` layer.\n\n### A quantifier or aggregate with no venue in scope is unknown, `no_venues` — takes effect when task 313 is deployed (2026-10-09)\n\nDQL wherever it runs (`/v2/screen`, history, MCP, Agent). One value is added to the null reasons: `no_venues`. No field is added or removed.\n\n**What changes.** When every listing of an instrument is left out of a quantifier's or aggregate's scope (halted, or `off` or\n`not_published` for a layer it reads; change sets 30–32), the scope is empty: `scopes` shows `venues_in_scope: 0`, \"0 of N venues\". Until now\n`any(…)` over it answered false, `all(…)` true and `count(…)` 0. All three, and `max`, `min` and `sum`, are now unknown (a count or an\naggregate is null) with the reason `no_venues` (change set 35), and the unknown propagates by the ordinary rules: `count(venues where …) >= 0` is unknown, not\ntrue. An aggregate whose venues were in scope but all dropped out by its `where` or a null stays null with `no_value`. Agent does not fire on\nsuch an instrument and, new, records a not-fired line for it: \"not fired: any(venues where …) was unknown (no_venues — no venue left in\nscope) · computed over 0 of N venues; excluded: …\". Found on AERO-PERP, where all 11 listings are excluded.\n\n**What to change on your side.** Nothing, unless you relied on `any` being false, `all` true or `count` being 0 over an instrument with no\nvenue in scope; such conditions now leave the instrument out of a screen (unknown) instead of answering. Accept `no_venues` among the null\nreasons if your client checks them against a fixed list.\n\n### `ref(INSTRUMENT, expr [, VENUE])` and `instrument` on a value — additive, takes effect when task 317 is deployed (2026-10-09)\n\n`/v2/screen` and DQL wherever it runs (history, MCP, Agent), `POST /v2/dql/parse`, `GET /v2/dql/catalogue`. Nothing is removed or changes meaning.\n\n**What is added.** A function, `ref`, that reads an expression for another instrument on the venue being evaluated (or on the venue named), at\nthe same instant: `ref(BTC-PERP, mark_close) > ref(BTC-PERP, ema(mark_close, 50, 15m))` (change set 34, spec §7.4c). A query that did not\ncontain `ref` means what it meant. A value read through `ref` carries `instrument` beside `venue` — a property no other value has; the null\nreason `not_in_scope` (the target is not listed on that venue, is halted, or a layer is off or not published for it); the machine form has a\n`ref` node; `GET /v2/dql/catalogue` lists `ref` among the functions and `reference_targets` (4) among the limits.\n\n**What to change on your side.** Nothing. A client that rejects unknown properties must accept `instrument` on a value, `not_in_scope` as\na reason and `reference_targets` among the limits; a client that walks the machine form of a query must accept the `ref` node.\n\n### `time_to_funding` and `funding_interval` are `not_published` on a continuous-funding venue — takes effect when task 310 is deployed (2026-10-09)\n\nDQL wherever it runs (`/v2/screen`, history, MCP, Agent) and `GET /v2/dql/catalogue`. No field is added or removed.\n\n**What changes.** On AVANTIS-PERP and GMX-PERP, which accrue funding continuously and never settle, `time_to_funding` and `funding_interval`\nwere `present` with a null value and the reason `funding_continuous`. They are now `not_published`, with the same reason: the field has no\nvalue by construction. So `status(time_to_funding) = present` is false there and `= not_published` true, and a quantifier that reads either\nfield leaves the listing out (change set 31): `any(venues where time_to_funding < 1h)` no longer stays unknown because of them, and `scopes`\nnames them (`not_published`, layer `funding`). The catalogue lists both venues under `not_published_on` of the two fields. `/v2/snapshots` is\nunchanged (its status is the layer's; the fields stay null with `funding_continuous`).\n\n**What to change on your side.** Nothing, unless you tested `status(time_to_funding) = present` or `status(funding_interval) = present` to\nfind listings, or relied on such an `any` being unknown.\n\n### `off` and `not_published` listings are not in the scope of `any`, `all`, `count`, `max`, `min`, `sum`; `scopes` added — takes effect when task 306 is deployed (2026-10-09)\n\n`/v2/screen` and DQL wherever it runs (history, MCP, Agent). One field is added: `scopes` on each instrument of a `/v2/screen` answer.\n\n**What changes.** A listing on which a layer a quantifier's own expression reads is `off` (DEBYKO does not collect it for the listing) or\n`not_published` (the venue never publishes it) is left out of that quantifier, as a halted listing is since change set 30. Until now it\nmade `P(v)` unknown for good, so `any(venues where mark > K)` over all venues could never be false and `all(…)` never true. Those answers\nare now false and true. The test is per quantifier: a venue without a published mark is left out of `any(venues where mark > K)` and stays in\n`any(venues where funding > 0)`. `stale` and `missing` listings stay in and still give unknown. One layer is enough: an `or` in the `where`\ndoes not keep the listing in. Every listing keeps its row in `venues` and counts in `venues_listed`. Each instrument now carries `scopes`:\nper quantifier and aggregate, `venues_listed`, `venues_in_scope` and `excluded` (`venue`, `symbol`, `reason` `halted` | `off` |\n`not_published`, `layer`). An answer `as of` a past instant judges `off` and `not_published` by today's policy and venue facts, as the status itself already did.\n\n**What to change on your side.** Nothing, unless you relied on such an `any` being unknown or on `count(venues where P) = venues_listed`\nbeing reachable while a venue does not publish the field. A client that rejects unknown fields must accept `scopes`.\n\n### A halted listing is not in the scope of `any`, `all`, `count`, `max`, `min`, `sum` — takes effect when task 305 is deployed (2026-10-09)\n\n`/v2/screen` and DQL wherever it runs (history, MCP, Agent). No field is added or removed.\n\n**What changes.** A listing the venue has halted at the instant evaluated (`stale`, reason `halted`, since change set 26) is left out of\nevery quantifier and aggregate over `venues`. Until now it made `P(v)` unknown, so `any(venues where …)` was unknown, not false, whenever\nevery live venue said false, and `all(venues where …)` was unknown, not true, whenever every live venue said true. Today that is every\nBTC-PERP, ETH-PERP, … condition that does not name its venues, because COINBASE-INTX has halted all its perpetuals since 2026-10-01. Those\nanswers are now false and true; `count(venues where status(F) = stale)` no longer counts the halted listing. Its row in an instrument's\n`venues` stays, stale `halted`, and `venues_listed` still counts it. A query `as of` an instant before the halt began answers as before.\n\n**What to change on your side.** Nothing, unless you relied on an `any` being unknown while a venue is halted; `status(F) = stale` on that\nvenue's row still says it is.\n\n### Funding intervals and units from the registry: `funding_8h` on DYDX-PERP and KRAKEN-FUTURES, a recorded unit on AVANTIS-PERP and GMX-PERP — takes effect when task 264 is deployed (2026-10-09)\n\n`/v2` and DQL (`/v2/screen`, `/v2/snapshots`, `/v2/instruments`, history, MCP). Two fields are added to `GET /v2/instruments`\n(`funding_rate_unit`, `funding_rate_unit_source`); none is removed.\n\n**What changes.**\n\n- **The rule.** `funding_8h` and `funding_short_8h` are scaled only by what the registry holds for the listing: the settlement interval on a\n  venue that settles, the period the published rate is per on one that accrues continuously. No registry figure, no eight-hour value (null)\n  and no part in a comparison (`max`, `min`, `sum`, `count(venues where funding_8h …)`). After this change every perpetual collected has one.\n- **DYDX-PERP and KRAKEN-FUTURES** now carry their documented hour in the registry (`funding_interval: \"1h\"`,\n  `funding_interval_source: \"venue_documentation\"` — as NADO-PERP's now says too, where it said `venue`), so their `funding_8h` is filled; it\n  was null, `venue_capability`, and the catalogue no longer lists Kraken under `not_published_on` for `funding_interval` and `funding_8h`.\n  The server setting `MarketData__KrakenFundingIntervalFromDocumentation` is gone.\n- **AVANTIS-PERP and GMX-PERP** (continuous accrual) now have their rate's unit in the registry: `funding_rate_unit: \"per_hour\"`, with its\n  source. `funding_interval` stays null (`funding_continuous`). Their `funding_8h` is the rate × 8, the same figure as before: what the\n  platform stores for both is already a rate per hour (GMX's `fundingRateLong` is the contracts' per-second factor × 3600 on every one of\n  125 pools; Avantis' `fundingRate` is percent per hour). Until now the × 8 was an assumption made for every continuous venue, whatever\n  its unit; applied to a rate per second it would have been wrong by a factor of 3 600 — GMX BTC-USDC's per-second factor 5.576e-9 × 8 is\n  4.46e-8 (0.0000045 %), where the eight-hour rate is 5.576e-9 × 28 800 = 1.606e-4 (0.016 %). A continuous listing without a unit in the\n  registry would now answer null (`funding_continuous`) instead.\n- A settled funding rate's horizon reads the registry's interval only (dYdX's pair-level hour is no longer used): without one it would be\n  `horizon_unknown`.\n\n**What to change on your side.** Nothing, if you compare `funding_8h`: two more venues take part. Read `funding_rate_unit` before scaling a\ncontinuous venue's `funding` yourself.\n\n### `/v1`: a layer the policy does not collect is `off`, with no age — takes effect when task 239 is deployed (2026-10-08)\n\n`/v1/snapshot` and `/v1/book`. No field is removed; `ageSeconds` of a layer may now be absent.\n\n**What changes.** A layer that a listing's group does not collect — on production the book's bands of every listing outside the core\nand the top 100 — read `status: \"stale\"` (`state_lag`, `connection_lost`) with an `ageSeconds` of about seven days: Redis still held the\nvalue from before the policy switched the layer off, and the snapshot aged it. It now reads `status: \"off\"`, `reason: \"policy_off\"`, as\nDQL and `/v2` say it, with no `ageSeconds`, `receivedAgeSeconds` or `staleAfterSeconds`; nothing of the row is read from the leftover\nvalue. `/v1/book` of such a listing answers 404, as for a listing that is not collected.\n\n**What to change on your side.** Read `status` before `ageSeconds`; treat `off` as \"not collected for this listing\", not as a fault.\n### A settled funding rate is current for its interval and five minutes; ask `status(funding) = present` — takes effect when task 238 is deployed (2026-10-08)\n\n`/v1` and `/v2`. No field moves.\n\n**What changes.** A funding rate the venue settles (dYdX, Coinbase INTX: `venue_ts` is the settlement it belongs to, `anchor: \"venue\"`)\nwas current until `venue_ts` + the interval and stale for the minute or two every period that the next settlement took to reach us. It is\nnow current until `venue_ts` + the listing's own funding interval (the registry's, per listing — 1 h, 4 h, 8 h; the pair's fact where the\nregistry holds none) + 5 minutes, and its `valid_until` and `/v1/snapshot`'s `staleAfterSeconds` say so. Its age is unchanged: time since\nthe venue dated it, that is since the settlement — so **`age(funding) < 2m` is false on such a venue for most of every period**, and a query\nthat meant \"a current funding rate\" by it leaves those venues out.\n\n**What to change on your side.** Ask `status(funding) = present` for \"current\", for example\n`count(venues where funding_8h > 1bps and status(funding) = present) >= 3`. Keep `age(F)` for \"how long since the venue dated it\".\n\n### An eighth stale reason, `no_update` — takes effect when task 237 is deployed (2026-10-08)\n\n`/v1` and `/v2`. A reason is added to the closed set a client may read in `reason` (`NullReason` in the schemas); no field moves.\n\n**What changes.** A value the venue pushes only when it changes (`horizon_source: \"connection\"`) used to stay `present` for as long as\nits connection lived, however long its timestamp stood still. Each such pair now has a no-update threshold, measured on production and\nlisted on the Freshness page: past it, with the connection alive, the value is `stale` with reason `no_update`, and its `valid_until` —\nnull until now while the connection lived — is the instant the threshold runs out. A socket on which nothing at all arrives for longer\nthan its venue guarantees it speaks is now treated as a lost connection: the values on it are `connection_lost`, as after any\ndisconnection. `/v1/snapshot` writes the reason in each layer's `reason`; `/v1/status` counts it under the cause `us`.\n\n**What to change on your side.** Treat an unknown `reason` as \"not current, see `status`\" — which a stale value already is. Do not read\na non-null `valid_until` as \"this value is not on its connection\": `horizon_source` says that.\n\n### A seventh stale reason, `halted` — takes effect when task 233 is deployed (2026-10-08)\n\n`/v1` and `/v2`. A reason is added to the closed set a client may read in `reason` (`NullReason` in the schemas); no field moves.\n\n**What changes.** Every layer with a value of a listing the venue said it does not trade, at the instant asked about, is `stale` with\nreason `halted` (it was `present`, or stale for another reason): COINBASE-INTX's listings since 2026-10-01 09:00:29 UTC, Nado's ADA-PERP and\nARB-PERP. Their ticker and book stay `not_published`. A value read at an instant before the halt began is judged as it was. `/v1/status`\ngives it the cause `venue`; `/v1/snapshot` writes it in each layer's `reason`.\n\n**What to change on your side.** Treat an unknown `reason` as \"not current, see `status`\" — which a stale value already is.\n\n### One definition of age: `age_ms`, `age(F)`, `freshness` and `/v1`'s `ageSeconds` count from the venue's timestamp — takes effect when task 232 is deployed (2026-10-08)\n\n`/v1` and `/v2`. No field is added to `/v2` or removed anywhere; numbers change where the venue dates its values.\n\n**What changes.** A value's age is `T −` its anchor, the clock its horizon already counted from (ADR-025): the venue's own\ntimestamp (`venue_ts`) where the pair's cadence fact says it dates the publication — or, for a settled funding rate, the\nsettlement — and our receipt (`received_at`) only where the venue sends no time for the layer or its time dates something\nelse (`anchor: \"receipt\"`; the Freshness section lists those pairs). Until now `age_ms`, `age(F)` and the `freshness`\nbound were always `T − received_at`, so a quote whose venue timestamp had stopped read as young as our last poll:\nCOINBASE-INTX paused every perpetual on 2026-10-01 09:00:29 UTC, we polled it every two seconds, and its quotes read 0.7 s\nold for a week while their `status` said `stale`.\n\n- **`age_ms`** of a snapshot value, a book, a stream update, an `at` history row and a screen's value object is that age.\n  Where `anchor` is `venue` it now equals `venue_age_ms` (tens to hundreds of milliseconds more than before on a healthy\n  feed; the whole standstill on a frozen one); a settled funding rate is as old as its settlement. Where `anchor` is\n  `receipt` nothing changes. `venue_age_ms` is unchanged; how long ago we received a value is `evaluated_at − received_at`.\n- **`age(F)`** in DQL is the same number, so `age(mark) < 10s` is false for a mark the venue dated ten minutes ago, however\n  recently we read it. `age` of a source (`age(close, 1h)`) still counts from `received_at`.\n- **`freshness <duration>`** compares the same age: a value is `stale` with `freshness_bound` when its age exceeds the bound.\n- **`/v1/snapshot`**: `ageSeconds` of a row and of each of its `layers` is that age; each layer adds `receivedAgeSeconds` (what\n  `ageSeconds` said before), `anchor`, `status` (`present` or `stale`), `reason` and `staleAfterSeconds` — the verdict\n  `/v2` gives the same value, and how old the age may grow before it is stale. `/v1/book`'s `bookAgeSeconds` the same.\n  `/v1/status` lists `receivedAgeMs` beside `ageMs`.\n\n**What to change on your side.** Nothing, if you read `age_ms` as \"how old the value is\" and `status` as \"may I use it\". If\nyou used `age_ms` to measure our delivery latency, use `evaluated_at − received_at`.\n\n### One vocabulary of layer names, and a plan's refusal of a venue — takes effect when change set 20 is deployed (the date is written here then)\n\n`/v2` only. Four things a client may read differently; nothing is removed that a request needs.\n\n- **`GET /v2/instruments`: the keys of `layers` are `trade` and `liquidation`** (they were `trades` and `liquidations`), as everywhere else a layer is named. `ticker`, `mark`, `funding`, `oi`, `book`, `stats`, `candles` and `book_bands` are as they were.\n- **`GET /v2/anchors/proof` and `GET /v2/anchors/{day}` print the layers as `oi`, `book` and `candles`** (they printed `open-interest`, `depth-derived` and `candle`) in `layer` and in `partitions[].layer`. A request may still write either spelling in `?layer=`. `table` and the canonical text of the row, which are hashed, are unchanged: a proof made before still verifies.\n- **A venue that exists and is outside the key's plan is `PLAN_VENUE_NOT_INCLUDED`, 403** (it was `DQL_UNKNOWN_VENUE`, 400, listing only the venues of the plan as \"known\"). `DQL_UNKNOWN_VENUE` is for a code no venue has.\n- **`POST /v2/snapshots`: `missing[].reason` can be `not_in_plan`** (it said `not_listed` for a pair that exists and that the plan does not include).\n\n**What to change on your side.** Read `trade` and `liquidation` in `instruments`; read the anchor's layers as `oi`, `book`, `candles` (or keep sending the old spellings); branch on `PLAN_VENUE_NOT_INCLUDED` as a plan's limit, not as a typo; treat an unknown `missing[].reason` as \"nothing there\".\n\n### A thousand-fold listing moves to the bare market: `1000PEPE-PERP` and `kPEPE-PERP` become `PEPE-PERP` — takes effect when the Writer applies migration 0067 on 2026-10-01 at 20:55:57 UTC (sunset of the old names 2026-12-30 20:55:57 UTC)\n\n`/v1` and `/v2`. Eight listings; two market names; one asset code each.\n\n**What changes.** A venue that quotes a token in thousands names it with a prefix (`1000PEPEUSDT`, `kPEPE-PERP_USDT0`).\nThe platform used to treat that as another token and keep a market of its own for it. A prefix is a property of the\nlisting, not of the token, so the listing now stands on the bare market, with the factor it stands for as its\n`multiplier`:\n\n| Market until now | Market from now | Listings that move (venue, symbol) |\n|---|---|---|\n| `1000PEPE-PERP` (asset `1000PEPE`) | `PEPE-PERP` (asset `PEPE`) | Aster `1000PEPEUSDT`; Binance `1000PEPEUSDC`, `1000PEPEUSDT`; Bybit `1000PEPEPERP`, `1000PEPEUSDT`; Synthetix `1000PEPE-USDT`; Weex `cmt_1000pepeusdt` |\n| `kPEPE-PERP` (asset `kPEPE`) | `PEPE-PERP` (asset `PEPE`) | Nado `kPEPE-PERP_USDT0` |\n\nThis is the list as `/v1/markets` held it on 2026-10-01; the resolver recomputes it at rollout and moves a listing only\nwhere the bare market has no other listing on the same venue (a venue that has both is left as it is). No other market\nchanges its name or loses a listing; `PEPE-PERP` gains these, and every other listing is byte-identical in `/v1` and `/v2`.\n\n- `instrument` (`/v2` rows and `/v1/markets/{code}`) and `base` change for these listings: `PEPE-PERP`, `PEPE`.\n- `multiplier` of these listings was what the venue publishes, `1`, next to a base that already says \"a thousand\". It\n  is now the factor the listing stands for: the venue's multiplier times the prefix, `1000`. A value read with\n  `units: base` was a thousand times too large; from now on it is right. A client that corrected for it by hand now\n  corrects twice.\n- `base_venue_alias` in `GET /v2/instruments` keeps the base as the venue publishes it (`1000PEPE`, `kPEPE`).\n\n**How the old name is answered, for 90 days from the rename.**\n\n- `GET /v1/markets/1000PEPE-PERP` answers `308 Permanent Redirect` to `/v1/markets/PEPE-PERP` (the query string is kept) with\n  `Deprecation: @<unix seconds>` (RFC 9745, the instant of the rename), `Sunset: <HTTP-date>` (RFC 8594, the rename plus 90 days)\n  and `Link: </v1/markets/PEPE-PERP>; rel=\"successor-version\"`. After the Sunset date the old name is `404`, like any name\n  the platform does not know. `/v1/markets/kPEPE-PERP` the same.\n- `GET /v2/instruments?renamed_from=1000PEPE-PERP` returns the listings that carried that name, and every listing of\n  `GET /v2/instruments` inside its 90 days carries `renamed_from`: `{\"instrument\": \"1000PEPE-PERP\", \"at\": \"<the instant of the rename>\"}`.\n  The field is absent on every other listing and after the 90 days.\n- DQL has no alias. A code starts with a letter, so `1000PEPE-PERP` was never writable in `where`; nobody wrote it there, and the\n  other `/v2` endpoints answer to the new name only. A bot that holds the old name holds what it read out of an answer.\n\n**What to change on your side.**\n- Read `PEPE-PERP` where you read `1000PEPE-PERP` or `kPEPE-PERP`, and `base` `PEPE` where you read `1000PEPE` or `kPEPE`.\n- Read `multiplier` and stop applying the thousand yourself.\n- Follow the `308` once and store the new name; log `Deprecation` and `Sunset` when you see them. To find a listing you only know by the old\n  name, ask `GET /v2/instruments?renamed_from=<old name>` within the 90 days.\n\n### A value past its validity horizon leaves the value field — takes effect 2026-09-29 (deployed at 11:50 UTC)\n\n`/v2` only. `/v1` does not change.\n\n**What changes.** Today a stale value is returned where a present one would be, with a larger `age_ms`: a client\nthat forgets to look at `status` reads a number that was no longer current. From the date above such a value is\nnot in the value field at all.\n\n- Every value of a snapshot layer states how long it is good for. `valid_until` (RFC 3339, UTC) is the instant\n  after which the platform no longer treats it as current. It is null while a push feed's connection is alive\n  (see below), and null when no horizon is known. `horizon_source` says where the horizon comes from:\n  - `venue_declared` — the venue said when the next value comes;\n  - `measured` — a cadence the platform measured;\n  - `documented` — the venue's documentation;\n  - `assumed` — a cadence the platform assumes;\n  - `connection` — the value holds while the connection that delivered it is alive.\n\n  `anchor` is `venue` when the horizon counts from the venue's own timestamp, or `receipt` when it counts from\n  `received_at`. There are two ages: `age_ms` by our clock, from `received_at`, and `venue_age_ms` by the venue's\n  clock, from `venue_ts`. `venue_age_ms` is null when the venue sends no time.\n- Past `valid_until` a layer is `stale` and carries a reason. Its values, `raw` and band figures are absent. They\n  are returned under a separate key, `withheld`, only when the request sets `allow_stale: true`; the default is\n  `false`. The reasons:\n  - `horizon_passed` — no new value within the horizon;\n  - `connection_lost` — the connection that delivered the value was lost, or its collector restarted;\n  - `state_lag` — **our own** live projection fell behind the bus; the venue and the connection were fine;\n  - `horizon_unknown` — no cadence fact covers the value, so nothing proves it was current;\n  - `freshness_bound` — the request's own `freshness` bound is tighter than the horizon.\n- The five states stay distinct everywhere: `present`, `stale`, `missing`, `not_published`, `off`. None of them\n  becomes another, a zero, or a carried-forward number.\n\n**Where.** `POST /v2/snapshots` (layer `values`, `reasons`, `raw`, liquidity `bands`); `POST /v2/snapshots/history`\nin `at` mode; `GET /v2/stream` (`snapshot` and `update` events; `allow_stale=true` on the subscription);\n`POST /v2/screen` (a venue value that is stale has `value: null`, and `withheld` holds it only with `allow_stale`);\n`GET /v2/books` (`bids`, `asks`, `mid`, `spread` of a stale book; `?allow_stale=true`).\n\n**The bound is per venue and dataset, not per layer.** It used to be one bound per layer for the whole platform:\n30 s for ticker, mark, oi and book, 120 s for stats, 300 s for funding. Now each (venue, dataset) pair has its own\nhorizon, derived from a published fact about its cadence. A polled value is good for twice the longer of its\npolling interval and the history window it is kept at. Consequences, measured on production over 24 hours:\n\n- **Stale less often.** Open interest on Binance, Aster and Weex (polled every 300 s) and books on Bitget and Gate\n  (300 s) were stale about 90 % of the time; MEXC books (600 s) 95 %. They become present. dYdX open interest went\n  from 89 % stale to about 6 %.\n- **Stale more often, briefly.** Kraken ticker, mark, open interest and stats are stale about 0.07 % of the time,\n  in intervals of at most about two seconds after a reconnect (Kraken funding, sent in the same frame, likewise in\n  the live answer). Hyperliquid mark, open interest and stats,\n  and Gate's ticker, about 0.02 %. Fast feeds kept at one-second history (Kraken's book, Hyperliquid's ticker and\n  book) are stale up to 0.3 % of the time, where the old 30 s bound hid it.\n\n**Push feeds that send only on change.** Kraken ticker, mark, open interest, stats and funding; Hyperliquid mark,\nopen interest and stats; the Binance, Aster and Gate tickers; dYdX open interest. A quiet socket there means\n\"nothing changed\", not \"no data\". Their horizon is the life of the connection: the last value holds while the\ncollector's connection is up, and becomes stale from the moment a disconnection, a collector restart, a bus outage\nor our own projection lag is recorded (and only while that lag lasts: from 2026-10-01 a lag that has closed ends\nnothing, State having caught up, unless the connection broke inside its window — that break ends the value). The platform never fakes a heartbeat to keep such a value fresh.\n\n**Series over those feeds carry the value forward, and say so.** A sampled series (for example `last` at `1m`)\nover a push feed used to show a `gap` for every period in which the value did not change. Now such a period takes\nthe last value, if the connection was alive through the whole period, and marks it as carried:\n\n- `carried: true` on the history row (`/v2/snapshots/history`, `interval` mode);\n- `carried: true` on a screen `SeriesValue`;\n- in DQL, `carried(S, n)`: the number of the `n` periods ending at `S[0]` whose value was carried rather than\n  observed. `carried(last, 1) = 0` is true only when `S[0]` was observed in its own period.\n\nCandles are never carried.\n\n**DQL.**\n- `freshness <d>` can only tighten. It used to replace every layer's bound, so `freshness 10m` loosened them.\n  Now each pair's bound is `min(horizon, d)`.\n- A stale operand still compares as unknown, and `status(F) = stale` is still never unknown.\n- `count` still does not count stale venues.\n\n**Response fields that change meaning.** `freshness` in the `snapshots`, `snapshots/history` and `screen`\nresponses reports the request's own bound per layer, or null where none was given (each pair's horizon applies).\n`freshness_defaults` in `GET /v2/dql/catalogue` is kept for compatibility and is no longer applied.\n\n**What is added and does not break.** `GET /v2/instruments` states, per layer, the cadence fact behind the horizon:\n`mode`, `interval`, `label` (`documented`, `measured`, `assumed`) and what the venue's timestamp dates\n(`publication`, `settlement`, `none`). The Freshness section of the API reference lists which pairs rest on an\nassumed cadence; it is a published fact, not a hidden setting.\n\n**What to change on your side.**\n- If you read a value without checking `status`, you get `null` or no key instead of a stale number. That is the\n  point of the change.\n- If you log what your strategy read, log `status`, `reason` and `valid_until` beside the value.\n- For post-mortems, ask with `allow_stale: true` and read `withheld`. Never feed `withheld` into a live decision.\n- If you used `freshness` to loosen a bound, remove it: the per-pair horizon already covers slow polls.\n\n## DQL v1 — Change Set 01\n\n- 0. Verdict on the review\n- 1. C1-01 — Sampled snapshot series\n- Motivation\n- Amendments\n- 2. C1-02 — Functions: `abs`, `rolling_sum`, `percentile`, `percentile_rank`\n- 3. C1-03 — Fields: `bid_size`, `ask_size`, `tick_size`, `lot_size`, `min_qty`\n- 4. C1-04 — Book depth within a price band (replaces the top-25 sums)\n- 5. C1-05 — `select` clause (projection)\n- 6. C1-06 — Multi-key `order by`\n- 7. C1-07 — Numeric precision in responses\n- 8. C1-08 — Small corrections to draft 1\n- 9. Conformance additions\n- 9.1 Fixture additions (§16.1)\n- 9.2 Queries and expected results (§16.2, continued)\n- 10. Guide additions (new cookbook entries)\n- 4.16 Mark price up more than half a percent in five minutes, on three venues or more\n- 4.17 Spread below its own 24-hour 90th percentile\n- 4.18 At least 50 000 quote units resting within 10 bps of mid on the bid side, on any venue\n- 4.19 Ask for values you are not filtering on, and order by two keys\n- Guide §6 (missing data) — add one line to the table\n- Guide §7 (Pine) — add\n- Guide §8 (SQL) — add\n- 11. Rejected and deferred, with reasons\n- 12. Notes for the data endpoints (outside DQL)\n- 13. Open questions added to §17\n\n## DQL and Market-Data API — Change Set 02 (bot migration readiness)\n\n- 0. Verdict on the second review\n- 1. C2-01 — Timeframes `2m`, `3m`, `12h`\n- 2. C2-02 — Mark-price and index-price candle sources\n- 3. C2-03 — `percentile` method argument\n- 4. C2-04 — Instruments contract: `GET /v2/instruments`\n- 5. C2-05 — Latest snapshots contract: `POST /v2/snapshots`\n- 6. C2-06 — Snapshot history contract: `POST /v2/snapshots/history`\n- 7. C2-07 — Candles contract: `POST /v2/candles`\n- 8. C2-08 — Order books contract: `POST /v2/books`\n- 9. C2-09 — Batch limits, numbers, consistency\n- 10. Migration protocol: source change ≠ indicator change\n- 11. Rejected and still deferred\n- 12. Open questions added\n- 13. Conformance additions (DQL only; endpoint contracts get contract tests, not corpus entries)\n\n## DQL and Market-Data API — Change Set 03\n\n- 0. Verdict on the third review\n- 1. C3-01 — Liquidity band metrics (supersedes C1-04 and change-set-02 §8 for liquidity)\n- 1.1 Definition (ingestion time)\n- 1.2 Exposure in the data endpoints\n- 1.3 DQL (replaces the C1-04 rules)\n- 1.4 Cadence disclosure\n- 2. C3-02 — Candle volume \"as published\"; `mark_volume` / `index_volume` sources\n- 3. C3-03 — Corrections to change-set-02 text\n- 3.1 Hydration (replaces the last paragraph of change set 02 §6)\n- 3.2 Cycle alignment (replaces the `2m` row of change set 02 §0 and the sentence in §1)\n- 3.3 Settled replay (replaces the `settled` rule of change set 02 §6)\n- 4. C3-04 — `include_raw` on `GET /v2/instruments`; rules normalisation\n- 5. C3-05 — Migration protocol additions (change set 02 §10)\n- 6. Open questions added\n- 7. Conformance updates\n\n## DQL and Market-Data API — Change Set 04 (platform decisions)\n\n- 1. C4-01 — An instrument is a market; `instrument` and `base` fields\n- 2. C4-02 — `where`: selection is part of the language\n- 2.1 Grammar\n- 2.2 Semantics\n- 2.3 Every endpoint selects with `where`\n- 3. C4-03 — Venue codes come from the registry: `GET /v2/venues`\n- 4. C4-04 — Units are requested, and every value states its own\n- 5. C4-05 — Alerts leave the API\n- 6. C4-06 — The platform as it is (facts replacing assumptions)\n- 7. C4-07 — Endpoint set of v2\n- 7a. C4-08 — `GET /v2/stream` (decision 2026-09-22)\n- 8. Open questions — status\n- 9. Conformance additions\n\nThe full text of each set is in the repository under `docs/engineering/api/history/`. The specification\nhas absorbed all of them: where the two disagree, the specification is right and the change set is\nhistory.\n\n\n# Migrating from exchange APIs\n\nMoving a bot off an exchange's own API, or off several.\n\nThis page is about the differences that actually cost you time. It is not a sales pitch; where the platform is\nworse for your case, it says so.\n\n## What you stop writing\n\n**One client instead of N.** Every venue's REST is its own dialect: its own symbols, its own rate limits, its\nown funding convention, its own idea of what a \"24h change\" is. Here there is one request shape and one answer\nshape, and the venue's own spelling comes back in `venue_symbol` for when you need to send an order.\n\n**One question instead of N round trips.** \"Which instruments have positive funding on at least three venues,\nwhere the funding reading is current\" is one query:\n\n```dql\ncount(venues where funding_8h > 0 and status(funding) = present) >= 3\n```\n\nAgainst exchange APIs that is a fan-out, a join, and a set of decisions about what to do when one venue is slow\nto answer — decisions you would be making in your own code, silently, differently each time.\n\n**Normalisation you did not write.** Funding is per-interval as the venue publishes it, and `funding_8h` is the\ncomparable figure wherever the registry holds the listing's interval, or a continuous venue's rate unit (elsewhere it\nis null, and the listing is not compared); both, and their sources, are stated per listing in `GET /v2/instruments`\nso you can check them rather than trust them.\n\n## What changes in how you think\n\n**A missing value is not a zero.** Exchange APIs are inconsistent about this — some omit a field, some send\nnull, some send `0`, some send the last value they had. Here a value is always an object with a status, and\nfive things are told apart: present, stale, missing, not published by the venue, not collected by the\nplatform. Code that treated absence as zero will need a branch. That branch is the bug you had.\n\n**Comparisons can answer *unknown*.** If a reading is stale, `funding > 0` is neither true nor false. `all(...)`\nover a set with one stale reading is unknown, not false. Ask for `include_unknown` and you get those instruments\nback labelled, instead of a screen that quietly narrowed itself.\n\n**Time is receipt time.** A historical answer uses what was visible at that instant, not what is known now. A\nreading that arrived late was not available to you then, and a backtest that used it would be measuring\ninformation you did not have.\n\n**Venues are never averaged.** There is no \"the price of BTC\". If you want one, you compute it, and you will\nhave to decide what to do about the venue that is stale — which is the decision the platform refuses to make\nfor you.\n\n## A rough map\n\n| what you did | what you do here |\n| --- | --- |\n| `GET /fapi/v1/premiumIndex` per venue | `POST /v2/snapshots` with `where`, or a DQL condition on `funding` |\n| `GET /fapi/v1/klines` per symbol, per venue | `POST /v2/candles`, many listings in one request |\n| `GET /api/v3/depth`, then compute depth yourself | `POST /v2/books`, or `depth_bid_value(10bps)` in a query |\n| exchange info for tick size and lot size | `GET /v2/instruments` |\n| a websocket per venue, reconnect logic per venue | `GET /v2/stream` for snapshot layers, or `GET /v2/trades/stream` for raw trades |\n| a venue's trade-history endpoint | `POST /v2/trades`, bounded stored events with explicit gap coverage |\n| your own staleness heuristics | `status(...)` and `age(...)`, stated per value |\n\n## What the platform does not give you\n\nSaid plainly, because finding out later is worse:\n\n- **No orders.** This is data. It will tell you the tick size; it will not place anything.\n- **DQL and Agent are perpetual-only.** The market-data endpoints can read spot with `kind: \"spot\"` and both kinds with `kind: \"all\"`.\n- **No trade-tape functions in DQL.** Stored trades are available through `POST /v2/trades` and `GET /v2/trades/stream`; the stream has bounded subscribers and no replay.\n- **No per-venue websocket parity.** The stream carries the layers the platform collects, at the platform's\n  cadence, not every message the venue emits.\n- **Only the venues in [Venues in DQL](#venues-in-dql).** A venue the platform does not collect is not there,\n  and the list is read live rather than promised.\n\n## The first hour\n\n1. `GET /v2/venues` and `GET /v2/dql/catalogue` — no key. Learn what exists and what a query may name. Venues\n   and instruments are paged (`limit` defaults to 500); follow `next_cursor` until null and keep each page's\n   `registry_revision` the same before treating the catalogue as complete.\n2. Write the condition you care about and send it to `POST /v2/dql/parse` until it parses. Still no key.\n3. Get a key, run it on `POST /v2/screen` with `include_unknown: true`, and look at what came back *unknown* —\n   that is your real coverage.\n4. Replace your staleness heuristics with `status(...)` and delete them.\n",
    "version": "2"
  },
  "servers": [
    {
      "url": "http://127.0.0.1:5399/"
    }
  ],
  "paths": {
    "/v2/venues": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "A page of venues collected, with its public code and what it quotes",
        "description": "Every venue DEBYKO collects: its public code (`venue`), the registry kind its prices come from (`order_book`, `oracle` or `spot`), how it charges funding (`funding_mode`: `settled` on a schedule, `continuous` accrued against a vault), how many listings it has, how many of them the platform collects (`listings_collected`) and since when. This list is the count of venues: nothing else states one, so read it rather than assuming a number. `kind` selects perpetual (the default), spot or all. Use `limit` (1–500, default 500) and follow `next_cursor` until it is null to read every venue. Pages share `registry_revision`; keep the same filters while continuing. A stale cursor or changed request scope returns `DQL_CURSOR`; restart without a cursor.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "description": "`perpetual` (default), `spot`, or `all`. On `/v2/venues`, this filters venues by the market kind of their listings; the response item's `kind` still describes the venue category.",
            "schema": {
              "$ref": "#/components/schemas/MarketKindSelector"
            }
          },
          {
            "name": "include_synthetic",
            "in": "query",
            "description": "Include synthetic test venues and listings. Defaults to false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size from 1 to 500. Defaults to 500.",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor from the prior page's `next_cursor`. Keep other request options unchanged; restart from the first page when the cursor is stale or scope has changed.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every venue in DQL, with how many listings it has and how many of them the platform collects.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VenuesResponse"
                },
                "examples": {
                  "every venue in DQL": {
                    "summary": "What the platform collects, and how much of each venue it collects — `listings` is what the venue lists, `listings_collected` is what is actually gathered.",
                    "description": "Live data, captured from the public endpoints. 2026-09-23T11:28:26.904Z.",
                    "value": {
                      "evaluated_at": "2026-09-23T11:28:26.904Z",
                      "registry_revision": "2026-09-23T11:28:26.904Z.f78b77f848f073634ad0df313bd48d234f27206cf523dd6f5018575231c01eed",
                      "next_cursor": null,
                      "items": [
                        {
                          "venue": "HYPERLIQUID",
                          "name": "Hyperliquid",
                          "kind": "order_book",
                          "listings": 234,
                          "listings_collected": 5,
                          "since": "2026-09-21T12:03:13.315Z"
                        },
                        {
                          "venue": "KRAKEN-FUTURES",
                          "name": "Kraken Futures",
                          "kind": "order_book",
                          "listings": 296,
                          "listings_collected": 5,
                          "since": "2026-09-20T15:11:19.524Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/instruments": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "A page of instruments and their listings on venues",
        "description": "One entry per listing of an instrument on a venue: the venue's own symbol (`venue_symbol`) beside the platform's `instrument`, the rules it trades under, `funding_interval` (how often funding settles there, and `funding_interval_source` where the venue does not publish it), the `funding_cap` and `funding_floor` the venue's API publishes, what is collected for it (`layers`, with `history_cadence`) and what the venue never publishes (`not_published`, a fact about the venue and not a gap in the data). Use `limit` (1–500, default 500) and follow `next_cursor` until it is null to read every listing. Pages share `registry_revision`; keep the same filters while continuing. A stale cursor or changed request scope returns `DQL_CURSOR`; restart without a cursor.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "description": "`perpetual` (default), `spot`, or `all`. On `/v2/venues`, this filters venues by the market kind of their listings; the response item's `kind` still describes the venue category.",
            "schema": {
              "$ref": "#/components/schemas/MarketKindSelector"
            }
          },
          {
            "name": "include_synthetic",
            "in": "query",
            "description": "Include synthetic test venues and listings. Defaults to false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size from 1 to 500. Defaults to 500.",
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer",
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor from the prior page's `next_cursor`. Keep other request options unchanged; restart from the first page when the cursor is stale or scope has changed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mapped",
            "in": "query",
            "description": "Filter by mapping: true for resolved instruments, false for unmapped listings. Omit to include both.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "collected",
            "in": "query",
            "description": "Filter by current collection policy: true for collected listings, false for uncollected listings. Omit to include both.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every selected listing: how its venue names it, what it trades under, and what is collected for it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstrumentsResponse"
                },
                "examples": {
                  "one asset across its venues": {
                    "summary": "`?where=base = BTC` — every BTC listing, with the symbol each venue uses, its contract rules and what is collected for it.",
                    "description": "Live data, captured from the public endpoints. 2026-09-23T11:28:26.904Z.",
                    "value": {
                      "evaluated_at": "2026-09-23T11:28:27.118Z",
                      "registry_revision": "2026-09-23T11:28:27.118Z.bf96b16abe250df1069a531df3bbef48bf6c16a3fdfa8f266df63e26975c256c",
                      "next_cursor": null,
                      "as_of": "2026-09-23T11:28:27.118Z",
                      "catalogue": "2026-09-22",
                      "units": "published",
                      "items": [
                        {
                          "instrument": "BTC-PERP",
                          "venue": "HYPERLIQUID",
                          "venue_symbol": "BTC",
                          "base": "BTC",
                          "base_venue_alias": null,
                          "quote": "USDC",
                          "kind": "perpetual",
                          "venue_kind": null,
                          "pair": null,
                          "status": "tradeable",
                          "post_only": null,
                          "contract_size": 1,
                          "multiplier": 1,
                          "tick_size": null,
                          "lot_size": null,
                          "min_qty": null,
                          "min_notional": null,
                          "price_decimals": null,
                          "qty_decimals": 5,
                          "units": {
                            "tick_size": "quote",
                            "lot_size": "base",
                            "min_qty": "base",
                            "min_notional": "quote"
                          },
                          "funding_interval": "1h",
                          "funding_interval_source": "venue",
                          "funding_normalisation": {
                            "venue_field": "funding",
                            "transform": "identity"
                          },
                          "rules_normalisation": {
                            "funding_interval": {
                              "venue_field": "fundingIntervalHours",
                              "transform": "hours_to_duration"
                            },
                            "qty_decimals": {
                              "venue_field": "szDecimals",
                              "transform": "identity"
                            }
                          },
                          "candles": {
                            "base_timeframe": "1m",
                            "price_types": [
                              "trade"
                            ],
                            "timeframes": [
                              "1m",
                              "5m",
                              "15m",
                              "30m",
                              "1h",
                              "4h",
                              "12h",
                              "1d"
                            ]
                          },
                          "layers": {
                            "ticker": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "mark": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "funding": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "oi": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "book": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "stats": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "candles": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "trade": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "book_bands": {
                              "policy": "on",
                              "cadence": "live"
                            }
                          },
                          "not_published": [
                            "change_24h",
                            "index_close",
                            "index_high",
                            "index_low",
                            "index_open",
                            "index_volume",
                            "mark_close",
                            "mark_high",
                            "mark_low",
                            "mark_open",
                            "mark_volume"
                          ],
                          "bands": [
                            "10bps",
                            "25bps",
                            "50bps",
                            "100bps"
                          ],
                          "listed_at": null,
                          "first_seen_at": "2026-09-21T20:05:09.829Z",
                          "delisted_at": null,
                          "venue_ts": null,
                          "received_at": "2026-09-23T11:20:39.343Z",
                          "age_ms": 467774
                        },
                        {
                          "instrument": "BTC-PERP",
                          "venue": "KRAKEN-FUTURES",
                          "venue_symbol": "PF_XBTUSD",
                          "base": "BTC",
                          "base_venue_alias": null,
                          "quote": "USD",
                          "kind": "perpetual",
                          "venue_kind": "flexible_futures",
                          "pair": "BTC:USD",
                          "status": "tradeable",
                          "post_only": false,
                          "contract_size": 1,
                          "multiplier": 1,
                          "tick_size": 1,
                          "lot_size": null,
                          "min_qty": null,
                          "min_notional": null,
                          "price_decimals": null,
                          "qty_decimals": 4,
                          "units": {
                            "tick_size": "quote",
                            "lot_size": "base",
                            "min_qty": "base",
                            "min_notional": "quote"
                          },
                          "funding_interval": null,
                          "funding_interval_reason": "venue_capability",
                          "funding_normalisation": {
                            "venue_field": "relative_funding_rate",
                            "transform": "identity"
                          },
                          "rules_normalisation": {
                            "contract_size": {
                              "venue_field": "contractSize",
                              "transform": "identity"
                            },
                            "qty_decimals": {
                              "venue_field": "contractValueTradePrecision",
                              "transform": "identity"
                            },
                            "tick_size": {
                              "venue_field": "tickSize",
                              "transform": "identity"
                            }
                          },
                          "candles": {
                            "base_timeframe": "1m",
                            "price_types": [
                              "trade",
                              "mark",
                              "index"
                            ],
                            "timeframes": [
                              "1m",
                              "5m",
                              "15m",
                              "30m",
                              "1h",
                              "4h",
                              "12h",
                              "1d"
                            ]
                          },
                          "layers": {
                            "ticker": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "mark": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "funding": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "oi": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "book": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "stats": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "candles": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "trade": {
                              "policy": "on",
                              "cadence": "live"
                            },
                            "book_bands": {
                              "policy": "on",
                              "cadence": "live"
                            }
                          },
                          "not_published": [
                            "funding_8h",
                            "funding_interval"
                          ],
                          "bands": [
                            "10bps",
                            "25bps",
                            "50bps",
                            "100bps"
                          ],
                          "listed_at": "2022-03-22T13:15:36Z",
                          "first_seen_at": "2026-09-21T20:05:09.829Z",
                          "delisted_at": null,
                          "venue_ts": null,
                          "received_at": "2026-09-23T11:20:44.399Z",
                          "age_ms": 462718
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/snapshots": {
      "post": {
        "tags": [
          "Measurements"
        ],
        "summary": "The latest value of each layer for the selected listings",
        "description": "Each value is stored as the venue published it and comes with the venue that published it, the venue's own time (`venue_ts`), the time the platform received it (`received_at`) and its age (`age_ms`). Its status is one of `present`, `stale`, `missing`, `not_published` and `off`, and only a `present` value comes with a number: a stale value is withheld (it is under `withheld` only when the request sets `allow_stale`), the others are null with a `reason`, never zero. The `funding` layer carries the venue's own rate for its own interval (`funding`, with `funding_interval`) and `funding_8h`, the same rate restated over 8 hours; `funding_8h` is null where the venue publishes no interval or unit. An instrument-venue pair that does not exist comes back under `missing`. For the same snapshot in the past, use `POST /v2/snapshots/history`.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SnapshotsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The latest reading of each layer for the selected listings, and the instrument-venue pairs that do not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotsResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/snapshots/history": {
      "post": {
        "tags": [
          "Measurements"
        ],
        "summary": "The same snapshot as it stood at a past moment, or per second over an interval",
        "description": "Point-in-time history, as three different questions: `at` returns what had been recorded as of each named instant (a stored reading counts from the end of its sampling window, with its `received_at` and status, the same every time), `interval` returns one row per period, and `raw` returns every row as it arrived. A period or stretch without a reading is a gap row with its reason (`collector_gap` and `gap_cause` where the platform recorded a hole, `not_retained` where it is older than `retention_from`), never the previous value carried forward. Each row carries the instrument mapping valid at its instant, so a renamed symbol is read as it was then. A response that is `settled` can no longer be changed by a late arrival.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HistoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The same snapshot as it stood in the past: one row per period, per named instant, or per message as it arrived.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/candles": {
      "post": {
        "tags": [
          "Measurements"
        ],
        "summary": "Candles for the selected listings, in any stored period and price type",
        "description": "Completed candles only. One-minute candles are the venue's own klines; every longer period is rolled up from them and exists only when every base minute of it exists. A period the platform does not have is a gap row with a reason, never an interpolation, and a forming candle is never returned. A 1h, 4h or 1d bar from before collection began is the venue's own kline fetched later and carries `origin: \"backfill\"` (a bar the platform observed has no `origin`); it is not part of any anchored day. `as_of` is the receipt-time availability cutoff: `to` bounds candle closes, `as_of` bounds when their input was available.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CandlesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Completed candles, gaps written out as gaps, nothing synthesised.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandlesResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/liquidations": {
      "post": {
        "tags": [
          "Measurements"
        ],
        "summary": "Liquidations for the selected listings, one by one, in a window of up to a week",
        "description": "An event stream, not a series: the events of the window in time order, and where the list is known to be incomplete the stretches that are. The totals of the same window are the `liquidation_*` functions of a query.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiquidationsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The liquidations the venues published, each once, with the stretches of the window the list is known to miss.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiquidationsResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/funding/settlements": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Funding settlement prints, one row per print of a listing, newest first",
        "description": "Funding as events: one row for each time a venue settled a listing's funding, with the settlement `time` as the venue states it, the `rate` exactly as published for the listing's own interval (`rate_8h` restates it over 8 hours), the `interval` in force at that print and whether it agrees with the one the venue publishes (`interval_check`: a mismatch is flagged and never corrected), `origin` (`live`, recorded as it settled, or `backfill`, read afterwards from the venue's own history) and the `cap` and `floor` the venue published at the time with `at_cap`. A print whose rate the platform did not have is `missing` with a reason, never zero. `not_recorded` names the venues of the selection with no prints and why. Select listings with `where`, bound the window with `from` and `to` (the window is `(from, to]`, a week back by default), choose `order`, and follow `next_cursor` until it is null. Depth is the plan's history, as `POST /v2/snapshots/history`: an older `from` is refused with `PLAN_LIMIT`, naming `earliest_from` and the request to send instead (`retry_with`). These prints are in no anchored day.",
        "parameters": [
          {
            "name": "where",
            "in": "query",
            "description": "A DQL selection expression, for example `venue = BINANCE-USDM and instrument = BTC-PERP`. Omitted selects every listing, which the limit of 500 listings usually refuses.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "An ISO-8601 UTC instant: the window starts after it (exclusive). Defaults to seven days before `to`, or as far back as the plan reads when that is less. Older than the plan reads is `PLAN_LIMIT` with `earliest_from` and `retry_with`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "An ISO-8601 UTC instant: the window ends at it (inclusive). Defaults to now; a later instant is read as now.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "`desc` (default): newest first. `asc`: oldest first.",
            "schema": {
              "type": "string",
              "default": "desc"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Rows of a page, from 1 to 1000. Defaults to 500.",
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer",
              "default": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor from the prior page's `next_cursor`. It pins the window of the first page; keep `where` and `order` unchanged. A stale or foreign cursor returns `DQL_CURSOR`; restart from the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number_format",
            "in": "query",
            "description": "`json` (default): numbers as JSON numbers. `string`: every number as a string with the same digits.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One row per settlement print of the selected listings in the window: the rate as published, the interval in force and its cross-check, the origin, the cap and floor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundingSettlementsResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/trades": {
      "post": {
        "tags": [
          "Measurements"
        ],
        "summary": "Stored trade events for the selected listings, with known retention and collection gaps",
        "description": "Returns the newest bounded set per listing in ascending event time. The requested interval is half-open `(from, to]`, with a maximum seven-day window. A row limit does not mean the interval is complete: inspect `truncated`, `retention_from`, and trade dataset gaps.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TradesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored trade events for the selected listings, with known retention and collection gaps.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TradesResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/books": {
      "post": {
        "tags": [
          "Measurements"
        ],
        "summary": "Order books for the selected listings, to the depth the plan allows",
        "description": "Levels per side, best first, to the depth the plan allows (the answer states the depth applied), with the mid, the spread and the depth resting in each band around the mid. Each book is dated by the observation that carried its levels (`venue_ts`, `received_at`, `age_ms`) and has a status like any other value; a stale book is withheld, not returned as levels. `sequence` is the venue's own update number where its feed carries one, otherwise null. Levels are never stored, so a book cannot be replayed.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BooksRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Order books to the depth the plan allows, with the depth resting in each band around the mid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BooksResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/screen": {
      "post": {
        "tags": [
          "Measurements"
        ],
        "summary": "Run a DQL query across venues and return what matched",
        "description": "The query is DQL, one condition across every venue that lists an instrument. Each returned value comes with the venue that published it, when the platform received it and how old it was; venues are never averaged, and a value that is not current compares as unknown rather than as a number. Instruments the data could not decide are returned, with `result: unknown`, only with `include_unknown`. A query that names `as of` is evaluated as of that instant.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreenRequest"
              },
              "examples": {
                "a condition across venues": {
                  "summary": "The plainest useful query: instruments where some venue pays a positive funding rate. Every value comes back with the venue that published it, when it arrived and how old it was.",
                  "value": {
                    "query": "any(venues where funding > 0)",
                    "limit": 2
                  }
                },
                "a reading that went stale": {
                  "summary": "A stale reading is not an error and is not hidden: it comes back with its true age and `status: stale`, and it compares as unknown. This query finds the instruments that have one.",
                  "value": {
                    "query": "count(venues where status(funding) = stale) >= 1",
                    "limit": 2
                  }
                },
                "an instrument that could not be decided": {
                  "summary": "With `include_unknown` the answer also carries the instruments the data could not decide — `result: unknown` — instead of silently dropping them. A screen that hides what it could not see is a screen that lies about its coverage.",
                  "value": {
                    "query": "all(venues where funding > 0)",
                    "limit": 3,
                    "include_unknown": true
                  }
                },
                "a total over the liquidations of a window": {
                  "summary": "A liquidation is an event, so it is read as a total over a window of periods — here the four 15-minute periods ending at the latest period end — never as a reading of \"now\". Kraken closed three long positions in the hour, OKX one; Bybit keeps none for this group (`off`) and Hyperliquid's feed carries none (`not_published`).",
                  "value": {
                    "query": "any(venues where liquidation_long_count(4) >= 1) where instrument = BTC-PERP timeframe 15m",
                    "limit": 1
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The instruments that matched, each value with the venue that published it, when it arrived and how old it was.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenResponse"
                },
                "examples": {
                  "a condition across venues": {
                    "summary": "The plainest useful query: instruments where some venue pays a positive funding rate. Every value comes back with the venue that published it, when it arrived and how old it was.",
                    "description": "Fixture data: real venue codes and symbols, invented numbers.",
                    "value": {
                      "dql": "1",
                      "query": {
                        "string": "any(venues where funding > 0)",
                        "json": {
                          "dql": "1",
                          "condition": {
                            "type": "any",
                            "where": {
                              "type": "cmp",
                              "op": ">",
                              "left": {
                                "type": "field",
                                "name": "funding"
                              },
                              "right": {
                                "type": "number",
                                "value": 0
                              }
                            }
                          }
                        }
                      },
                      "evaluated_at": "2026-09-23T12:00:05Z",
                      "as_of": null,
                      "settled": false,
                      "normalisation_version": "2026-10-12",
                      "freshness": {
                        "ticker": null,
                        "mark": null,
                        "oi": null,
                        "book": null,
                        "stats": null,
                        "funding": null
                      },
                      "instruments": [
                        {
                          "instrument": "BTC-PERP",
                          "result": "true",
                          "values": {},
                          "scopes": {
                            "any(venues where funding > 0)": {
                              "venues_listed": 4,
                              "venues_in_scope": 4,
                              "excluded": []
                            }
                          },
                          "venues": [
                            {
                              "venue": "BYBIT-PERP",
                              "symbol": "BTCUSDT",
                              "quote": "USDT",
                              "values": {
                                "funding": {
                                  "value": null,
                                  "unit": "fraction",
                                  "venue": "BYBIT-PERP",
                                  "layer": "funding",
                                  "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",
                                  "reason": "horizon_passed"
                                }
                              }
                            },
                            {
                              "venue": "HYPERLIQUID",
                              "symbol": "BTC",
                              "quote": "USDC",
                              "values": {
                                "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"
                                }
                              }
                            },
                            {
                              "venue": "KRAKEN-FUTURES",
                              "symbol": "PF_XBTUSD",
                              "quote": "USD",
                              "values": {
                                "funding": {
                                  "value": 0.00001,
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "OKX-PERP",
                              "symbol": "BTC-USDT-SWAP",
                              "quote": "USDT",
                              "values": {
                                "funding": {
                                  "value": 0.000054,
                                  "unit": "fraction",
                                  "venue": "OKX-PERP",
                                  "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"
                                }
                              }
                            }
                          ]
                        },
                        {
                          "instrument": "ETH-PERP",
                          "result": "true",
                          "values": {},
                          "scopes": {
                            "any(venues where funding > 0)": {
                              "venues_listed": 3,
                              "venues_in_scope": 3,
                              "excluded": []
                            }
                          },
                          "venues": [
                            {
                              "venue": "BYBIT-PERP",
                              "symbol": "ETHUSDT",
                              "quote": "USDT",
                              "values": {
                                "funding": {
                                  "value": 0.000018,
                                  "unit": "fraction",
                                  "venue": "BYBIT-PERP",
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "KRAKEN-FUTURES",
                              "symbol": "PF_ETHUSD",
                              "quote": "USD",
                              "values": {
                                "funding": {
                                  "value": 0.000007,
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "OKX-PERP",
                              "symbol": "ETH-USDT-SWAP",
                              "quote": "USDT",
                              "values": {
                                "funding": {
                                  "value": null,
                                  "unit": "fraction",
                                  "venue": "OKX-PERP",
                                  "layer": "funding",
                                  "venue_ts": null,
                                  "received_at": null,
                                  "age_ms": null,
                                  "status": "missing",
                                  "reason": "no_value"
                                }
                              }
                            }
                          ]
                        }
                      ],
                      "page": {
                        "limit": 2,
                        "returned": 2,
                        "next_cursor": "eyJ0IjoiMjAyNi0wOS0yM1QxMjowMDowNVoiLCJhZnRlciI6IkVUSC1QRVJQIiwicSI6IjExZDhjM2VmZWNkZGNjNTYifQ"
                      }
                    }
                  },
                  "a reading that went stale": {
                    "summary": "A stale reading is not an error and is not hidden: it comes back with its true age and `status: stale`, and it compares as unknown. This query finds the instruments that have one.",
                    "description": "Fixture data: real venue codes and symbols, invented numbers.",
                    "value": {
                      "dql": "1",
                      "query": {
                        "string": "count(venues where status(funding) = stale) >= 1",
                        "json": {
                          "dql": "1",
                          "condition": {
                            "type": "cmp",
                            "op": ">=",
                            "left": {
                              "type": "count",
                              "where": {
                                "type": "cmp",
                                "op": "=",
                                "left": {
                                  "type": "call",
                                  "name": "status",
                                  "args": [
                                    {
                                      "type": "field",
                                      "name": "funding"
                                    }
                                  ]
                                },
                                "right": {
                                  "type": "status",
                                  "value": "stale"
                                }
                              }
                            },
                            "right": {
                              "type": "number",
                              "value": 1
                            }
                          }
                        }
                      },
                      "evaluated_at": "2026-09-23T12:00:05Z",
                      "as_of": null,
                      "settled": false,
                      "normalisation_version": "2026-10-12",
                      "freshness": {
                        "ticker": null,
                        "mark": null,
                        "oi": null,
                        "book": null,
                        "stats": null,
                        "funding": null
                      },
                      "instruments": [
                        {
                          "instrument": "BTC-PERP",
                          "result": "true",
                          "values": {},
                          "scopes": {
                            "count(venues where status(funding) = stale)": {
                              "venues_listed": 4,
                              "venues_in_scope": 4,
                              "excluded": []
                            }
                          },
                          "venues": [
                            {
                              "venue": "BYBIT-PERP",
                              "symbol": "BTCUSDT",
                              "quote": "USDT",
                              "values": {
                                "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"
                                }
                              }
                            },
                            {
                              "venue": "HYPERLIQUID",
                              "symbol": "BTC",
                              "quote": "USDC",
                              "values": {
                                "status(funding)": {
                                  "value": "present",
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "KRAKEN-FUTURES",
                              "symbol": "PF_XBTUSD",
                              "quote": "USD",
                              "values": {
                                "status(funding)": {
                                  "value": "present",
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "OKX-PERP",
                              "symbol": "BTC-USDT-SWAP",
                              "quote": "USDT",
                              "values": {
                                "status(funding)": {
                                  "value": "present",
                                  "venue": "OKX-PERP",
                                  "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"
                                }
                              }
                            }
                          ]
                        }
                      ],
                      "page": {
                        "limit": 2,
                        "returned": 1,
                        "next_cursor": null
                      }
                    }
                  },
                  "an instrument that could not be decided": {
                    "summary": "With `include_unknown` the answer also carries the instruments the data could not decide — `result: unknown` — instead of silently dropping them. A screen that hides what it could not see is a screen that lies about its coverage.",
                    "description": "Fixture data: real venue codes and symbols, invented numbers.",
                    "value": {
                      "dql": "1",
                      "query": {
                        "string": "all(venues where funding > 0)",
                        "json": {
                          "dql": "1",
                          "condition": {
                            "type": "all",
                            "where": {
                              "type": "cmp",
                              "op": ">",
                              "left": {
                                "type": "field",
                                "name": "funding"
                              },
                              "right": {
                                "type": "number",
                                "value": 0
                              }
                            }
                          }
                        }
                      },
                      "evaluated_at": "2026-09-23T12:00:05Z",
                      "as_of": null,
                      "settled": false,
                      "normalisation_version": "2026-10-12",
                      "freshness": {
                        "ticker": null,
                        "mark": null,
                        "oi": null,
                        "book": null,
                        "stats": null,
                        "funding": null
                      },
                      "instruments": [
                        {
                          "instrument": "BTC-PERP",
                          "result": "unknown",
                          "values": {},
                          "scopes": {
                            "all(venues where funding > 0)": {
                              "venues_listed": 4,
                              "venues_in_scope": 4,
                              "excluded": []
                            }
                          },
                          "venues": [
                            {
                              "venue": "BYBIT-PERP",
                              "symbol": "BTCUSDT",
                              "quote": "USDT",
                              "values": {
                                "funding": {
                                  "value": null,
                                  "unit": "fraction",
                                  "venue": "BYBIT-PERP",
                                  "layer": "funding",
                                  "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",
                                  "reason": "horizon_passed"
                                }
                              }
                            },
                            {
                              "venue": "HYPERLIQUID",
                              "symbol": "BTC",
                              "quote": "USDC",
                              "values": {
                                "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"
                                }
                              }
                            },
                            {
                              "venue": "KRAKEN-FUTURES",
                              "symbol": "PF_XBTUSD",
                              "quote": "USD",
                              "values": {
                                "funding": {
                                  "value": 0.00001,
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "OKX-PERP",
                              "symbol": "BTC-USDT-SWAP",
                              "quote": "USDT",
                              "values": {
                                "funding": {
                                  "value": 0.000054,
                                  "unit": "fraction",
                                  "venue": "OKX-PERP",
                                  "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"
                                }
                              }
                            }
                          ]
                        },
                        {
                          "instrument": "ETH-PERP",
                          "result": "unknown",
                          "values": {},
                          "scopes": {
                            "all(venues where funding > 0)": {
                              "venues_listed": 3,
                              "venues_in_scope": 3,
                              "excluded": []
                            }
                          },
                          "venues": [
                            {
                              "venue": "BYBIT-PERP",
                              "symbol": "ETHUSDT",
                              "quote": "USDT",
                              "values": {
                                "funding": {
                                  "value": 0.000018,
                                  "unit": "fraction",
                                  "venue": "BYBIT-PERP",
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "KRAKEN-FUTURES",
                              "symbol": "PF_ETHUSD",
                              "quote": "USD",
                              "values": {
                                "funding": {
                                  "value": 0.000007,
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "OKX-PERP",
                              "symbol": "ETH-USDT-SWAP",
                              "quote": "USDT",
                              "values": {
                                "funding": {
                                  "value": null,
                                  "unit": "fraction",
                                  "venue": "OKX-PERP",
                                  "layer": "funding",
                                  "venue_ts": null,
                                  "received_at": null,
                                  "age_ms": null,
                                  "status": "missing",
                                  "reason": "no_value"
                                }
                              }
                            }
                          ]
                        },
                        {
                          "instrument": "SOL-PERP",
                          "result": "true",
                          "values": {},
                          "scopes": {
                            "all(venues where funding > 0)": {
                              "venues_listed": 1,
                              "venues_in_scope": 1,
                              "excluded": []
                            }
                          },
                          "venues": [
                            {
                              "venue": "HYPERLIQUID",
                              "symbol": "SOL",
                              "quote": "USDC",
                              "values": {
                                "funding": {
                                  "value": 0.0000125,
                                  "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"
                                }
                              }
                            }
                          ]
                        }
                      ],
                      "page": {
                        "limit": 3,
                        "returned": 3,
                        "next_cursor": null
                      }
                    }
                  },
                  "a total over the liquidations of a window": {
                    "summary": "A liquidation is an event, so it is read as a total over a window of periods — here the four 15-minute periods ending at the latest period end — never as a reading of \"now\". Kraken closed three long positions in the hour, OKX one; Bybit keeps none for this group (`off`) and Hyperliquid's feed carries none (`not_published`).",
                    "description": "Fixture data: real venue codes and symbols, invented numbers.",
                    "value": {
                      "dql": "1",
                      "query": {
                        "string": "any(venues where liquidation_long_count(4) >= 1) timeframe 15m where instrument = BTC-PERP",
                        "json": {
                          "dql": "1",
                          "condition": {
                            "type": "any",
                            "where": {
                              "type": "cmp",
                              "op": ">=",
                              "left": {
                                "type": "call",
                                "name": "liquidation_long_count",
                                "args": [
                                  {
                                    "type": "number",
                                    "value": 4
                                  }
                                ]
                              },
                              "right": {
                                "type": "number",
                                "value": 1
                              }
                            }
                          },
                          "timeframe": "15m",
                          "where": {
                            "type": "cmp",
                            "op": "=",
                            "left": {
                              "type": "field",
                              "name": "instrument"
                            },
                            "right": {
                              "type": "code",
                              "value": "BTC-PERP"
                            }
                          }
                        }
                      },
                      "evaluated_at": "2026-09-23T12:00:05Z",
                      "as_of": null,
                      "settled": false,
                      "timeframe": "15m",
                      "normalisation_version": "2026-10-12",
                      "freshness": {
                        "ticker": null,
                        "mark": null,
                        "oi": null,
                        "book": null,
                        "stats": null,
                        "funding": null
                      },
                      "instruments": [
                        {
                          "instrument": "BTC-PERP",
                          "result": "true",
                          "values": {},
                          "scopes": {
                            "any(venues where liquidation_long_count(4) >= 1)": {
                              "venues_listed": 4,
                              "venues_in_scope": 2,
                              "excluded": [
                                {
                                  "venue": "BYBIT-PERP",
                                  "symbol": "BTCUSDT",
                                  "reason": "off",
                                  "layer": "liquidation"
                                },
                                {
                                  "venue": "HYPERLIQUID",
                                  "symbol": "BTC",
                                  "reason": "not_published",
                                  "layer": "liquidation"
                                }
                              ]
                            }
                          },
                          "venues": [
                            {
                              "venue": "BYBIT-PERP",
                              "symbol": "BTCUSDT",
                              "quote": "USDT",
                              "values": {
                                "liquidation_long_count(4)": {
                                  "value": null,
                                  "venue": "BYBIT-PERP",
                                  "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": "off",
                                  "reason": "policy_off"
                                }
                              }
                            },
                            {
                              "venue": "HYPERLIQUID",
                              "symbol": "BTC",
                              "quote": "USDC",
                              "values": {
                                "liquidation_long_count(4)": {
                                  "value": null,
                                  "venue": "HYPERLIQUID",
                                  "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": "not_published",
                                  "reason": "venue_capability"
                                }
                              }
                            },
                            {
                              "venue": "KRAKEN-FUTURES",
                              "symbol": "PF_XBTUSD",
                              "quote": "USD",
                              "values": {
                                "liquidation_long_count(4)": {
                                  "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"
                                }
                              }
                            },
                            {
                              "venue": "OKX-PERP",
                              "symbol": "BTC-USDT-SWAP",
                              "quote": "USDT",
                              "values": {
                                "liquidation_long_count(4)": {
                                  "value": 1,
                                  "venue": "OKX-PERP",
                                  "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"
                                }
                              }
                            }
                          ]
                        }
                      ],
                      "page": {
                        "limit": 1,
                        "returned": 1,
                        "next_cursor": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/dql/parse": {
      "post": {
        "tags": [
          "Coverage"
        ],
        "summary": "Check a query without running it",
        "description": "Answers with the position of the first problem and what was expected there, so an editor can underline it.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ParseRequest"
              },
              "examples": {
                "a query checked, not run": {
                  "summary": "What the platform understood, what the query reads, and what it costs — without touching market data or a key.",
                  "value": {
                    "query": "any(venues where funding > 0)"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The query in canonical form, what it reads and what it costs — without reading any market data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ParseResponse"
                },
                "examples": {
                  "a query checked, not run": {
                    "summary": "What the platform understood, what the query reads, and what it costs — without touching market data or a key.",
                    "description": "Live data, captured from the public endpoints. 2026-09-23T11:28:26.904Z.",
                    "value": {
                      "dql": "1",
                      "query": {
                        "string": "any(venues where funding > 0)",
                        "json": {
                          "dql": "1",
                          "condition": {
                            "type": "any",
                            "where": {
                              "type": "cmp",
                              "op": ">",
                              "left": {
                                "type": "field",
                                "name": "funding"
                              },
                              "right": {
                                "type": "number",
                                "value": 0
                              }
                            }
                          }
                        }
                      },
                      "atoms": {
                        "instrument": [],
                        "venue": [
                          "funding"
                        ]
                      },
                      "timeframes": [],
                      "complexity": {
                        "nodes": 4,
                        "bars": 0,
                        "cost": 4
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/dql/catalogue": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "What a query may ask for: fields, layers, timeframes, units and every limit",
        "description": "Read this rather than hard-coding a list: it is generated from the registry and the policy the collectors run on, so it changes the moment the platform does.",
        "responses": {
          "200": {
            "description": "Every field, source, function, code and limit a query may use, as data rather than as prose.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogueResponse"
                },
                "examples": {
                  "everything a query may name": {
                    "summary": "Read this instead of hard-coding a list of fields, functions, venues or limits.",
                    "description": "Live data, captured from the public endpoints. 2026-09-23T11:28:26.904Z.",
                    "value": {
                      "dql": "1",
                      "catalogue": "2026-09-22",
                      "evaluated_at": "2026-09-23T11:28:26.994Z",
                      "fields": [
                        {
                          "name": "instrument",
                          "type": "code",
                          "scope": "instrument",
                          "layer": "reference",
                          "unit": "code",
                          "description": "the market code, e.g. BTC-PERP",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "base",
                          "type": "code",
                          "scope": "instrument",
                          "layer": "reference",
                          "unit": "code",
                          "description": "the base asset's registry code, e.g. BTC",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "venues_listed",
                          "type": "number",
                          "scope": "instrument",
                          "layer": "reference",
                          "unit": "count",
                          "description": "number of (selected) listings at T",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "venues_answered",
                          "type": "number",
                          "scope": "instrument",
                          "layer": "reference",
                          "unit": "count",
                          "description": "number of (selected) listings whose mark is present at T",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "venue",
                          "type": "code",
                          "scope": "venue",
                          "layer": "reference",
                          "unit": "code",
                          "description": "the venue's public code",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "quote",
                          "type": "code",
                          "scope": "venue",
                          "layer": "reference",
                          "unit": "code",
                          "description": "the listing's quote currency",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "tick_size",
                          "type": "number",
                          "scope": "venue",
                          "layer": "reference",
                          "unit": "quote",
                          "description": "minimum price increment of the listing",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "lot_size",
                          "type": "number",
                          "scope": "venue",
                          "layer": "reference",
                          "unit": "quantity",
                          "description": "minimum quantity increment",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "min_qty",
                          "type": "number",
                          "scope": "venue",
                          "layer": "reference",
                          "unit": "quantity",
                          "description": "minimum order quantity",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "last",
                          "type": "number",
                          "scope": "venue",
                          "layer": "ticker",
                          "unit": "quote",
                          "description": "last trade price",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "mark",
                          "type": "number",
                          "scope": "venue",
                          "layer": "mark",
                          "unit": "quote",
                          "description": "venue mark price",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "index",
                          "type": "number",
                          "scope": "venue",
                          "layer": "mark",
                          "unit": "quote",
                          "description": "venue index price",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "basis",
                          "type": "number",
                          "scope": "venue",
                          "layer": "mark",
                          "unit": "fraction",
                          "description": "(mark − index) / index",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "funding",
                          "type": "number",
                          "scope": "venue",
                          "layer": "funding",
                          "unit": "fraction",
                          "description": "published rate for the next settlement, per interval",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "funding_interval",
                          "type": "duration",
                          "scope": "venue",
                          "layer": "funding",
                          "unit": "ms",
                          "description": "settlement interval as published",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": [
                            "KRAKEN-FUTURES"
                          ]
                        },
                        {
                          "name": "funding_8h",
                          "type": "number",
                          "scope": "venue",
                          "layer": "funding",
                          "unit": "fraction",
                          "description": "funding × 8h / funding_interval",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": [
                            "KRAKEN-FUTURES"
                          ]
                        },
                        {
                          "name": "time_to_funding",
                          "type": "duration",
                          "scope": "venue",
                          "layer": "funding",
                          "unit": "ms",
                          "description": "next_funding_at − T",
                          "sampleable": false,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "oi",
                          "type": "number",
                          "scope": "venue",
                          "layer": "oi",
                          "unit": "quantity",
                          "description": "open interest",
                          "sampleable": true,
                          "additive": true,
                          "not_published_on": []
                        },
                        {
                          "name": "bid",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quote",
                          "description": "best bid price",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "ask",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quote",
                          "description": "best ask price",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "mid",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quote",
                          "description": "(bid + ask) / 2",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "spread",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "fraction",
                          "description": "(ask − bid) / mid",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": []
                        },
                        {
                          "name": "bid_size",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quantity",
                          "description": "resting quantity at the best bid",
                          "sampleable": true,
                          "additive": true,
                          "not_published_on": []
                        },
                        {
                          "name": "ask_size",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quantity",
                          "description": "resting quantity at the best ask",
                          "sampleable": true,
                          "additive": true,
                          "not_published_on": []
                        },
                        {
                          "name": "volume_24h",
                          "type": "number",
                          "scope": "venue",
                          "layer": "stats",
                          "unit": "quantity",
                          "description": "rolling 24h traded volume as published",
                          "sampleable": true,
                          "additive": true,
                          "not_published_on": []
                        },
                        {
                          "name": "turnover_24h",
                          "type": "number",
                          "scope": "venue",
                          "layer": "stats",
                          "unit": "quote",
                          "description": "rolling 24h traded value as published",
                          "sampleable": true,
                          "additive": true,
                          "not_published_on": []
                        },
                        {
                          "name": "change_24h",
                          "type": "number",
                          "scope": "venue",
                          "layer": "stats",
                          "unit": "fraction",
                          "description": "24h price change as published",
                          "sampleable": true,
                          "additive": false,
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        }
                      ],
                      "sources": [
                        {
                          "name": "open",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "trade",
                          "unit": "quote",
                          "description": "trade candle open",
                          "not_published_on": []
                        },
                        {
                          "name": "high",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "trade",
                          "unit": "quote",
                          "description": "trade candle high",
                          "not_published_on": []
                        },
                        {
                          "name": "low",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "trade",
                          "unit": "quote",
                          "description": "trade candle low",
                          "not_published_on": []
                        },
                        {
                          "name": "close",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "trade",
                          "unit": "quote",
                          "description": "trade candle close",
                          "not_published_on": []
                        },
                        {
                          "name": "volume",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "trade",
                          "unit": "quantity",
                          "description": "trade candle volume",
                          "not_published_on": []
                        },
                        {
                          "name": "mark_open",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "mark",
                          "unit": "quote",
                          "description": "mark-price candle open",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "mark_high",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "mark",
                          "unit": "quote",
                          "description": "mark-price candle high",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "mark_low",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "mark",
                          "unit": "quote",
                          "description": "mark-price candle low",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "mark_close",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "mark",
                          "unit": "quote",
                          "description": "mark-price candle close",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "mark_volume",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "mark",
                          "unit": "quantity",
                          "description": "mark-price candle volume as published",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "index_open",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "index",
                          "unit": "quote",
                          "description": "index-price candle open",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "index_high",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "index",
                          "unit": "quote",
                          "description": "index-price candle high",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "index_low",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "index",
                          "unit": "quote",
                          "description": "index-price candle low",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "index_close",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "index",
                          "unit": "quote",
                          "description": "index-price candle close",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        },
                        {
                          "name": "index_volume",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "price_type": "index",
                          "unit": "quantity",
                          "description": "index-price candle volume as published",
                          "not_published_on": [
                            "HYPERLIQUID"
                          ]
                        }
                      ],
                      "functions": [
                        {
                          "name": "prev",
                          "signature": "prev(S, k)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "S[k]"
                        },
                        {
                          "name": "sma",
                          "signature": "sma(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "simple moving average"
                        },
                        {
                          "name": "ema",
                          "signature": "ema(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "exponential moving average over a fixed 4n window"
                        },
                        {
                          "name": "rsi",
                          "signature": "rsi(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "relative strength index, Wilder smoothing over 4n"
                        },
                        {
                          "name": "atr",
                          "signature": "atr(n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "average true range of the trade candles"
                        },
                        {
                          "name": "stdev",
                          "signature": "stdev(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "population standard deviation"
                        },
                        {
                          "name": "highest",
                          "signature": "highest(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "max(S[0] … S[n−1])"
                        },
                        {
                          "name": "lowest",
                          "signature": "lowest(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "min(S[0] … S[n−1])"
                        },
                        {
                          "name": "change",
                          "signature": "change(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "S[0] − S[n]"
                        },
                        {
                          "name": "roc",
                          "signature": "roc(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "(S[0] − S[n]) / S[n]"
                        },
                        {
                          "name": "crossover",
                          "signature": "crossover(A, B)",
                          "type": "boolean",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "A[0] > B[0] and A[1] ≤ B[1]"
                        },
                        {
                          "name": "crossunder",
                          "signature": "crossunder(A, B)",
                          "type": "boolean",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "A[0] < B[0] and A[1] ≥ B[1]"
                        },
                        {
                          "name": "gaps",
                          "signature": "gaps(n)",
                          "type": "number",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "missing periods among the last n"
                        },
                        {
                          "name": "abs",
                          "signature": "abs(x)",
                          "type": "number",
                          "scope": "venue",
                          "layer": "",
                          "unit": "none",
                          "description": "|x|, element-wise for series"
                        },
                        {
                          "name": "rolling_sum",
                          "signature": "rolling_sum(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "S[n−1] + … + S[0]"
                        },
                        {
                          "name": "percentile",
                          "signature": "percentile(S, n, p, [method])",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "nearest-rank (default) or linear percentile of S[0] … S[n−1]"
                        },
                        {
                          "name": "percentile_rank",
                          "signature": "percentile_rank(S, n)",
                          "type": "series",
                          "scope": "venue",
                          "layer": "candles",
                          "unit": "none",
                          "description": "share of S[0] … S[n−1] that are ≤ S[0]"
                        },
                        {
                          "name": "age",
                          "signature": "age(F)",
                          "type": "duration",
                          "scope": "venue",
                          "layer": "",
                          "unit": "none",
                          "description": "T − received_at of the value used for F"
                        },
                        {
                          "name": "status",
                          "signature": "status(F)",
                          "type": "status",
                          "scope": "venue",
                          "layer": "",
                          "unit": "none",
                          "description": "state of F's layer at T"
                        },
                        {
                          "name": "depth_bid",
                          "signature": "depth_bid(band)",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quantity",
                          "description": "bid quantity within band of mid",
                          "not_published_on": []
                        },
                        {
                          "name": "depth_ask",
                          "signature": "depth_ask(band)",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quantity",
                          "description": "ask quantity within band of mid",
                          "not_published_on": []
                        },
                        {
                          "name": "depth_bid_value",
                          "signature": "depth_bid_value(band)",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quote",
                          "description": "bid value (price × size) within band of mid",
                          "not_published_on": []
                        },
                        {
                          "name": "depth_ask_value",
                          "signature": "depth_ask_value(band)",
                          "type": "number",
                          "scope": "venue",
                          "layer": "book",
                          "unit": "quote",
                          "description": "ask value (price × size) within band of mid",
                          "not_published_on": []
                        }
                      ],
                      "venues": [
                        "HYPERLIQUID",
                        "KRAKEN-FUTURES"
                      ],
                      "currencies": [
                        "USD",
                        "USDC"
                      ],
                      "assets": [
                        "",
                        "BTC",
                        "CYPH",
                        "DOGE",
                        "ETH",
                        "GTLB",
                        "KSTR",
                        "MSTU",
                        "OURA",
                        "SOL",
                        "XRP"
                      ],
                      "instruments": [
                        "-PERP",
                        "BTC-PERP",
                        "CYPH-PERP",
                        "DOGE-PERP",
                        "ETH-PERP",
                        "GTLB-PERP",
                        "KSTR-PERP",
                        "MSTU-PERP",
                        "OURA-PERP",
                        "SOL-PERP",
                        "XRP-PERP"
                      ],
                      "timeframes": [
                        "1m",
                        "5m",
                        "15m",
                        "30m",
                        "1h",
                        "4h",
                        "12h",
                        "1d"
                      ],
                      "bands": [
                        "10bps",
                        "25bps",
                        "50bps",
                        "100bps"
                      ],
                      "freshness_defaults": {
                        "ticker": "30s",
                        "mark": "30s",
                        "funding": "300s",
                        "oi": "30s",
                        "book": "30s",
                        "stats": "120s"
                      },
                      "limits": {
                        "source_bytes": 8192,
                        "nodes": 256,
                        "depth": 24,
                        "quantifiers_and_aggregates": 16,
                        "series_calls": 32,
                        "timeframes": 3,
                        "window": 500,
                        "bars_per_atom": 2000,
                        "cost": 10000,
                        "in_list": 32,
                        "select": 16,
                        "order_by": 4,
                        "freshness_min": "1s",
                        "freshness_max": "604800s",
                        "screen_limit": 500,
                        "endpoints": {
                          "snapshots_listings": 500,
                          "history_listings": 100,
                          "history_rows_per_layer": 2000,
                          "history_raw_rows": 100000,
                          "candles_listings": 100,
                          "candles_per_listing": 1500,
                          "books_listings": 100,
                          "book_depth": 25,
                          "stream_listings": 500,
                          "response_bytes": 8388608
                        }
                      },
                      "settle_after": 120,
                      "earliest_retained": "2026-09-14T00:00:00Z",
                      "units": [
                        "published",
                        "base"
                      ],
                      "number_formats": [
                        "json",
                        "string"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/plans": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "Every self-serve plan and its limits, read from the plan table",
        "description": "The Compare-plans table of debyko.com as data, in its order: the price a month, the venues, instruments, history and book depth a plan reads, its rate limits, and its Agent limits (`agent: null` is a plan without Agent). A null limit is no limit: every venue, every instrument, no cap on how far back the plan reads. A plan edited in the table shows here within a minute.",
        "responses": {
          "200": {
            "description": "The self-serve plans in the order of the Compare-plans table, each with its price and every limit the plan table holds for it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlansResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/status": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Keyed collection status and freshness by venue and layer",
        "description": "Uses the shared platform validity rules. `include_synthetic=true` includes synthetic venues. `not_current` is bounded; use `not_current_total` to see the total. Real venues include `all_collected_stale`, a unique-listing predicate for the two-hour all-stale alert; halted configured listings count as stale there, while missing, off, and not-published measurements cannot satisfy it. `membership_revision` changes when the venue's configured identities or relevant dataset policies change. `source_retired=true` identifies a formally retired source; its configured count remains for historical context, but it is excluded from active outage paging.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "description": "`perpetual` (default), `spot`, or `all`. On `/v2/venues`, this filters venues by the market kind of their listings; the response item's `kind` still describes the venue category.",
            "schema": {
              "$ref": "#/components/schemas/MarketKindSelector"
            }
          },
          {
            "name": "include_synthetic",
            "in": "query",
            "description": "Include synthetic test venues. Defaults to false.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Keyed collection status and freshness by venue and layer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/budgets": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "Cached venue collection budgets, without prices or account data",
        "description": "Operational metadata only. `include_synthetic=true` includes synthetic test venues; otherwise they are omitted. No key is needed.",
        "parameters": [
          {
            "name": "include_synthetic",
            "in": "query",
            "description": "Include synthetic test venues. Defaults to false.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cached operational collection budgets. This response contains no prices or private account data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetsResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/stream": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "A live stream of the selected listings, as server-sent events",
        "description": "One `snapshot` event per selected listing and layer, then an `update` for every change, including a change of status: a listing going stale sends its status, its reason and no value, never a zero. A `heartbeat` every fifteen seconds means silence is a broken connection, not a quiet market. A reconnect is answered with a fresh snapshot, never a replay.",
        "responses": {
          "200": {
            "description": "A server-sent event stream. One `snapshot` event per selected listing and layer, then an `update` for every change, and a `heartbeat` every fifteen seconds so silence means a broken connection rather than a quiet market. Every event carries an `id`; reconnecting with `Last-Event-ID` is answered with a fresh snapshot, never a replay.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/StreamEvent"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/trades/stream": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Raw trade-only server-sent events for the selected listings",
        "description": "The first event is `metadata`, followed by raw `trade` events only for eligible listings. Trade subscribers are bounded and may drop messages; use envelope sequence numbers to detect skips. Reconnection starts a fresh feed without replay.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "description": "`perpetual` (default), `spot`, or `all`. On `/v2/venues`, this filters venues by the market kind of their listings; the response item's `kind` still describes the venue category.",
            "schema": {
              "$ref": "#/components/schemas/MarketKindSelector"
            }
          },
          {
            "name": "where",
            "in": "query",
            "description": "A DQL selection expression encoded as a query value, for example `venue = KRAKEN-FUTURES and instrument = BTC-PERP`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_synthetic",
            "in": "query",
            "description": "Include synthetic test venues and listings. Defaults to false.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A server-sent event stream. It begins with a `metadata` event describing the selected listings, then sends raw `trade` envelopes for eligible live listings. The subscriber is bounded and may drop older messages; use envelope generation and sequence to detect skips. `retry: 3000` is sent at connection start and `: keepalive` every twenty seconds. Reconnection starts a fresh feed; `Last-Event-ID` does not replay.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/TradeStreamEvent"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/events/stream": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Raw synthetic `MarketEnvelope` events for SelfCheck",
        "description": "Requires a regular key and the stream quota. Emits canonical envelopes for synthetic-only segments, including state, trade, candle, liquidation, gap and health messages. It does not replay on reconnect; consumers detect skipped events by generation and sequence.",
        "parameters": [
          {
            "name": "segment",
            "in": "query",
            "description": "Optional synthetic venue segment. A non-synthetic segment returns 404.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A synthetic-only server-sent event stream. Each `envelope` data line is the raw canonical `MarketEnvelope` JSON. `retry: 3000` is sent at connection start and `: keepalive` every twenty seconds. Reconnection starts a fresh feed; `Last-Event-ID` does not replay.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/MarketEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/agent/state": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "The state of the account's Agent rules: true, false or unknown, and what the key was told last time",
        "description": "What the Agent knows about each rule of the account: `state` (`true`, `false` or `unknown`, with a `reason`), `previous_state` — what this key was told the last time it asked, one row per key and rule — when the state was established, and the interval the rule is effectively checked at (the largest of the plan's interval, the rule's own cadence and the cadence of its instruments: a rule is never checked faster than its instruments are collected). A plan with push is answered with the rule's last scheduled evaluation and its `evaluated_at`, at no charge; `fresh=true` evaluates it now and is charged against the plan's evaluations a day. A plan without push, a rule not yet scheduled, or an account past its budget is answered by evaluating at request time through the DQL library. With x402 on and no key, name the rules (`rule_id`, one to 100): the price is per rule, and the rules are evaluated at request time.",
        "parameters": [
          {
            "name": "rule_id",
            "in": "query",
            "description": "A rule's id (UUID); repeat it or comma-separate. With a key: only these rules, all of them the account's (default: every rule of the account). Without a key, paid with x402: required, 1 to 100, and the price is per rule named.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fresh",
            "in": "query",
            "description": "`true` evaluates each rule now instead of answering with its last scheduled evaluation, and is charged against the plan's evaluations a day.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One item per rule: its state, the state this key was last given, when it was established and how often the rule is effectively checked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentStateResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/agent/result": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "The persisted live candle decision for one rule and instrument",
        "description": "Requires the rule owner's user key. `rule_id`, `instrument` and `bar_end` (UTC) select a retained result: true, false or unknown with reason, version, data_as_of, actual execution times, attempt, final and receipt_id. No new evaluation is performed. Seven days retained; no retained observation is unknown/not_measured, never false. Counted as a reference request.",
        "parameters": [
          {
            "name": "rule_id",
            "in": "query",
            "description": "The exact retained live-series result selector.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instrument",
            "in": "query",
            "description": "The exact retained live-series result selector.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bar_end",
            "in": "query",
            "description": "The exact retained live-series result selector.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A retained live-series instrument decision, or unknown/not_measured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentResultResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/account": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "What this key sees, and what is left of it today",
        "description": "The plan, the venues in it, the layers, the limits, and today's counters against them: requests (by class), DQL, streams, Agent evaluations, archive files. Read-only and free: it is not counted against the day's requests (it takes a token of the per-second limit). Read it before a long job to know what it can spend.",
        "responses": {
          "200": {
            "description": "The plan, the venues and layers it includes, its limits, and what the key has used today.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/archive": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "The files of the archive for a listing: day, rows, size, sha256, gaps",
        "description": "The observed trades and sampled layers as one Parquet file per listing, layer and UTC day: `trade`, `ticker`, `mark`, `depth-derived` for core and top-100; also `open-interest` and `stats` for core. This lists the verified files, and the days on which nothing was observed, with the gaps that say why. Free with any key, counted against nothing.",
        "parameters": [
          {
            "name": "listing",
            "in": "query",
            "description": "The listing as `VENUE:SYMBOL`: the venue's public code, a colon, the venue's symbol (`BINANCE-USDM:BTCUSDT`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "layer",
            "in": "query",
            "description": "`trade`, `ticker`, `mark`, `depth-derived`, or for core also `open-interest` and `stats`; default every layer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "The first UTC day, `2026-09-01`; default thirty days before `to`. At most 366 days from `to`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "The last UTC day; default today.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One item per layer and day: the file that holds it (rows, size, sha256, gaps, where to fetch it), or the reason there is none.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveListResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/archive/{listing}/{layer}/{day}": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "One file of the archive: a 302 to a link valid for fifteen minutes",
        "description": "A key spends one of its plan's files for the month; past them the answer is a `402` with the price of the file. Without a key, with x402 on, a file is paid for per file: 0.10 USDC (core), 0.05 USDC (top-100). `X-Debyko-Sha256` carries the file's hash. The contents of a file are never paged through the API.",
        "parameters": [
          {
            "name": "listing",
            "in": "path",
            "description": "`VENUE:SYMBOL` as one path segment: the colon as `%3A`, a slash in the symbol as `%2F`. The `download` of the list is exactly this path.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "layer",
            "in": "path",
            "description": "`trade`, `ticker`, `mark`, `depth-derived`, or for core also `open-interest` and `stats`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "day",
            "in": "path",
            "description": "The UTC day, `2026-09-30`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "302": {
            "description": "To the file, a link that works for fifteen minutes. `X-Debyko-Sha256` is the file's hash; `Link` (`rel=describedby`) points at the day's entry in the list; `X-Debyko-Archive-Remaining` says how many files the plan has left this month."
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "402": {
            "description": "The plan's files for the month are spent (or it has none): `price_usd` is what this file costs, `x402` says whether it can be paid for per file now. Without a key and with x402 on, this is the payment request (`accepts`)."
          },
          "404": {
            "description": "No file for this listing, layer and day: not archived (yet), or a day on which nothing was observed (the list says why)."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/anchors": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "Every day whose root is computed: its root, how far it got on the chain, and the rows it commits to",
        "description": "One item per UTC day, newest first: `revision` (0, the day as anchored; a correction would be a revision of its own, ADR-036), `chain_key` (the argument of `roots(uint32)` in the contract), `status`, `root`, the transaction and block that posted it, and the rows of each table. A day with no history to anchor is not listed. Public: it is the chain's own data; debyko.com/anchors is drawn from it.",
        "responses": {
          "200": {
            "description": "Every day whose root is computed, newest first, each with its revision, chain key, status, root, transaction and rows per table.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnchorListResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/anchors/proof": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "A row of the day's history and the Merkle path from it to the day's root",
        "description": "Public (owner 2026-10-08): no key, 30 a minute and 2,000 a UTC day from one address; sent with a key it is one history request of the key's plan instead. `venue`, `symbol`, `layer` and `at` (the row's own time, to the microsecond; `tie` picks among several rows at the same instant: the trade's `venue_uid`, the candle's `price_type`, the liquidation's `generation`). The answer carries the canonical text of the row, its hash and both audit paths: with the day's root from `GET /v2/anchors/{day}` (or from the chain) it is verified in thirty lines (docs/attest/verify). A row whose part of the day no longer matches what was anchored answers `ANCHOR_CHANGED`.",
        "parameters": [
          {
            "name": "venue",
            "in": "query",
            "description": "The venue's public code, as `GET /v2/venues` lists it.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "The venue's own symbol, as `GET /v2/instruments` gives it (`venue_symbol`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "layer",
            "in": "query",
            "description": "The anchored layer of the row: `ticker`, `mark`, `funding`, `oi`, `stats`, `book`, `trade`, `liquidation` or `candles`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "The row's own time, an RFC 3339 instant to the microsecond, such as `2026-09-24T12:00:00.123456Z`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tie",
            "in": "query",
            "description": "Which row to take when several share the instant: the trade's `venue_uid`, the candle's `price_type`, the liquidation's `generation`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The row as it is hashed, its leaf hash and the two audit paths to the day's root.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnchorProofResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "A key was sent and is not current (without a key the request is answered)."
          },
          "429": {
            "description": "Without a key: 30 a minute or 2,000 a UTC day from one address; with a key: the plan's rate. `Retry-After` says when to come back."
          }
        },
        "security": [
          {},
          {}
        ]
      }
    },
    "/v2/anchors/{day}": {
      "get": {
        "tags": [
          "Coverage"
        ],
        "summary": "What is anchored for a day: the root over its history, and where it is on the chain",
        "description": "A day's root is the Merkle root of every row of every anchored table (ticker, mark, funding, open interest, stats, depth-derived, trades, liquidations, candles) of that UTC day, posted to the `DebykoAnchor` contract on Base within 24 hours of the day's end (a row that arrives later becomes a revision of the day, ADR-036). **The anchor proves the data did not change after the anchor time; it proves nothing about its correctness at collection.** Public: it is the chain's own data.",
        "parameters": [
          {
            "name": "day",
            "in": "path",
            "description": "The UTC day, `2026-09-30`.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The root of the day, its partitions and, when it is there, the transaction that posted it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnchorDayResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/agent/screen-at": {
      "post": {
        "tags": [
          "V2ScreenAt"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v2/agent/compile": {
      "post": {
        "tags": [
          "V2AgentCompile"
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "The request or the query was refused. `code` is stable and is what to branch on; `message` explains and may be reworded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "No key, or a key that is not current."
          },
          "429": {
            "description": "The plan's rate has been used up. `Retry-After` says when to come back."
          }
        },
        "security": [
          {}
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountResponse": {
        "required": [
          "evaluated_at",
          "plan",
          "venues",
          "instruments",
          "layers",
          "limits",
          "today",
          "plans"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "plan": {
            "required": [
              "code",
              "name",
              "history",
              "history_days",
              "history_from"
            ],
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "The plan's code (`free`, `mini`, `standard`, `pro`, `pro-plus`)."
              },
              "name": {
                "type": "string",
                "description": "The plan's name."
              },
              "history": {
                "$ref": "#/components/schemas/PlanHistory"
              },
              "history_days": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Days of history the plan reads; null is no plan limit."
              },
              "history_from": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Instant"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The oldest instant the plan reads now; null is no plan limit."
              },
              "trial_until": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Instant"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "End of the open Standard trial (UTC); null if none."
              }
            },
            "additionalProperties": false,
            "description": "The key's plan."
          },
          "venues": {
            "required": [
              "included",
              "included_count",
              "platform_total"
            ],
            "type": "object",
            "properties": {
              "included": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The public codes of the venues the key reads."
              },
              "included_count": {
                "type": "integer",
                "description": "How many venues the key reads."
              },
              "platform_total": {
                "type": "integer",
                "description": "How many venues the platform has in all."
              }
            },
            "additionalProperties": false,
            "description": "Every venue available to this key, by public code. Every plan can read every venue on the platform."
          },
          "instruments": {
            "required": [
              "selection",
              "included"
            ],
            "type": "object",
            "properties": {
              "selection": {
                "type": "string",
                "description": "Legacy selection mode retained for compatibility; it does not restrict the venues or instruments a plan can query."
              },
              "included": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Instruments the plan includes; null is every instrument."
              }
            },
            "additionalProperties": false,
            "description": "How the plan picks its instruments."
          },
          "layers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnapshotLayer"
            },
            "description": "The snapshot layers a request may name. No plan gates a layer; `instruments` says per listing which a venue publishes."
          },
          "limits": {
            "required": [
              "requests_per_second",
              "requests_per_day",
              "dql_per_minute",
              "stream_connections",
              "api_keys",
              "book_levels",
              "agent_rules",
              "archive_files_per_month",
              "custom"
            ],
            "type": "object",
            "properties": {
              "requests_per_second": {
                "type": "integer",
                "description": "Requests a second the account may make, sustained: the bucket refills at this rate."
              },
              "requests_burst": {
                "type": "integer",
                "description": "Requests the account may send at once after a quiet moment: the capacity of the per-second bucket: 4 times `requests_per_second`, at least 10."
              },
              "requests_per_day": {
                "type": "integer",
                "description": "Requests a UTC day the account may make."
              },
              "dql_per_minute": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "DQL calls a minute (`/v2/screen`, `/v2/dql/parse`); null: no limit."
              },
              "stream_connections": {
                "type": "integer",
                "description": "Streams open at once."
              },
              "api_keys": {
                "type": "integer",
                "description": "Keys the account may hold."
              },
              "book_levels": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Levels a side `POST /v2/books` serves; null is the most it serves."
              },
              "agent_rules": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Active Agent rules; null: the plan has no Agent."
              },
              "archive_files_per_month": {
                "type": "integer",
                "description": "Archive files included in a calendar month (UTC); 0 is none."
              },
              "custom": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Limits set for this account instead of the plan's, by name (`requests_per_second`, `requests_per_day`, `dql_per_minute`, `stream_connections`, `agent_watches`, `agent_evals_per_min`, `agent_evals_per_day`, ...); empty when every limit is the plan's. The values here are already the effective ones; 2147483647 is unlimited."
              }
            },
            "additionalProperties": false,
            "description": "What the account is allowed: its plan's limits, or its own where `custom` names one."
          },
          "today": {
            "required": [
              "date",
              "resets_at",
              "requests",
              "dql",
              "streams",
              "agent_evaluations",
              "archive_files"
            ],
            "type": "object",
            "properties": {
              "date": {
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "type": "string",
                "description": "The UTC day the counters are for."
              },
              "resets_at": {
                "$ref": "#/components/schemas/Instant"
              },
              "requests": {
                "required": [
                  "used",
                  "limit",
                  "remaining",
                  "by_class"
                ],
                "type": "object",
                "properties": {
                  "used": {
                    "type": "integer",
                    "description": "Requests counted today."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Requests the account may make today."
                  },
                  "remaining": {
                    "type": "integer",
                    "description": "Requests left today."
                  },
                  "by_class": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "integer"
                    },
                    "description": "Today's counted requests by endpoint class (`reference`, `snapshots`, `history`, `books`, `dql`, `stream`)."
                  }
                },
                "additionalProperties": false,
                "description": "Requests counted against `requests_per_day`. This call is not one of them."
              },
              "dql": {
                "required": [
                  "per_minute",
                  "tokens_remaining"
                ],
                "type": "object",
                "properties": {
                  "per_minute": {
                    "type": [
                      "null",
                      "integer"
                    ],
                    "description": "The size of the bucket: DQL calls a minute; null when the plan has no DQL limit."
                  },
                  "tokens_remaining": {
                    "type": [
                      "null",
                      "integer"
                    ],
                    "description": "Calls left in the bucket now; null when the plan has no DQL limit."
                  }
                },
                "additionalProperties": false,
                "description": "DQL screening (`/v2/screen`, `/v2/dql/parse`), a bucket that refills every minute."
              },
              "streams": {
                "required": [
                  "open",
                  "limit"
                ],
                "type": "object",
                "properties": {
                  "open": {
                    "type": "integer",
                    "description": "Streams open now."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Streams the account may hold open at once."
                  }
                },
                "additionalProperties": false,
                "description": "Live streams."
              },
              "agent_evaluations": {
                "anyOf": [
                  {
                    "required": [
                      "used",
                      "per_day",
                      "remaining"
                    ],
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer",
                        "description": "Agent evaluations charged today (UTC)."
                      },
                      "per_day": {
                        "type": [
                          "null",
                          "integer"
                        ],
                        "description": "Agent evaluations the plan allows a UTC day; null: no limit."
                      },
                      "remaining": {
                        "type": [
                          "null",
                          "integer"
                        ],
                        "description": "Agent evaluations left today; null: no limit."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Agent evaluations today."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Null when the plan has no Agent."
              },
              "archive_files": {
                "required": [
                  "used_this_month",
                  "per_month",
                  "remaining"
                ],
                "type": "object",
                "properties": {
                  "used_this_month": {
                    "type": "integer",
                    "description": "Archive files sent this calendar month (UTC)."
                  },
                  "per_month": {
                    "type": "integer",
                    "description": "Archive files included in a calendar month (UTC)."
                  },
                  "remaining": {
                    "type": "integer",
                    "description": "Archive files left this month."
                  }
                },
                "additionalProperties": false,
                "description": "Archive files sent this calendar month (UTC)."
              }
            },
            "additionalProperties": false,
            "description": "Today's counters (UTC) against those limits."
          },
          "plans": {
            "type": "string",
            "description": "Where the plans and their prices are."
          }
        },
        "additionalProperties": false,
        "description": "What the key sees and what is left of it today. Read-only, free (not counted against the day's requests), and a key's own: there is no account without one."
      },
      "AgentChannelConnectResponse": {
        "type": "object",
        "oneOf": [
          {
            "required": [
              "kind",
              "status",
              "chats",
              "next"
            ],
            "type": "object",
            "properties": {
              "kind": {
                "const": "telegram",
                "type": "string",
                "description": "`telegram` or `webhook`."
              },
              "status": {
                "const": "linked",
                "type": "string",
                "description": "`linked` or `pending` for Telegram, `added` for a webhook."
              },
              "chats": {
                "type": "array",
                "items": {
                  "required": [
                    "id",
                    "name"
                  ],
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The chat's id.",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "description": "The chat's name."
                    }
                  }
                },
                "description": "The chats linked."
              },
              "next": {
                "type": "string",
                "description": "What to do next, worded to be relayed to the person as it stands."
              }
            }
          },
          {
            "required": [
              "kind",
              "status",
              "link",
              "expires_at",
              "next"
            ],
            "type": "object",
            "properties": {
              "kind": {
                "const": "telegram",
                "type": "string",
                "description": "`telegram` or `webhook`."
              },
              "status": {
                "const": "pending",
                "type": "string",
                "description": "`linked` or `pending` for Telegram, `added` for a webhook."
              },
              "link": {
                "type": "string",
                "description": "The link to open in Telegram to link the chat.",
                "format": "uri"
              },
              "expires_at": {
                "type": "string",
                "description": "When the link stops working.",
                "format": "date-time"
              },
              "next": {
                "type": "string",
                "description": "What to do next, worded to be relayed to the person as it stands."
              }
            }
          },
          {
            "required": [
              "kind",
              "id",
              "name",
              "url",
              "status",
              "test",
              "next"
            ],
            "type": "object",
            "properties": {
              "kind": {
                "const": "webhook",
                "type": "string",
                "description": "`telegram` or `webhook`."
              },
              "id": {
                "type": "string",
                "description": "The webhook's id.",
                "format": "uuid"
              },
              "name": {
                "type": "string",
                "description": "The webhook's name."
              },
              "url": {
                "type": "string",
                "description": "The URL notifications are posted to."
              },
              "status": {
                "const": "added",
                "type": "string",
                "description": "`linked` or `pending` for Telegram, `added` for a webhook."
              },
              "test": {
                "required": [
                  "sent",
                  "event_id"
                ],
                "type": "object",
                "properties": {
                  "sent": {
                    "type": "boolean",
                    "description": "Whether a test event was sent."
                  },
                  "event_id": {
                    "type": [
                      "null",
                      "string"
                    ],
                    "description": "The test event's id; null when none was sent."
                  }
                },
                "description": "The test event sent to the webhook."
              },
              "next": {
                "type": "string",
                "description": "What to do next, worded to be relayed to the person as it stands."
              }
            }
          }
        ],
        "description": "The result of connecting a channel: Telegram linked, a Telegram link to open, or a webhook added."
      },
      "AgentChannelsResponse": {
        "required": [
          "agent",
          "telegram",
          "webhooks",
          "limits",
          "notifications",
          "next"
        ],
        "type": "object",
        "properties": {
          "agent": {
            "enum": [
              "on",
              "stopped"
            ],
            "type": "string",
            "description": "`on` or `stopped`: whether Agent checks rules and sends notifications."
          },
          "telegram": {
            "required": [
              "status",
              "available",
              "bot",
              "chats",
              "link_expires_at",
              "limit",
              "linked"
            ],
            "type": "object",
            "properties": {
              "status": {
                "enum": [
                  "linked",
                  "pending",
                  "disabled",
                  "not_in_plan",
                  "not_linked"
                ],
                "type": "string",
                "description": "`linked`, `pending` (a link was issued and is not opened yet), `disabled`, `not_in_plan` or `not_linked`."
              },
              "available": {
                "type": "boolean",
                "description": "Whether a chat can be linked now."
              },
              "bot": {
                "type": "string",
                "description": "The bot a chat is linked through."
              },
              "chats": {
                "type": "array",
                "items": {
                  "required": [
                    "id",
                    "name",
                    "status",
                    "reason"
                  ],
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The chat's id.",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "description": "The chat's name."
                    },
                    "status": {
                      "enum": [
                        "linked",
                        "disabled"
                      ],
                      "type": "string",
                      "description": "`linked` or `disabled`."
                    },
                    "reason": {
                      "type": [
                        "null",
                        "string"
                      ],
                      "description": "Why the chat is disabled; null when it is linked."
                    }
                  }
                },
                "description": "The chats linked."
              },
              "link_expires_at": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "When the pending link stops working; null when none is pending.",
                "format": "date-time"
              },
              "limit": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Chats the plan allows; null: no limit."
              },
              "linked": {
                "type": "integer",
                "description": "Chats linked now."
              }
            },
            "description": "The Telegram channel."
          },
          "webhooks": {
            "type": "array",
            "items": {
              "required": [
                "id",
                "name",
                "url",
                "status",
                "last_delivery"
              ],
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The webhook's id.",
                  "format": "uuid"
                },
                "name": {
                  "type": "string",
                  "description": "The webhook's name."
                },
                "url": {
                  "type": "string",
                  "description": "The URL notifications are posted to."
                },
                "status": {
                  "enum": [
                    "not_set_up",
                    "failing",
                    "working"
                  ],
                  "type": "string",
                  "description": "`working`, `failing` or `not_set_up`."
                },
                "last_delivery": {
                  "oneOf": [
                    {
                      "required": [
                        "at",
                        "status",
                        "http"
                      ],
                      "type": "object",
                      "properties": {
                        "at": {
                          "type": "string",
                          "description": "When it was attempted.",
                          "format": "date-time"
                        },
                        "status": {
                          "type": [
                            "null",
                            "string"
                          ],
                          "description": "How it ended."
                        },
                        "http": {
                          "type": [
                            "null",
                            "integer"
                          ],
                          "description": "The HTTP status the webhook answered with; null if it did not answer."
                        }
                      }
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "The last delivery attempt; null if there has been none."
                }
              }
            },
            "description": "The webhooks added."
          },
          "limits": {
            "required": [
              "webhooks",
              "telegram_chats",
              "min_interval_s",
              "notifications_per_day",
              "custom"
            ],
            "type": "object",
            "properties": {
              "webhooks": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Webhooks the plan allows; null: no limit."
              },
              "telegram_chats": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Telegram chats the plan allows; null: no limit."
              },
              "min_interval_s": {
                "type": "integer",
                "description": "The shortest interval, in seconds, at which a rule may be checked."
              },
              "notifications_per_day": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Notifications the plan allows a UTC day; null: no limit."
              },
              "custom": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "The names of limits set for this account instead of the plan's."
              }
            },
            "description": "What the plan allows."
          },
          "notifications": {
            "description": "Today's notifications against the allowance.",
            "$ref": "#/components/schemas/AgentNotificationsView"
          },
          "next": {
            "type": "string",
            "description": "What to do next, worded to be relayed to the person as it stands."
          }
        },
        "description": "The account's notification channels and what the plan allows."
      },
      "AgentNotificationsView": {
        "required": [
          "used_today",
          "limit_per_day",
          "resets_at"
        ],
        "type": "object",
        "properties": {
          "used_today": {
            "type": "integer",
            "description": "Notifications sent today."
          },
          "limit_per_day": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Notifications the plan allows a UTC day; null: no limit."
          },
          "resets_at": {
            "type": "string",
            "description": "When the count starts again: 00:00 UTC.",
            "format": "date-time"
          },
          "per_firing": {
            "type": "integer",
            "description": "How many notifications one firing of the rule costs: one per channel."
          },
          "text": {
            "type": "string",
            "description": "The same in a sentence, to relay as it stands."
          },
          "code": {
            "type": "string",
            "description": "`PLAN_NOTIFICATION_LIMIT`, present once the day's notifications are used."
          },
          "message": {
            "type": "string",
            "description": "What happened, in a sentence; present with `code`."
          },
          "next": {
            "type": "string",
            "description": "What to do about it; present with `code`."
          },
          "retry_after": {
            "type": "integer",
            "description": "Seconds until the count starts again; present with `code`."
          }
        },
        "description": "Today's notifications against the plan's daily allowance (UTC day)."
      },
      "AgentResultInstant": {
        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,7})?Z$",
        "type": "string",
        "description": "An agent evaluation instant in UTC. The handler preserves database timestamp precision, including six fractional digits."
      },
      "AgentResultResponse": {
        "required": [
          "rule_id",
          "instrument",
          "bar_end",
          "verdict",
          "reason",
          "final"
        ],
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "description": "The rule the decision belongs to.",
            "format": "uuid"
          },
          "instrument": {
            "type": "string",
            "description": "The instrument the decision is for."
          },
          "bar_end": {
            "$ref": "#/components/schemas/AgentResultInstant"
          },
          "verdict": {
            "enum": [
              "true",
              "false",
              "unknown"
            ],
            "type": "string",
            "description": "`true`, `false` or `unknown`. `unknown` is its own answer: the data needed to decide was missing or not current, and it is never written as `false`."
          },
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Why the verdict is `unknown`; null otherwise."
          },
          "final": {
            "type": "boolean",
            "description": "Whether the decision is final for its bar."
          },
          "version": {
            "type": "string",
            "description": "The version of the rule the decision was made under."
          },
          "nominal_t": {
            "$ref": "#/components/schemas/AgentResultInstant"
          },
          "data_as_of": {
            "$ref": "#/components/schemas/AgentResultInstant"
          },
          "started_at": {
            "$ref": "#/components/schemas/AgentResultInstant"
          },
          "finished_at": {
            "$ref": "#/components/schemas/AgentResultInstant"
          },
          "attempt": {
            "maximum": 3,
            "minimum": 0,
            "type": "integer",
            "description": "Which attempt at the bar produced this decision."
          },
          "receipt_id": {
            "type": [
              "null",
              "string"
            ],
            "description": "The receipt of the evaluation; null when none was recorded."
          }
        },
        "additionalProperties": false,
        "description": "The persisted decision of a live candle rule for one instrument and one bar: `true`, `false` or `unknown` with the reason, when it was calculated and from what data. Reading it evaluates nothing."
      },
      "AgentRuleChannel": {
        "required": [
          "id",
          "kind",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The channel's id.",
            "format": "uuid"
          },
          "kind": {
            "type": "string",
            "description": "The kind of channel: `telegram` or `webhook`."
          },
          "name": {
            "type": "string",
            "description": "The channel's name."
          }
        },
        "description": "A channel a rule notifies."
      },
      "AgentRuleCreateResponse": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/AgentRuleView"
          },
          {
            "required": [
              "notifications",
              "dql",
              "dry_run",
              "manage_url",
              "turn_off",
              "next"
            ],
            "type": "object",
            "properties": {
              "notifications": {
                "description": "What the rule costs per firing and what is left of today's allowance.",
                "$ref": "#/components/schemas/AgentNotificationsView"
              },
              "dql": {
                "type": "string",
                "description": "The rule's condition, as a DQL query."
              },
              "dry_run": {
                "oneOf": [
                  {
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "A dry run made when the rule was created; null when it could not be made, in which case the rule is saved and runs on schedule."
              },
              "manage_url": {
                "type": "string",
                "description": "Where the person can see and change the rule.",
                "format": "uri"
              },
              "history": {
                "description": "Would-have-fired figure over the last 30 days.",
                "$ref": "#/components/schemas/AgentRuleHistoryView"
              },
              "turn_off": {
                "type": "string",
                "description": "How to turn the rule off, in words."
              },
              "code": {
                "type": "string",
                "description": "Present with a notice about the rule, for example that a plan limit was reached."
              },
              "message": {
                "type": "string",
                "description": "The notice, in a sentence; present with `code`."
              },
              "next": {
                "type": "string",
                "description": "What to do next, worded to be relayed to the person as it stands."
              }
            }
          }
        ],
        "description": "The rule that was created, as `AgentRuleView` shows a rule, with its query and a dry run."
      },
      "AgentRuleDeleteResponse": {
        "required": [
          "rule_id",
          "status",
          "label",
          "next"
        ],
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "description": "The rule's id.",
            "format": "uuid"
          },
          "status": {
            "const": "deleted",
            "type": "string",
            "description": "Always `deleted`."
          },
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "The label the rule had; null if it had none."
          },
          "next": {
            "type": "string",
            "description": "What to do next, worded to be relayed to the person as it stands."
          }
        },
        "description": "The result of deleting a rule."
      },
      "AgentRuleGetResponse": {
        "required": [
          "rule_id",
          "label",
          "name",
          "enabled",
          "status",
          "paused_by",
          "paused_reason",
          "mode",
          "kind",
          "interval_s",
          "timeframe",
          "channels",
          "last_fired_at",
          "created_at",
          "dql"
        ],
        "type": "object",
        "properties": {
          "history": {
            "description": "Would-have-fired figure over the last 30 days.",
            "$ref": "#/components/schemas/AgentRuleHistoryView"
          },
          "rule_id": {
            "type": "string",
            "description": "The rule's id.",
            "format": "uuid"
          },
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "The label the rule was given; null when it has none."
          },
          "name": {
            "type": "string",
            "description": "The rule's name."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the rule is active. It is false for a rule paused by the user or by DEBYKO."
          },
          "status": {
            "type": "string",
            "description": "`running`, `agent_stopped` (the account's Agent is stopped), `paused` (by the user) or `paused_by_debyko`."
          },
          "paused_by": {
            "type": [
              "null",
              "string"
            ],
            "description": "Who paused the rule: `user`, `agent_off`, `stop_all` or `debyko`; null when it is not paused."
          },
          "paused_reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Why DEBYKO paused the rule, in words; null unless `paused_by` is `debyko`."
          },
          "mode": {
            "type": "string",
            "description": "`live` or `settled`. A live candle rule makes its first attempt 15 seconds after the bar closes; a settled one waits for stable history."
          },
          "kind": {
            "type": "string",
            "description": "The kind of rule: `snapshot` (checked on an interval) or `series` (checked on a timeframe)."
          },
          "interval_s": {
            "type": [
              "null",
              "integer"
            ],
            "description": "For a `snapshot` rule, how often it is checked, in seconds; null otherwise."
          },
          "timeframe": {
            "type": [
              "null",
              "string"
            ],
            "description": "For a `series` rule, the period it reads, such as `15m`; null otherwise."
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRuleChannel"
            },
            "description": "The channels the rule notifies."
          },
          "last_fired_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the rule last fired; null if it has not."
          },
          "created_at": {
            "type": "string",
            "description": "When the rule was created.",
            "format": "date-time"
          },
          "dql": {
            "type": "string",
            "description": "The rule's condition, as a DQL query."
          }
        },
        "description": "One Agent rule with its query."
      },
      "AgentRuleHistoryView": {
        "required": [
          "state"
        ],
        "type": "object",
        "properties": {
          "state": {
            "enum": [
              "ok",
              "pending",
              "not_available"
            ],
            "type": "string",
            "description": "`ok`; `pending` (still running, kept when done: ask again); `not_available` (nothing else is set)."
          },
          "reason": {
            "type": "string",
            "description": "With `not_available`: why."
          },
          "count": {
            "type": "integer",
            "description": "How many times it would have fired: rising edges from false to true, per instrument, on closed bars."
          },
          "last_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "The close of the bar at which it last would have fired, UTC; null when it would not have fired.",
            "format": "date-time"
          },
          "window": {
            "type": "string",
            "description": "The window in words, `30 days`; a rule on 1-minute bars covers hours."
          },
          "days": {
            "type": "number",
            "description": "The window evaluated, in days."
          },
          "data_days": {
            "type": "number",
            "description": "How many of those days had data to evaluate on."
          },
          "missing_bars": {
            "type": "integer",
            "description": "Bars after the data began with no clean answer (a hole, a stale value): no comparison, never true."
          },
          "sampling": {
            "type": "string",
            "description": "On closed bars of the rule's timeframe, or sampled every N."
          },
          "from": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "to": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "plan_from": {
            "type": [
              "null",
              "string"
            ],
            "description": "Set when the plan reads less than 30 days: the earliest instant it reads.",
            "format": "date-time"
          },
          "computed_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "text": {
            "type": "string",
            "description": "The figure as one line, to relay as it stands."
          },
          "note": {
            "type": "string",
            "description": "Always: a fact about past data, not a forecast."
          },
          "instruments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "instrument": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                },
                "last_at": {
                  "type": [
                    "null",
                    "string"
                  ],
                  "format": "date-time"
                },
                "data_from": {
                  "type": [
                    "null",
                    "string"
                  ],
                  "format": "date-time"
                },
                "bars": {
                  "type": "integer"
                },
                "missing_bars": {
                  "type": "integer"
                }
              }
            },
            "description": "The same, per instrument of the rule."
          }
        },
        "description": "What the rule would have done over the last 30 days of recorded history: a fact about the past, never a forecast."
      },
      "AgentRuleSetResponse": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/AgentRuleView"
          },
          {
            "required": [
              "manage_url",
              "next"
            ],
            "type": "object",
            "properties": {
              "manage_url": {
                "type": "string",
                "description": "Where the person can see and change the rule.",
                "format": "uri"
              },
              "code": {
                "type": "string",
                "description": "Present with a notice about the change."
              },
              "message": {
                "type": "string",
                "description": "The notice, in a sentence; present with `code`."
              },
              "next": {
                "type": "string",
                "description": "What to do next, worded to be relayed to the person as it stands."
              }
            }
          }
        ],
        "description": "The rule after the change, as `AgentRuleView` shows a rule."
      },
      "AgentRuleState": {
        "enum": [
          "true",
          "false",
          "unknown"
        ],
        "type": "string",
        "description": "The state of a rule: `true` when its condition holds for at least one instrument of its selection, `false` when it is a clean false for every one of them, `unknown` otherwise (`reason` says why). A rule is a condition over a selection of instruments, so its state is a question about the selection."
      },
      "AgentRuleView": {
        "required": [
          "rule_id",
          "label",
          "name",
          "enabled",
          "status",
          "paused_by",
          "paused_reason",
          "mode",
          "kind",
          "interval_s",
          "timeframe",
          "channels",
          "last_fired_at",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "description": "The rule's id.",
            "format": "uuid"
          },
          "label": {
            "type": [
              "null",
              "string"
            ],
            "description": "The label the rule was given; null when it has none."
          },
          "name": {
            "type": "string",
            "description": "The rule's name."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the rule is active. It is false for a rule paused by the user or by DEBYKO."
          },
          "status": {
            "type": "string",
            "description": "`running`, `agent_stopped` (the account's Agent is stopped), `paused` (by the user) or `paused_by_debyko`."
          },
          "paused_by": {
            "type": [
              "null",
              "string"
            ],
            "description": "Who paused the rule: `user`, `agent_off`, `stop_all` or `debyko`; null when it is not paused."
          },
          "paused_reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "Why DEBYKO paused the rule, in words; null unless `paused_by` is `debyko`."
          },
          "mode": {
            "type": "string",
            "description": "`live` or `settled`. A live candle rule makes its first attempt 15 seconds after the bar closes; a settled one waits for stable history."
          },
          "kind": {
            "type": "string",
            "description": "The kind of rule: `snapshot` (checked on an interval) or `series` (checked on a timeframe)."
          },
          "interval_s": {
            "type": [
              "null",
              "integer"
            ],
            "description": "For a `snapshot` rule, how often it is checked, in seconds; null otherwise."
          },
          "timeframe": {
            "type": [
              "null",
              "string"
            ],
            "description": "For a `series` rule, the period it reads, such as `15m`; null otherwise."
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRuleChannel"
            },
            "description": "The channels the rule notifies."
          },
          "last_fired_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When the rule last fired; null if it has not."
          },
          "created_at": {
            "type": "string",
            "description": "When the rule was created.",
            "format": "date-time"
          }
        },
        "description": "One Agent rule as the account holds it."
      },
      "AgentSetEnabledResponse": {
        "required": [
          "enabled",
          "agent",
          "next"
        ],
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether Agent is on."
          },
          "agent": {
            "enum": [
              "on",
              "stopped"
            ],
            "type": "string",
            "description": "`on` or `stopped`."
          },
          "resumed_rules": {
            "type": "integer",
            "description": "When Agent was turned on: how many rules that were stopped with it run again."
          },
          "next": {
            "type": "string",
            "description": "What to do next, worded to be relayed to the person as it stands."
          }
        },
        "description": "The result of turning Agent on or off for the account."
      },
      "AgentStateEvaluations": {
        "required": [
          "charged",
          "used_today",
          "per_day"
        ],
        "type": "object",
        "properties": {
          "charged": {
            "minimum": 0,
            "type": "integer",
            "description": "Evaluations this request was charged."
          },
          "used_today": {
            "minimum": 0,
            "type": "integer",
            "description": "Evaluations used today (UTC), this request included."
          },
          "per_day": {
            "oneOf": [
              {
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The plan's evaluations a day; `null` is unlimited."
          }
        },
        "additionalProperties": false,
        "description": "What this account has used of its evaluations a day. Evaluations the scheduler has made today count, and so do the ones asked for on request (`fresh=true`, and rules evaluated at request time within the budget)."
      },
      "AgentStateItem": {
        "required": [
          "rule_id",
          "state",
          "previous_state",
          "evaluated_at",
          "effective_interval"
        ],
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "string",
            "description": "The rule's id, as the Agent shows it.",
            "format": "uuid"
          },
          "state": {
            "$ref": "#/components/schemas/AgentRuleState"
          },
          "previous_state": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AgentRuleState"
              },
              {
                "type": "null"
              }
            ],
            "description": "The state this key was given the last time it asked about this rule; `null` the first time. One row per key and rule: another key's polls change nothing here, and a poll by a payer without a key is kept per payer address."
          },
          "evaluated_at": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the state was established: the moment of the rule's last scheduled evaluation (a plan with push, no charge), or of the evaluation made for this request (`fresh=true`, a plan without push, a rule not yet scheduled, or a paid call). `null` when the rule has never been evaluated."
          },
          "reason": {
            "type": "string",
            "description": "Why the state is `unknown`, and only then. `unknown_value`: the condition is null for an instrument (a value is missing). `dirty_value`: a false that cannot be trusted, or a true that stands on a venue that dropped out. `no_instruments`: nothing in the selection. `paused_by_user`, `paused`: the rule is not running. `blind`: the Agent could not evaluate it on its last runs. `not_evaluated_yet`: no evaluation has completed. `too_many_instruments`: the selection does not fit one page and no instrument on it holds. `rate_limited`: it was left unevaluated because the key's DQL screening allowance was used up. `plan_limit`, `canonical_mismatch`, `rule_unreadable` or a `dql_…` code: the rule could not be evaluated as stored."
          },
          "effective_interval": {
            "pattern": "^(tick|[0-9]+(ms|s|m|h|d))$",
            "type": "string",
            "description": "The interval the rule is effectively checked at, a DQL duration: the largest of the plan's interval, the rule's own cadence (or timeframe) and the cadence of the rule's instruments. A rule is never checked faster than its instruments are collected. `tick` is a plan that checks on every tick of the instruments, with no instrument slower than that. The cadence of the instruments is taken over every venue the plan sees; a `where venue in (…)` narrowing of the rule is not taken into account."
          },
          "label": {
            "oneOf": [
              {
                "maxLength": 200,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The rule's label, written by the user: the first line of every notification. With a key only (never on a call paid with x402), and only when Agent answered in time; absent otherwise, like the other fields of the rule below."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the rule runs: `false` when it is paused (by the user, by Stop all, by Agent being stopped, or by DEBYKO)."
          },
          "channels": {
            "type": "array",
            "items": {
              "required": [
                "id",
                "kind",
                "name"
              ],
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The channel's id.",
                  "format": "uuid"
                },
                "kind": {
                  "enum": [
                    "telegram",
                    "webhook"
                  ],
                  "type": "string",
                  "description": "The kind of channel: `telegram` or `webhook`."
                },
                "name": {
                  "type": "string",
                  "description": "The channel's name."
                }
              },
              "additionalProperties": false
            },
            "description": "Where the rule's notifications go."
          },
          "last_fired_at": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Instant"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the rule last fired; `null` when it never has."
          },
          "paused_reason": {
            "type": "string",
            "description": "Why DEBYKO paused the rule, in words, and only then. A venue-only pause from an older plan version is rechecked and resumes when the current API accepts the rule; other reasons include a code the API did not know, more than 500 instruments in the answer, or a refused Agent key."
          },
          "mode": {
            "enum": [
              "live",
              "settled"
            ],
            "type": "string",
            "description": "Effective execution mode, including legacy series compatibility."
          }
        },
        "additionalProperties": false,
        "description": "One rule of the account and its state."
      },
      "AgentStateResponse": {
        "required": [
          "evaluated_at",
          "served_at",
          "receipt_id",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "evaluations": {
            "description": "Absent on a call paid with x402 and no key: it paid for what it asked, and has no budget.",
            "$ref": "#/components/schemas/AgentStateEvaluations"
          },
          "agent": {
            "enum": [
              "on",
              "stopped"
            ],
            "type": "string",
            "description": "Whether Agent runs on the account: `stopped` when the user switched it off, and then no rule is checked. With a key only, and only when Agent answered in time."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentStateItem"
            },
            "description": "One per rule, oldest first."
          }
        },
        "additionalProperties": false,
        "description": "The state of the account's Agent rules (or of the rules named, without a key)."
      },
      "AggregateSource": {
        "required": [
          "venue",
          "value",
          "received_at",
          "age_ms"
        ],
        "type": "object",
        "properties": {
          "venue": {
            "type": "string",
            "description": "The public code of a venue whose reading the aggregate stands on."
          },
          "value": {
            "description": "That venue's value, as the venue published it.",
            "$ref": "#/components/schemas/Number"
          },
          "received_at": {
            "description": "Received time: when the platform received that venue's value.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "That value's age in milliseconds at the instant asked about; null when nothing was received."
          },
          "status": {
            "description": "Whether the value is current: `present`, `stale`, `missing`, `not_published` or `off`. Only a `present` value comes with a number. A stale value is withheld, and a missing, unpublished or switched-off one has none, so a value that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Status"
          }
        },
        "additionalProperties": false,
        "description": "One venue's reading that an aggregate stands on."
      },
      "AggregateValue": {
        "required": [
          "value",
          "from"
        ],
        "type": "object",
        "properties": {
          "value": {
            "$ref": "#/components/schemas/Number"
          },
          "unit": {
            "$ref": "#/components/schemas/Unit"
          },
          "from": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AggregateSource"
            },
            "description": "Every venue reading the aggregate stands on, so a reader can see what it hides."
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          }
        },
        "additionalProperties": false,
        "description": "One number standing for several venues — max, min, sum, count. It has no single venue, so instead of one provenance it carries every reading it was computed from."
      },
      "Anchor": {
        "enum": [
          "venue",
          "receipt"
        ],
        "type": "string",
        "description": "ADR-025: which clock the horizon counts from — the venue's own timestamp (`venue`, where the venue sends one and it dates the publication) or the platform's receipt (`receipt`)."
      },
      "AnchorDayResponse": {
        "required": [
          "evaluated_at",
          "day",
          "network",
          "anchored",
          "status",
          "schema_version",
          "root",
          "partitions"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "day": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "The UTC day, as `2026-09-30`."
          },
          "network": {
            "enum": [
              "base-sepolia",
              "base"
            ],
            "type": "string",
            "description": "The chain the root is posted to: `base`, or `base-sepolia` on a test deployment."
          },
          "anchored": {
            "type": "boolean",
            "description": "True when the root is on the chain."
          },
          "status": {
            "enum": [
              "computed",
              "submitted",
              "anchored",
              "conflict"
            ],
            "type": "string",
            "description": "How far the day got: `computed` (the trees are stored, nothing is on the chain), `submitted` (a transaction was sent and is not confirmed), `anchored`, `conflict` (the chain holds another root for the day)."
          },
          "reason": {
            "enum": [
              "not_yet_anchored",
              "submitted_not_confirmed",
              "conflict"
            ],
            "type": "string",
            "description": "Present when `anchored` is false."
          },
          "contract": {
            "type": [
              "null",
              "string"
            ],
            "description": "The `DebykoAnchor` contract the root was posted to."
          },
          "tx_hash": {
            "type": [
              "null",
              "string"
            ],
            "description": "The transaction that posted the root; null when the root was found on the chain already (a transaction of an earlier run)."
          },
          "block": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The block of the transaction; null before there is one."
          },
          "anchored_at": {
            "$ref": "#/components/schemas/NullableInstant"
          },
          "anchored_lag_days": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many days after its end the day was anchored: 1 since 2026-10-08 (owner; it was 7 before), so the first days show 8 and more."
          },
          "explorer_url": {
            "type": [
              "null",
              "string"
            ],
            "description": "The block explorer's page of the transaction (or of the contract, before there is one)."
          },
          "schema_version": {
            "type": "integer",
            "description": "The stored anchor schema version: 1 includes all listings; 2 excludes flagged synthetic dummy/test listings. Use this version when rebuilding partition leaves; previously anchored roots retain their version."
          },
          "root": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "The day's root: the RFC 6962 tree over the partition leaves, in table-name order."
          },
          "partitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnchorPartition"
            },
            "description": "The day's partitions: one per table (and layer), with the root and row count of each."
          },
          "verify": {
            "type": "string",
            "description": "Where to read how to check this root against the chain."
          }
        },
        "additionalProperties": false,
        "description": "What is anchored for a UTC day: the root over every row of every anchored table of that day, and where it is on the chain. The anchor proves the data did not change after the anchor time; it proves nothing about its correctness at collection."
      },
      "AnchorListItem": {
        "required": [
          "day",
          "revision",
          "chain_key",
          "status",
          "anchored",
          "schema_version",
          "root",
          "rows",
          "partitions"
        ],
        "type": "object",
        "properties": {
          "day": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "The UTC day, as `2026-09-30`."
          },
          "revision": {
            "maximum": 99,
            "minimum": 0,
            "type": "integer",
            "description": "The revision of the day this root is (ADR-036): 0 is the day as anchored; a correction is revision 1, 2, ... with its own root. Every day is at revision 0 so far."
          },
          "chain_key": {
            "type": "integer",
            "description": "The key the root is stored under in the contract, the argument of `roots(uint32)`: `yyyymmdd` for revision 0, `yyyymmdd × 100 + r` for revision r (ADR-036)."
          },
          "status": {
            "enum": [
              "computed",
              "submitted",
              "anchored",
              "conflict"
            ],
            "type": "string",
            "description": "How far the day got: `computed` (the trees are stored, nothing is on the chain), `submitted` (a transaction was sent and is not confirmed), `anchored`, `conflict` (the chain holds another root for the day)."
          },
          "anchored": {
            "type": "boolean",
            "description": "True when the root is on the chain."
          },
          "schema_version": {
            "type": "integer",
            "description": "The stored anchor schema version: 1 includes all listings; 2 excludes flagged synthetic dummy/test listings. Use this version when rebuilding partition leaves; previously anchored roots retain their version."
          },
          "root": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "The day's root: the RFC 6962 tree over the partition leaves, in table-name order."
          },
          "rows": {
            "type": "integer",
            "description": "Every row the root commits to: the sum of the partitions' rows."
          },
          "contract": {
            "type": [
              "null",
              "string"
            ],
            "description": "The `DebykoAnchor` contract the root was posted to."
          },
          "tx_hash": {
            "type": [
              "null",
              "string"
            ],
            "description": "The transaction that posted the root; null when the root was found on the chain already (a transaction of an earlier run)."
          },
          "block": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The block of the transaction; null before there is one."
          },
          "anchored_at": {
            "$ref": "#/components/schemas/NullableInstant"
          },
          "anchored_lag_days": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many days after its end the day was anchored."
          },
          "explorer_url": {
            "type": [
              "null",
              "string"
            ],
            "description": "The block explorer's page of the transaction (or of the contract, before there is one)."
          },
          "partitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnchorPartition"
            },
            "description": "The day's partitions: one per table (and layer), with the root and row count of each."
          }
        },
        "additionalProperties": false,
        "description": "One UTC day of the list: its root, how far it got on the chain, and how many rows of each table it commits to."
      },
      "AnchorListResponse": {
        "required": [
          "evaluated_at",
          "network",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "network": {
            "enum": [
              "base-sepolia",
              "base"
            ],
            "type": "string",
            "description": "The chain the roots are posted to: `base`, or `base-sepolia` on a test deployment."
          },
          "first_anchored": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": [
              "null",
              "string"
            ],
            "description": "The first day whose root is on the chain, or null while none is."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnchorListItem"
            },
            "description": "The days, newest first."
          },
          "verify": {
            "type": "string",
            "description": "Where to read how to check a root against the chain."
          }
        },
        "additionalProperties": false,
        "description": "Every UTC day whose root is computed, newest first, with where each is on the chain. A day with no history to anchor is not listed. The anchor proves the data did not change after the anchor time; it proves nothing about its correctness at collection."
      },
      "AnchorPartition": {
        "required": [
          "table",
          "layer",
          "rows",
          "root",
          "chunks"
        ],
        "type": "object",
        "properties": {
          "table": {
            "type": "string",
            "description": "The history table the partition holds rows of."
          },
          "layer": {
            "type": [
              "null",
              "string"
            ],
            "description": "The layer of those rows, where the table holds more than one."
          },
          "rows": {
            "type": "integer",
            "description": "How many rows of the table the day holds."
          },
          "root": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "The Merkle root of the partition's rows."
          },
          "chunks": {
            "type": "integer",
            "description": "How many chunks of 4 096 rows the partition is stored in."
          }
        },
        "additionalProperties": false,
        "description": "One partition of a day's tree: the rows of one history table on that UTC day, the root of their Merkle tree and how many chunks of 4 096 rows it is stored in."
      },
      "AnchorProofResponse": {
        "required": [
          "evaluated_at",
          "day",
          "network",
          "schema_version",
          "layer",
          "table",
          "row",
          "canonical",
          "leaf_hash",
          "index",
          "rows",
          "path",
          "partition",
          "day_root",
          "anchor"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "day": {
            "type": "string",
            "description": "The UTC day of the row, as `2026-09-30`."
          },
          "network": {
            "type": "string",
            "description": "The chain the day's root is posted to."
          },
          "schema_version": {
            "type": "integer",
            "description": "The stored anchor schema version: 1 includes all listings; 2 excludes flagged synthetic dummy/test listings. Use this version when rebuilding partition leaves; previously anchored roots retain their version."
          },
          "layer": {
            "type": "string",
            "description": "The layer of the row."
          },
          "table": {
            "type": "string",
            "description": "The history table the row is stored in."
          },
          "row": {
            "type": "object",
            "description": "The row as it is hashed: its listing (`segment`, `symbol`) and every anchored column, numbers as the strings the database stores them in."
          },
          "canonical": {
            "type": "string",
            "description": "The RFC 8785 text of `row`, exactly as hashed."
          },
          "leaf_hash": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "SHA-256(0x00 ‖ the UTF-8 of `canonical`), lower-case hex: the row's leaf."
          },
          "index": {
            "type": "integer",
            "description": "The position of the row's leaf among the `rows` leaves of its partition."
          },
          "rows": {
            "type": "integer",
            "description": "How many rows the row's partition holds."
          },
          "path": {
            "type": "array",
            "items": {
              "pattern": "^[0-9a-f]{64}$",
              "type": "string"
            },
            "description": "The audit path that takes `leaf_hash` to `partition.root`: sibling hashes, lower-case hex."
          },
          "partition": {
            "required": [
              "root",
              "leaf",
              "index",
              "count",
              "path"
            ],
            "type": "object",
            "properties": {
              "root": {
                "type": "string",
                "description": "The Merkle root of the partition's rows."
              },
              "leaf": {
                "type": "string",
                "description": "The partition's leaf in the day's tree."
              },
              "index": {
                "type": "integer",
                "description": "The position of that leaf among the `partition.count` leaves of the day."
              },
              "count": {
                "type": "integer",
                "description": "How many partition leaves the day's tree has."
              },
              "path": {
                "type": "array",
                "items": {
                  "pattern": "^[0-9a-f]{64}$",
                  "type": "string"
                },
                "description": "The audit path that takes `partition.leaf` to `day_root`: sibling hashes, lower-case hex."
              }
            },
            "additionalProperties": false,
            "description": "The partition the row is in and its place in the day's tree."
          },
          "day_root": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "The day's root, the one posted to the chain."
          },
          "anchor": {
            "required": [
              "anchored",
              "status"
            ],
            "type": "object",
            "properties": {
              "anchored": {
                "type": "boolean",
                "description": "True when the root is on the chain."
              },
              "status": {
                "enum": [
                  "computed",
                  "submitted",
                  "anchored",
                  "conflict"
                ],
                "type": "string",
                "description": "How far the day got: `computed` (the trees are stored, nothing is on the chain), `submitted` (a transaction was sent and is not confirmed), `anchored`, `conflict` (the chain holds another root for the day)."
              },
              "reason": {
                "enum": [
                  "not_yet_anchored",
                  "submitted_not_confirmed",
                  "conflict"
                ],
                "type": "string",
                "description": "Present when `anchored` is false."
              },
              "contract": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The `DebykoAnchor` contract the root was posted to."
              },
              "tx_hash": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The transaction that posted the root; null when the root was found on the chain already (a transaction of an earlier run)."
              },
              "block": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "The block of the transaction that posted the root; null when it is not on the chain."
              },
              "anchored_at": {
                "$ref": "#/components/schemas/NullableInstant"
              },
              "anchored_lag_days": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "How many days after its end the day was anchored: 1 since 2026-10-08 (owner; it was 7 before), so the first days show 8 and more."
              },
              "explorer_url": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The block explorer's page of the transaction (or of the contract, before there is one)."
              }
            },
            "additionalProperties": false,
            "description": "Where the day's root is on the chain, when it is."
          },
          "verify": {
            "type": "string",
            "description": "Where to read how to check the proof by hand."
          }
        },
        "additionalProperties": false,
        "description": "A row of the day's history with the two Merkle paths that take it to the day's root. `leaf_hash` is SHA-256(0x00 ‖ the UTF-8 of `canonical`); `path` takes it, as leaf `index` of `rows`, to `partition.root`; `partition.leaf` is the leaf of that partition in the day's tree, and `partition.path` takes it, as leaf `partition.index` of `partition.count`, to `day_root`. Both are RFC 6962 audit paths."
      },
      "ApiError": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "pattern": "^DQL_[A-Z_]+$",
            "type": "string",
            "description": "The stable name of the fault. Branch on this, never on the message."
          },
          "message": {
            "type": "string",
            "description": "What is wrong, in one sentence, naming what was expected. Wording may change between releases."
          },
          "position": {
            "$ref": "#/components/schemas/ErrorPosition"
          },
          "path": {
            "type": "string",
            "description": "Where the problem is in the machine form of the query, for a request that sent JSON rather than text."
          },
          "hint": {
            "type": "string",
            "description": "What to do about it, where there is something useful to say."
          },
          "next": {
            "type": "string",
            "description": "On PLAN_LIMIT: one sentence saying what to do now, with the earliest instant the plan reads for this request."
          },
          "earliest_from": {
            "type": "string",
            "description": "On PLAN_LIMIT of a candle request: the earliest `from` the plan accepts for the request's timeframe (an instant on the timeframe's grid).",
            "format": "date-time"
          },
          "retry_with": {
            "type": "object",
            "description": "On PLAN_LIMIT of a candle request: the same request body with `from` moved to `earliest_from`; send it as it is."
          }
        },
        "additionalProperties": false,
        "description": "One problem found in a request or a query."
      },
      "ArchiveGap": {
        "required": [
          "cause",
          "start",
          "end",
          "end_unknown",
          "scope",
          "datasets",
          "repaired_at"
        ],
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "Why the platform was not listening (`ws_disconnected`, `rate_limited`, `collector_down`, ...): the vocabulary of `gap_cause` everywhere else."
          },
          "start": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$",
            "type": "string",
            "description": "When the gap began, UTC, six fractional digits."
          },
          "end": {
            "type": [
              "null",
              "string"
            ],
            "description": "When it ended; `null` while it was open or when the end is unknown."
          },
          "end_unknown": {
            "type": "boolean",
            "description": "The gap is over and nobody recorded when."
          },
          "scope": {
            "enum": [
              "segment",
              "listing"
            ],
            "type": "string",
            "description": "`segment`: the whole venue connection was affected. `listing`: this listing alone."
          },
          "datasets": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "The datasets the gap is a hole in; `null` is every dataset of the segment."
          },
          "repaired_at": {
            "type": [
              "null",
              "string"
            ],
            "description": "When a replay filled the gap, if one did. Rows filled that way are in the file with their own `origin`."
          }
        },
        "additionalProperties": false,
        "description": "One gap of the day, as the platform recorded it, copied into the manifest when the file was written: the file's statement of coverage."
      },
      "ArchiveItem": {
        "required": [
          "layer",
          "day",
          "group",
          "available",
          "rows",
          "bytes",
          "sha256",
          "gaps",
          "anchored",
          "download",
          "coverage"
        ],
        "type": "object",
        "properties": {
          "layer": {
            "enum": [
              "trade",
              "ticker",
              "mark",
              "depth-derived"
            ],
            "type": "string",
            "description": "The layer of the file: `trade`, `ticker`, `mark` or `depth-derived` (for core listings also `open-interest` and `stats`)."
          },
          "day": {
            "type": "string",
            "description": "The UTC day, as `2026-09-30`.",
            "format": "date"
          },
          "group": {
            "enum": [
              "core",
              "top-100"
            ],
            "type": "string",
            "description": "The group the listing was in when the file was written. It is what the file costs when paid for with x402: core 0.10 USDC, top-100 0.05."
          },
          "available": {
            "type": "boolean",
            "description": "`false` for a day on which no rows were observed: there is no file, and `coverage` says why."
          },
          "rows": {
            "minimum": 0,
            "type": "integer",
            "description": "Rows in the file; 0 on a day with no file."
          },
          "bytes": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Size of the file; `null` when there is none."
          },
          "sha256": {
            "type": [
              "null",
              "string"
            ],
            "description": "SHA-256 of the file, lower-case hex. The `X-Debyko-Sha256` header of the download says the same, and what is downloaded hashes to it."
          },
          "gaps": {
            "minimum": 0,
            "type": "integer",
            "description": "How many gaps the day has: the length of `coverage`."
          },
          "anchored": {
            "type": "boolean",
            "description": "Whether the file's hash is under an on-chain root. `false` until anchoring exists."
          },
          "download": {
            "type": [
              "null",
              "string"
            ],
            "description": "The path that answers `302` to the file (a path of this API, to be requested with the key); `null` when there is no file."
          },
          "coverage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchiveGap"
            },
            "description": "The gaps of the segment and layer that overlap the day, with causes."
          }
        },
        "additionalProperties": false,
        "description": "One day of one layer of a listing: the file that holds it, or the reason there is none."
      },
      "ArchiveListResponse": {
        "required": [
          "evaluated_at",
          "served_at",
          "receipt_id",
          "listing",
          "from",
          "to",
          "truncated",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "listing": {
            "type": "string",
            "description": "The listing, as `VENUE:SYMBOL`, the venue by the code the platform publishes."
          },
          "from": {
            "type": "string",
            "description": "The first UTC day of the span.",
            "format": "date"
          },
          "to": {
            "type": "string",
            "description": "The last UTC day of the span.",
            "format": "date"
          },
          "truncated": {
            "type": "boolean",
            "description": "More days exist inside the span than the 400 returned; ask for a shorter span."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArchiveItem"
            },
            "description": "Oldest first, a day's layers in alphabetical order."
          }
        },
        "additionalProperties": false,
        "description": "The files of the archive for one listing between two days: the verified ones, and the days on which there was nothing to write."
      },
      "ArenaAccepted": {
        "required": [
          "accepted",
          "updated"
        ],
        "type": "object",
        "properties": {
          "accepted": {
            "minimum": 0,
            "type": "integer"
          },
          "updated": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "additionalProperties": false
      },
      "ArenaDecimal": {
        "oneOf": [
          {
            "type": "number"
          },
          {
            "pattern": "^[-+]?(?:[0-9]+(?:\\.[0-9]*)?|\\.[0-9]+)(?:[eE][-+]?[0-9]+)?$",
            "type": "string"
          }
        ]
      },
      "ArenaError": {
        "required": [
          "field",
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ArenaErrors": {
        "required": [
          "errors"
        ],
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArenaError"
            }
          }
        },
        "additionalProperties": false
      },
      "ArenaFill": {
        "required": [
          "time",
          "side",
          "price",
          "size"
        ],
        "type": "object",
        "properties": {
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "side": {
            "enum": [
              "buy",
              "sell"
            ],
            "type": "string"
          },
          "price": {
            "$ref": "#/components/schemas/ArenaDecimal"
          },
          "size": {
            "$ref": "#/components/schemas/ArenaDecimal"
          },
          "fill_id": {
            "maxLength": 128,
            "type": [
              "null",
              "string"
            ],
            "description": "Venue fill ID, retained with the reported fill; not independent evidence of execution."
          }
        }
      },
      "ArenaPosition": {
        "required": [
          "venue",
          "instrument",
          "side",
          "opened_at",
          "entry_price",
          "size"
        ],
        "type": "object",
        "properties": {
          "venue": {
            "maxLength": 80,
            "type": "string"
          },
          "instrument": {
            "maxLength": 100,
            "type": "string"
          },
          "side": {
            "enum": [
              "long",
              "short"
            ],
            "type": "string"
          },
          "account": {
            "enum": [
              "live",
              "demo"
            ],
            "type": "string",
            "description": "Whether this is a live (real-money) or a demo (paper, testnet, simulated) account. Optional here; if present it must equal the snapshot's account. Live and demo are never added together."
          },
          "opened_at": {
            "type": "string",
            "format": "date-time"
          },
          "entry_price": {
            "$ref": "#/components/schemas/ArenaDecimal"
          },
          "size": {
            "$ref": "#/components/schemas/ArenaDecimal"
          },
          "size_unit": {
            "oneOf": [
              {
                "enum": [
                  "base",
                  "contracts"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "leverage": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArenaDecimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "margin": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArenaDecimal"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ArenaPositionsRequest": {
        "required": [
          "account",
          "positions"
        ],
        "type": "object",
        "properties": {
          "account": {
            "enum": [
              "live",
              "demo"
            ],
            "type": "string",
            "description": "Whether this is a live (real-money) or a demo (paper, testnet, simulated) account. Required for the whole snapshot; live and demo are never added together."
          },
          "positions": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArenaPosition"
            }
          }
        }
      },
      "ArenaProfileRequest": {
        "required": [
          "handle"
        ],
        "type": "object",
        "properties": {
          "handle": {
            "pattern": "^[a-z0-9][a-z0-9-]{1,22}[a-z0-9]$",
            "type": "string"
          },
          "declared_capital": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArenaDecimal"
              },
              {
                "type": "null"
              }
            ],
            "description": "Omitted: leave the capital history unchanged. Positive amount: declare capital. Explicit null: append an effective-dated clear and use trade returns thereafter, preserving earlier rows."
          },
          "capital_ccy": {
            "oneOf": [
              {
                "maxLength": 12,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bio": {
            "oneOf": [
              {
                "maxLength": 160,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "effective_from": {
            "type": "string",
            "description": "UTC effective instant. Omit for server receipt time. 409 if a trade closed at or after this instant was already received; declare before importing.",
            "format": "date-time"
          }
        }
      },
      "ArenaProfileResponse": {
        "required": [
          "handle",
          "bio",
          "declared_capital",
          "capital_ccy"
        ],
        "type": "object",
        "properties": {
          "handle": {
            "type": [
              "null",
              "string"
            ]
          },
          "bio": {
            "type": "string"
          },
          "declared_capital": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArenaDecimal"
              },
              {
                "type": "null"
              }
            ],
            "description": "The declaration in force now, not a future scheduled value. Null if never declared or explicitly cleared."
          },
          "capital_ccy": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "additionalProperties": false
      },
      "ArenaTradeRequest": {
        "required": [
          "trade_id",
          "venue",
          "instrument",
          "side",
          "account",
          "opened_at",
          "closed_at",
          "entry_price",
          "exit_price",
          "size"
        ],
        "type": "object",
        "properties": {
          "trade_id": {
            "maxLength": 128,
            "type": "string"
          },
          "venue": {
            "maxLength": 80,
            "type": "string"
          },
          "instrument": {
            "maxLength": 100,
            "type": "string"
          },
          "side": {
            "enum": [
              "long",
              "short"
            ],
            "type": "string"
          },
          "account": {
            "enum": [
              "live",
              "demo"
            ],
            "type": "string",
            "description": "Whether this is a live (real-money) or a demo (paper, testnet, simulated) account. Required; live and demo are never added together."
          },
          "opened_at": {
            "type": "string",
            "format": "date-time"
          },
          "closed_at": {
            "type": "string",
            "format": "date-time"
          },
          "entry_price": {
            "$ref": "#/components/schemas/ArenaDecimal"
          },
          "exit_price": {
            "$ref": "#/components/schemas/ArenaDecimal"
          },
          "size": {
            "$ref": "#/components/schemas/ArenaDecimal"
          },
          "size_unit": {
            "oneOf": [
              {
                "enum": [
                  "base",
                  "contracts"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "leverage": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArenaDecimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "margin": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArenaDecimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "fees": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArenaDecimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "funding": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArenaDecimal"
              },
              {
                "type": "null"
              }
            ]
          },
          "exit_reason": {
            "oneOf": [
              {
                "enum": [
                  "tp",
                  "sl",
                  "signal",
                  "manual",
                  "liquidation"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "debyko_firing_id": {
            "oneOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rule": {
            "oneOf": [
              {
                "maxLength": 128,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "oneOf": [
              {
                "maxLength": 64,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "oneOf": [
              {
                "maxLength": 280,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fills": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArenaFill"
            }
          }
        }
      },
      "ArenaTradesRequest": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ArenaTradeRequest"
          },
          {
            "maxItems": 100,
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArenaTradeRequest"
            }
          }
        ]
      },
      "Band": {
        "required": [
          "bid_qty",
          "bid_value",
          "bid_levels",
          "ask_qty",
          "ask_value",
          "ask_levels"
        ],
        "type": "object",
        "properties": {
          "bid_qty": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "Quantity resting on the bid side within the band."
          },
          "bid_value": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "Its value in the quote currency."
          },
          "bid_levels": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many bid levels fell inside the band."
          },
          "ask_qty": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "Quantity resting on the ask side within the band."
          },
          "ask_value": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "Its value in the quote currency."
          },
          "ask_levels": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many ask levels fell inside the band."
          },
          "bid_reason": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullReason"
              }
            ],
            "description": "Present when the bid side is null."
          },
          "ask_reason": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullReason"
              }
            ],
            "description": "Present when the ask side is null."
          }
        },
        "additionalProperties": false,
        "description": "What rests within one band, per side. On the `book` layer a side the received book did not reach is null with `band_truncated` — never a partial sum presented as a whole one. On `venue_depth` there is no book to truncate: a side is null with `venue_capability`, meaning the venue publishes no figure for that band, and `*_qty` and `*_levels` are always null, because the venue published a notional rather than levels."
      },
      "BookItem": {
        "required": [
          "instrument",
          "venue",
          "venue_symbol",
          "quote",
          "status",
          "venue_ts",
          "received_at",
          "age_ms",
          "sequence",
          "bids",
          "asks",
          "levels_available",
          "mid",
          "spread"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when this listing maps to no instrument — and then `reason` says why."
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "venue_symbol": {
            "type": "string",
            "description": "The venue's own symbol."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "Mapping recorded after deployment or reconstructed from the pre-deployment cache."
          },
          "identity_corrected_at": {
            "description": "Start of the next mapping interval for this listing, when one exists.",
            "$ref": "#/components/schemas/Instant"
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot"
            ],
            "type": "string",
            "description": "The market kind of this listing. Added with change set 37; absent from earlier responses."
          },
          "status": {
            "description": "Whether the value is current: `present`, `stale`, `missing`, `not_published` or `off`. Only a `present` value comes with a number. A stale value is withheld, and a missing, unpublished or switched-off one has none, so a value that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Status"
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The age of the observation that carried the levels at the instant asked about, in milliseconds (C25-01: one definition of age): from `venue_ts` where its horizon counts from the venue's clock (`anchor: venue`), from `received_at` otherwise."
          },
          "venue_age_ms": {
            "description": "Age by venue time: milliseconds from `venue_ts` to the instant asked about, on the venue's clock whatever the anchor. Null when the venue sends no time. `age_ms` is the age the value is judged by.",
            "$ref": "#/components/schemas/VenueAgeMs"
          },
          "valid_until": {
            "description": "The instant after which the value is no longer current (UTC). At `valid_until` itself it is still current. Null while a push feed's connection is alive and when no cadence fact covers the value.",
            "$ref": "#/components/schemas/ValidUntil"
          },
          "horizon_source": {
            "description": "Where `valid_until` comes from: `venue_declared`, `measured`, `documented`, `assumed` or `connection`. Null when no cadence fact covers the value, which is then stale with reason `horizon_unknown`.",
            "$ref": "#/components/schemas/HorizonSource"
          },
          "anchor": {
            "description": "Which clock the age and the horizon count from: `venue` (the venue's own timestamp, where it sends one and it dates the publication) or `receipt` (`received_at`).",
            "$ref": "#/components/schemas/Anchor"
          },
          "sequence": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The venue's own number of the book update these levels are of, exactly as the venue sent it, or null. Null means this venue's book feed carries no number of its own (a published fact: the table in the endpoints page says which), or the answer has no levels. It is never a counter of ours: a client that sees consecutive numbers may treat a jump as a hole in the venue's feed, and one that sees null must not. Only the latest is served; nothing stores it."
          },
          "sequence_kind": {
            "$comment": "Optional until production serves it, like `served_at`.",
            "enum": [
              "venue_sequence",
              "engine_sequence",
              "block"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "What `sequence` counts, present exactly when `sequence` is. `venue_sequence`: the exchange's own update id of its book feed. `engine_sequence`: the counter of an off-chain matching engine (Synthetix `meseq`), which is not a block and says nothing about the chain. `block`: reserved for a chain's block height; no venue emits it yet."
          },
          "bids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookLevel"
            },
            "description": "Best first."
          },
          "asks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookLevel"
            },
            "description": "Best first."
          },
          "levels_available": {
            "required": [
              "bid",
              "ask"
            ],
            "type": "object",
            "properties": {
              "bid": {
                "type": "integer",
                "description": "Bid levels shown."
              },
              "ask": {
                "type": "integer",
                "description": "Ask levels shown."
              }
            },
            "additionalProperties": false,
            "description": "How many levels are actually shown, per side."
          },
          "mid": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The midpoint of the best levels shown, as DQL defines it."
          },
          "spread": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The spread as a fraction of the mid."
          },
          "units": {
            "required": [
              "price",
              "size",
              "spread"
            ],
            "type": "object",
            "properties": {
              "price": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The unit of every price."
              },
              "size": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The unit of every size."
              },
              "spread": {
                "const": "fraction",
                "type": "string",
                "description": "Always a fraction."
              }
            },
            "additionalProperties": false,
            "description": "What the numbers count. Absent when there is no book to describe."
          },
          "withheld": {
            "type": "object",
            "description": "ADR-025: a stale book's `bids`, `asks`, `mid` and `spread`, only when the request set `allow_stale` — the fields of the item are then empty or null."
          }
        },
        "additionalProperties": false,
        "description": "One listing's book, to the depth asked for."
      },
      "BookLevel": {
        "maxItems": 2,
        "minItems": 2,
        "type": "array",
        "items": {
          "type": [
            "null",
            "string"
          ]
        },
        "description": "One level as `[price, size]`. Both are strings, always: a book is where a rounded digit becomes a wrong order."
      },
      "BooksRequest": {
        "type": "object",
        "properties": {
          "where": {
            "$ref": "#/components/schemas/Selection"
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot",
              "all"
            ],
            "type": "string",
            "description": "Market kind to select. Defaults to perpetual, preserving the prior V2 selection. `all` includes spot and perpetual listings.",
            "default": "perpetual"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "What quantities are expressed in.",
            "default": "published"
          },
          "number_format": {
            "enum": [
              "json",
              "string"
            ],
            "type": "string",
            "description": "`string` returns every number as a string with the same digits.",
            "default": "json"
          },
          "include_synthetic": {
            "type": "boolean",
            "description": "Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra.",
            "default": false
          },
          "depth": {
            "minimum": 1,
            "type": "integer",
            "description": "Levels per side. Clamped to what the plan allows; the answer states what was applied."
          },
          "allow_stale": {
            "type": "boolean",
            "description": "ADR-025: return a stale value under `withheld` — never in the value field. Off by default: a stale value is not in the answer at all, only its status, reason and dates. For post-mortems; never feed `withheld` into a live decision.",
            "default": false
          }
        },
        "additionalProperties": false,
        "description": "Order books for the selected listings."
      },
      "BooksResponse": {
        "required": [
          "evaluated_at",
          "units",
          "depth",
          "liquidity_note",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "The unit mode applied."
          },
          "normalisation_version": {
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store.",
            "$ref": "#/components/schemas/NormalisationVersion"
          },
          "depth": {
            "type": "integer",
            "description": "How many levels per side were returned, after the plan's ceiling was applied."
          },
          "liquidity_note": {
            "type": "string",
            "description": "How the depth figures relate to the levels shown, in one sentence."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookItem"
            },
            "description": "One object per listing."
          }
        },
        "additionalProperties": false,
        "description": "Order books for the selected listings."
      },
      "BudgetVenue": {
        "required": [
          "venue",
          "synthetic",
          "budget"
        ],
        "type": "object",
        "properties": {
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "synthetic": {
            "type": "boolean",
            "description": "Whether the venue is a synthetic test segment."
          },
          "budget": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OperationalBudget"
              },
              {
                "type": "null"
              }
            ],
            "description": "The budget, or null for a venue that spends none or has sent no heartbeat."
          }
        },
        "additionalProperties": false,
        "description": "One venue's budget."
      },
      "BudgetsResponse": {
        "required": [
          "evaluated_at",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BudgetVenue"
            },
            "description": "One object per venue."
          }
        },
        "additionalProperties": false,
        "description": "Cached operational collection budgets. No prices and no account data."
      },
      "Candle": {
        "required": [
          "open_time",
          "close_time",
          "open",
          "high",
          "low",
          "close",
          "volume",
          "trade_count",
          "venue_ts",
          "received_at",
          "status"
        ],
        "type": "object",
        "properties": {
          "open_time": {
            "$ref": "#/components/schemas/Instant"
          },
          "close_time": {
            "$ref": "#/components/schemas/Instant"
          },
          "open": {
            "$ref": "#/components/schemas/Number"
          },
          "high": {
            "$ref": "#/components/schemas/Number"
          },
          "low": {
            "$ref": "#/components/schemas/Number"
          },
          "close": {
            "$ref": "#/components/schemas/Number"
          },
          "volume": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "Volume over the period, in the unit named by the item's `units.volume`; null with `reasons.volume` on the item where the venue publishes none for this price type (a mark or index candle of Bybit, OKX, GMX, Avantis)."
          },
          "trade_count": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many trades, where the venue publishes it; null with `reasons.trade_count` on the item where it does not."
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "status": {
            "const": "present",
            "type": "string",
            "description": "Always `present` for a candle that exists."
          }
        },
        "additionalProperties": false,
        "description": "One completed period. Nothing is synthesised: a period the platform does not have is a gap row, not an interpolation, and a forming candle is never returned because only closed minutes are stored."
      },
      "CandleGap": {
        "required": [
          "open_time",
          "close_time",
          "status",
          "reason"
        ],
        "type": "object",
        "properties": {
          "open_time": {
            "$ref": "#/components/schemas/Instant"
          },
          "close_time": {
            "$ref": "#/components/schemas/Instant"
          },
          "status": {
            "const": "gap",
            "type": "string",
            "description": "Always `gap`."
          },
          "reason": {
            "enum": [
              "not_retained",
              "collector_gap",
              "no_value"
            ],
            "type": "string",
            "description": "`not_retained` when the period is older than what is kept for this listing, `collector_gap` when the platform recorded a hole there (`gap_cause` says what), `no_value` when nothing was received for it and nothing recorded says why."
          },
          "gap_cause": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GapCause"
              }
            ],
            "description": "With reason `collector_gap`: what the platform recorded. For a period longer than a minute, a hole in any of its minutes."
          }
        },
        "additionalProperties": false,
        "description": "A period with no candle. It is written out rather than left as a hole in the sequence, so a reader counting bars is never silently short."
      },
      "CandleItem": {
        "required": [
          "instrument",
          "venue",
          "venue_symbol",
          "quote",
          "status",
          "source",
          "retention_from",
          "units",
          "candles"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when this listing maps to no instrument — and then `reason` says why."
          },
          "reason": {
            "$ref": "#/components/schemas/NullReason"
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "venue_symbol": {
            "type": "string",
            "description": "The venue's own symbol."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "Mapping recorded after deployment or reconstructed from the pre-deployment cache."
          },
          "identity_corrected_at": {
            "description": "Start of the next mapping interval for this listing, when one exists.",
            "$ref": "#/components/schemas/Instant"
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot"
            ],
            "type": "string",
            "description": "The market kind of this listing. Added with change set 37; absent from earlier responses."
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "source": {
            "enum": [
              "venue",
              "derived"
            ],
            "type": "string",
            "description": "`venue` for one-minute candles, which are the venue's own klines; `derived` for every longer period, rolled up from them. A rolled-up period exists only when every base minute of it exists."
          },
          "retention_from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "The earliest instant candles are kept for this listing: the later of the oldest week its retention class holds and the moment that class was last raised for it (a move to a group that keeps longer, or its group's retention raised) — rows written before that keep the shorter class they were written under."
          },
          "units": {
            "required": [
              "price",
              "volume"
            ],
            "type": "object",
            "properties": {
              "price": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The unit of open, high, low and close."
              },
              "volume": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The unit of volume."
              }
            },
            "additionalProperties": false,
            "description": "What the numbers count."
          },
          "reasons": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/NullReason"
            },
            "description": "Why a field is null throughout. Present only when one is."
          },
          "candles": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Candle"
                },
                {
                  "$ref": "#/components/schemas/CandleGap"
                }
              ]
            },
            "description": "Ascending by open time, gaps included."
          }
        },
        "additionalProperties": false,
        "description": "One listing's candles over the window asked for."
      },
      "CandlesRequest": {
        "required": [
          "timeframe",
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "where": {
            "$ref": "#/components/schemas/Selection"
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot",
              "all"
            ],
            "type": "string",
            "description": "Market kind to select. Defaults to perpetual, preserving the prior V2 selection. `all` includes spot and perpetual listings.",
            "default": "perpetual"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "What quantities are expressed in.",
            "default": "published"
          },
          "number_format": {
            "enum": [
              "json",
              "string"
            ],
            "type": "string",
            "description": "`string` returns every number as a string with the same digits.",
            "default": "json"
          },
          "include_synthetic": {
            "type": "boolean",
            "description": "Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra.",
            "default": false
          },
          "timeframe": {
            "examples": [
              "15m"
            ],
            "type": "string",
            "description": "The period. `1m` comes from the venue's own klines; every longer period is rolled up from them."
          },
          "price_type": {
            "enum": [
              "trade",
              "mark",
              "index"
            ],
            "type": "string",
            "description": "Which price.",
            "default": "trade"
          },
          "from": {
            "$ref": "#/components/schemas/Instant"
          },
          "to": {
            "$ref": "#/components/schemas/Instant"
          },
          "include_gaps": {
            "type": "boolean",
            "description": "Keep the periods with no candle, as gap rows.",
            "default": true
          },
          "closed_only": {
            "type": "boolean",
            "description": "Accepted and has no effect: only closed minutes are stored, so there is never a forming candle to return.",
            "default": true
          },
          "trade": {
            "type": "boolean",
            "description": "Reserved."
          },
          "as_of": {
            "description": "Receipt-time availability cutoff. to bounds candle closes; as_of bounds when their input was available. Defaults to now.",
            "$ref": "#/components/schemas/Instant"
          }
        },
        "additionalProperties": false,
        "description": "Completed candles for the selected listings."
      },
      "CandlesResponse": {
        "required": [
          "evaluated_at",
          "settled",
          "items_sha256",
          "timeframe",
          "price_type",
          "from",
          "to",
          "units",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "settled": {
            "type": "boolean",
            "description": "Whether the window is far enough in the past that a late arrival can no longer change it."
          },
          "items_sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "SHA-256 of `items` as serialised. Two answers with the same hash are the same answer, which is how a client can skip work rather than re-parse."
          },
          "timeframe": {
            "type": "string",
            "description": "The period returned."
          },
          "price_type": {
            "enum": [
              "trade",
              "mark",
              "index"
            ],
            "type": "string",
            "description": "Which price the candles are of."
          },
          "from": {
            "$ref": "#/components/schemas/Instant"
          },
          "to": {
            "$ref": "#/components/schemas/Instant"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "The unit mode applied."
          },
          "normalisation_version": {
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store.",
            "$ref": "#/components/schemas/NormalisationVersion"
          },
          "listings_as_of": {
            "description": "When the set of listings was last known to change. Present when asking about the past.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "capabilities_as_of": {
            "description": "When what each venue publishes was last known to change.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandleItem"
            },
            "description": "One object per listing."
          },
          "data_as_of": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "additionalProperties": false,
        "description": "Completed candles for the selected listings."
      },
      "CatalogueEndpointLimits": {
        "required": [
          "snapshots_listings",
          "history_listings",
          "history_rows_per_layer",
          "history_raw_rows",
          "candles_listings",
          "candles_per_listing",
          "books_listings",
          "book_depth",
          "stream_listings",
          "response_bytes"
        ],
        "type": "object",
        "properties": {
          "snapshots_listings": {
            "type": "integer",
            "description": "The most listings one `POST /v2/snapshots` may select."
          },
          "history_listings": {
            "type": "integer",
            "description": "The most listings one `POST /v2/snapshots/history` may select."
          },
          "history_rows_per_layer": {
            "type": "integer",
            "description": "The most rows one layer of one listing returns in `interval` mode of `POST /v2/snapshots/history`."
          },
          "history_raw_rows": {
            "type": "integer",
            "description": "The most rows one layer of one listing returns in `raw` mode of `POST /v2/snapshots/history`."
          },
          "candles_listings": {
            "type": "integer",
            "description": "The most listings one `POST /v2/candles` may select."
          },
          "candles_per_listing": {
            "type": "integer",
            "description": "The most candles one listing returns from `POST /v2/candles`."
          },
          "liquidations_listings": {
            "type": "integer",
            "description": "C8-02: listings in one `POST /v2/liquidations`."
          },
          "liquidations_per_listing": {
            "type": "integer",
            "description": "C8-02: the newest events of a listing one `POST /v2/liquidations` returns."
          },
          "liquidations_window": {
            "examples": [
              "604800s"
            ],
            "type": "string",
            "description": "C8-02: the longest `(from, to]` one `POST /v2/liquidations` reads, as seconds (`604800s`: a week)."
          },
          "settlements_listings": {
            "type": "integer",
            "description": "Issue 619: listings in one `GET /v2/funding/settlements`."
          },
          "settlements_per_page": {
            "type": "integer",
            "description": "Issue 619: the most rows one page of `GET /v2/funding/settlements` returns (`limit`); follow `next_cursor` for the rest."
          },
          "books_listings": {
            "type": "integer",
            "description": "The most listings one `POST /v2/books` may select."
          },
          "book_depth": {
            "type": "integer",
            "description": "The most levels a side of `POST /v2/books` serves; a plan may serve fewer (`book_levels` of `GET /v2/plans`)."
          },
          "stream_listings": {
            "type": "integer",
            "description": "The most listings one `GET /v2/stream` may select."
          },
          "response_bytes": {
            "type": "integer",
            "description": "The largest response a data endpoint will write, in bytes. A request that would exceed it is refused rather than cut short."
          }
        },
        "additionalProperties": false,
        "description": "What each data endpoint will accept in one request."
      },
      "CatalogueField": {
        "required": [
          "name",
          "type",
          "scope",
          "layer",
          "unit",
          "description",
          "sampleable",
          "additive",
          "not_published_on"
        ],
        "type": "object",
        "properties": {
          "name": {
            "examples": [
              "funding"
            ],
            "type": "string",
            "description": "As written in a query."
          },
          "type": {
            "examples": [
              "number",
              "code",
              "duration",
              "timestamp"
            ],
            "type": "string",
            "description": "The kind of value it has."
          },
          "scope": {
            "enum": [
              "instrument",
              "venue"
            ],
            "type": "string",
            "description": "Whether the name belongs to the instrument or to one venue's listing of it. A venue-scoped name must sit inside any(…), all(…), count(…) or an aggregate."
          },
          "layer": {
            "examples": [
              "funding",
              "mark",
              "book"
            ],
            "type": "string",
            "description": "The layer it is read from; its freshness bound is this layer's."
          },
          "unit": {
            "enum": [
              "quantity",
              "quote",
              "fraction",
              "ms",
              "count",
              "code",
              "none"
            ],
            "type": "string",
            "description": "What the value counts."
          },
          "description": {
            "type": "string",
            "description": "One sentence of what it is."
          },
          "sampleable": {
            "type": "boolean",
            "description": "Whether it can be read as a series once a period, not only as the latest reading."
          },
          "additive": {
            "type": "boolean",
            "description": "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."
          },
          "not_published_on": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The venues that do not publish it — from what each venue documents, not from whether data happened to arrive. Asking for it there gives null with reason `venue_capability`, never a guess."
          }
        },
        "additionalProperties": false,
        "description": "One field a query may name."
      },
      "CatalogueFunction": {
        "required": [
          "name",
          "signature",
          "type",
          "scope",
          "layer",
          "unit",
          "description"
        ],
        "type": "object",
        "properties": {
          "name": {
            "examples": [
              "rsi",
              "depth_bid_value"
            ],
            "type": "string",
            "description": "As written in a query."
          },
          "signature": {
            "examples": [
              "rsi(source, n[, timeframe])"
            ],
            "type": "string",
            "description": "Its arguments, in order."
          },
          "type": {
            "type": "string",
            "description": "The kind of value it returns."
          },
          "scope": {
            "enum": [
              "instrument",
              "venue"
            ],
            "type": "string",
            "description": "Whether the name belongs to the instrument or to one venue's listing of it. A venue-scoped name must sit inside any(…), all(…), count(…) or an aggregate."
          },
          "layer": {
            "type": "string",
            "description": "The layer it reads, where it reads one: `candles` for a series function, `book` or `venue_depth` for a depth function, `liquidation` for a total over the liquidations of a window (C8-01), empty otherwise."
          },
          "unit": {
            "enum": [
              "quantity",
              "quote",
              "fraction",
              "ms",
              "count",
              "code",
              "none"
            ],
            "type": "string",
            "description": "What the value counts."
          },
          "description": {
            "type": "string",
            "description": "One sentence of what it computes."
          },
          "not_published_on": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The venues that do not publish it — from what each venue documents, not from whether data happened to arrive. Asking for it there gives null with reason `venue_capability`, never a guess."
          }
        },
        "additionalProperties": false,
        "description": "One function a query may call."
      },
      "CatalogueLimits": {
        "required": [
          "source_bytes",
          "nodes",
          "depth",
          "quantifiers_and_aggregates",
          "series_calls",
          "timeframes",
          "window",
          "bars_per_atom",
          "cost",
          "in_list",
          "select",
          "order_by",
          "freshness_min",
          "freshness_max",
          "screen_limit",
          "endpoints"
        ],
        "type": "object",
        "properties": {
          "source_bytes": {
            "type": "integer",
            "description": "The longest query text accepted."
          },
          "nodes": {
            "type": "integer",
            "description": "The most nodes the parsed query may have."
          },
          "depth": {
            "type": "integer",
            "description": "The deepest the expression may nest."
          },
          "quantifiers_and_aggregates": {
            "type": "integer",
            "description": "How many any/all/count/max/min/sum one query may hold."
          },
          "series_calls": {
            "type": "integer",
            "description": "How many series functions one query may call."
          },
          "timeframes": {
            "type": "integer",
            "description": "How many different periods one query may read."
          },
          "window": {
            "type": "integer",
            "description": "The largest window a series function may ask for, in periods."
          },
          "bars_per_atom": {
            "type": "integer",
            "description": "The most bars one series read may cost."
          },
          "cost": {
            "type": "integer",
            "description": "The total the query may cost. The parse endpoint tells you a query's cost before you run it."
          },
          "in_list": {
            "type": "integer",
            "description": "The longest `in (…)` list."
          },
          "select": {
            "type": "integer",
            "description": "How many values one `select` may return."
          },
          "order_by": {
            "type": "integer",
            "description": "How many keys one `order by` may have."
          },
          "reference_targets": {
            "type": "integer",
            "description": "Change set 34: how many distinct (instrument, venue) targets of `ref` one query may name; `ref(X, …)` without a venue is the target (X, the venue evaluated)."
          },
          "freshness_min": {
            "examples": [
              "1s"
            ],
            "type": "string",
            "description": "The shortest freshness bound a query may set."
          },
          "freshness_max": {
            "examples": [
              "3600s"
            ],
            "type": "string",
            "description": "The longest freshness bound a query may set."
          },
          "screen_limit": {
            "type": "integer",
            "description": "The largest page /v2/screen will return."
          },
          "screen_sampled_rows": {
            "type": "integer",
            "description": "The stored rows the sampled series of one /v2/screen may read: selected listings × each sampled window ÷ its retained granularity (a row a second; funding, a row per ten seconds). Past it, DQL_LIMIT. Absent from answers captured before change set 06 C6-12."
          },
          "endpoints": {
            "$ref": "#/components/schemas/CatalogueEndpointLimits"
          }
        },
        "additionalProperties": false,
        "description": "Every ceiling a query meets, as numbers rather than as prose. Read them; do not hard-code them."
      },
      "CatalogueResponse": {
        "required": [
          "dql",
          "catalogue",
          "evaluated_at",
          "fields",
          "sources",
          "functions",
          "venues",
          "currencies",
          "assets",
          "instruments",
          "timeframes",
          "bands",
          "freshness_defaults",
          "limits",
          "settle_after",
          "earliest_retained",
          "units",
          "number_formats"
        ],
        "type": "object",
        "properties": {
          "dql": {
            "const": "1",
            "type": "string",
            "description": "The language version this catalogue describes."
          },
          "catalogue": {
            "type": "string",
            "description": "A version that changes whenever the catalogue's content does. Cache against it."
          },
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogueField"
            },
            "description": "Every field."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogueSource"
            },
            "description": "Every candle source."
          },
          "functions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogueFunction"
            },
            "description": "Every function."
          },
          "venues": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every venue code a query may name."
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every quote currency. DQL never converts between them."
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every base asset."
          },
          "instruments": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every instrument code."
          },
          "timeframes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every period a series may be read at."
          },
          "bands": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every price band the depth functions accept."
          },
          "freshness_defaults": {
            "type": "object",
            "additionalProperties": {
              "examples": [
                "5s",
                "300s"
              ],
              "type": "string",
              "description": "A duration in seconds."
            },
            "description": "The default freshness bound per layer. A reading older than its bound is stale and compares as unknown."
          },
          "limits": {
            "$ref": "#/components/schemas/CatalogueLimits"
          },
          "settle_after": {
            "type": "integer",
            "description": "Seconds after which an instant is settled: late arrivals can no longer change an answer about it."
          },
          "earliest_retained": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "The earliest instant any query may ask about."
          },
          "units": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The unit modes a request may ask for."
          },
          "number_formats": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The number formats a request may ask for."
          }
        },
        "additionalProperties": false,
        "description": "What a query may ask for, as data. Generated from the registry and the policy the collectors run on, so it changes the moment the platform does — which is why a client should read it rather than carry a copy."
      },
      "CatalogueSource": {
        "required": [
          "name",
          "type",
          "scope",
          "layer",
          "price_type",
          "unit",
          "description",
          "not_published_on"
        ],
        "type": "object",
        "properties": {
          "name": {
            "examples": [
              "close",
              "mark_close",
              "index_high"
            ],
            "type": "string",
            "description": "As written in a query."
          },
          "type": {
            "const": "series",
            "type": "string",
            "description": "Always `series`."
          },
          "scope": {
            "enum": [
              "instrument",
              "venue"
            ],
            "type": "string",
            "description": "Whether the name belongs to the instrument or to one venue's listing of it. A venue-scoped name must sit inside any(…), all(…), count(…) or an aggregate."
          },
          "layer": {
            "const": "candles",
            "type": "string",
            "description": "Always `candles`."
          },
          "price_type": {
            "enum": [
              "trade",
              "mark",
              "index"
            ],
            "type": "string",
            "description": "Which price the candles are of."
          },
          "unit": {
            "enum": [
              "quantity",
              "quote",
              "fraction",
              "ms",
              "count",
              "code",
              "none"
            ],
            "type": "string",
            "description": "What the value counts."
          },
          "description": {
            "type": "string",
            "description": "One sentence of what it is."
          },
          "not_published_on": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The venues that do not publish it — from what each venue documents, not from whether data happened to arrive. Asking for it there gives null with reason `venue_capability`, never a guess."
          }
        },
        "additionalProperties": false,
        "description": "One candle source a series function may read."
      },
      "CollectedVenue": {
        "required": [
          "venue",
          "name",
          "kind",
          "listings",
          "listings_collected",
          "since"
        ],
        "type": "object",
        "properties": {
          "venue": {
            "examples": [
              "KRAKEN-FUTURES"
            ],
            "type": "string",
            "description": "The public code to use in a query."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The venue's own name, when it has told us one."
          },
          "kind": {
            "examples": [
              "cex",
              "dex"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "What the venue's prices come from, as the registry records it: `order_book` (its own order book), `oracle` (an oracle feed) or `spot`."
          },
          "synthetic": {
            "type": "boolean",
            "description": "Whether this venue is a synthetic test segment. Added with C37-06; optional until production serves it."
          },
          "funding_mode": {
            "enum": [
              "settled",
              "continuous"
            ],
            "type": "string",
            "description": "How the venue charges funding. `settled`: on a schedule, so there is a next settlement, an interval and a countdown to it. `continuous`: accrued against a vault, and none of those three exists — they answer null with reason `funding_continuous`, which points here rather than asserting three separate absences. `funding` and `funding_8h` are unaffected. Added 2026-09-24 and therefore not required: a response schema's `required` is a promise about every server answering right now, and one that has not been deployed yet does not send it."
          },
          "listings": {
            "type": "integer",
            "description": "How many of its listings are live — everything it lists, whether or not the platform collects it."
          },
          "listings_collected": {
            "type": "integer",
            "description": "How many of those the platform actually collects. The difference is coverage, and it is stated rather than implied."
          },
          "since": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "When the platform first saw any listing of this venue. Null before the first sighting is recorded. Nothing older exists, in the database or the archive."
          },
          "hot_days": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Days the database holds each layer for this venue (`ticker`, `mark`, `funding`, `oi`, `book`, `stats`, `venue_depth`, `trade`, `candles`): the shortest class of its collected listings. Older is an archive file. A layer the venue does not collect is absent."
          }
        },
        "additionalProperties": false,
        "description": "One venue the platform collects."
      },
      "ContractUnits": {
        "required": [
          "tick_size",
          "lot_size",
          "min_qty",
          "min_notional"
        ],
        "type": "object",
        "properties": {
          "tick_size": {
            "examples": [
              "base",
              "quote",
              "contracts"
            ],
            "type": "string",
            "description": "The unit of that rule."
          },
          "lot_size": {
            "examples": [
              "base",
              "quote",
              "contracts"
            ],
            "type": "string",
            "description": "The unit of that rule."
          },
          "min_qty": {
            "examples": [
              "base",
              "quote",
              "contracts"
            ],
            "type": "string",
            "description": "The unit of that rule."
          },
          "min_notional": {
            "examples": [
              "base",
              "quote",
              "contracts"
            ],
            "type": "string",
            "description": "The unit of that rule."
          }
        },
        "additionalProperties": false,
        "description": "What each contract rule above is expressed in, after any unit conversion the request asked for."
      },
      "DerivedValue": {
        "required": [
          "value",
          "derived"
        ],
        "type": "object",
        "properties": {
          "value": {
            "$ref": "#/components/schemas/Number"
          },
          "unit": {
            "$ref": "#/components/schemas/Unit"
          },
          "derived": {
            "const": "True",
            "type": "boolean",
            "description": "Always true: the platform computed this value from others rather than reading it."
          },
          "venue": {
            "type": "string",
            "description": "Change set 34: on a `ref` of an expression that is not one atom, or that read nothing, the venue of the listing it was read on."
          },
          "instrument": {
            "type": "string",
            "description": "Change set 34: the instrument that ref was read for."
          },
          "layer": {
            "type": "string",
            "description": "Change set 34: with reason `not_in_scope` and status `off` or `not_published`, the layer of the listing that is off or not published."
          },
          "status": {
            "description": "Whether the value is current: `present`, `stale`, `missing`, `not_published` or `off`. Only a `present` value comes with a number. A stale value is withheld, and a missing, unpublished or switched-off one has none, so a value that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Status"
          },
          "atoms": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Value"
            },
            "description": "The values this one was computed from, each with its own provenance. Present only when the request asked for `include_atoms` — the mark is always there, the evidence on request."
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          }
        },
        "additionalProperties": false,
        "description": "A value computed from others — a spread, a basis, a ratio. `atoms` holds the values it was computed from, each with its own provenance, so the result can be checked rather than believed."
      },
      "ErrorPosition": {
        "required": [
          "line",
          "column",
          "offset",
          "length"
        ],
        "type": "object",
        "properties": {
          "line": {
            "type": "integer",
            "description": "1-based."
          },
          "column": {
            "type": "integer",
            "description": "1-based."
          },
          "offset": {
            "type": "integer",
            "description": "0-based, in characters."
          },
          "length": {
            "type": "integer",
            "description": "How many characters the problem spans."
          }
        },
        "additionalProperties": false,
        "description": "Where in the query text the problem is, so an editor can underline it."
      },
      "ErrorResponse": {
        "required": [
          "errors"
        ],
        "type": "object",
        "properties": {
          "errors": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiError"
            },
            "description": "The problems found, each with a stable `code`. Branch on `code`; `message` may be reworded."
          }
        },
        "additionalProperties": false,
        "description": "Every fault answers in this shape, whatever the status code. More than one error is reported where the platform can find more than one."
      },
      "FundingSettlement": {
        "required": [
          "instrument",
          "venue",
          "venue_symbol",
          "quote",
          "time",
          "status",
          "rate",
          "rate_source",
          "interval",
          "interval_source",
          "interval_published",
          "interval_check",
          "origin",
          "rate_8h",
          "cap",
          "floor",
          "cap_8h",
          "floor_8h",
          "at_cap"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when this listing maps to no instrument — and then `reason` says why."
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot"
            ],
            "type": "string",
            "description": "The market kind of this listing."
          },
          "venue_symbol": {
            "type": "string",
            "description": "The venue's own symbol."
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "Mapping recorded after deployment or reconstructed from the pre-deployment cache."
          },
          "identity_corrected_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "Start of the next mapping interval for this listing, when one exists."
          },
          "time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The settlement instant as the venue states it, to the second (a venue's own time carries milliseconds of jitter after the hour)."
          },
          "status": {
            "enum": [
              "present",
              "missing"
            ],
            "type": "string",
            "description": "`present` when the print carries a rate. `missing`: a live print was seen settling and the platform had no rate within five minutes of it (`rate_source: unsampled`); `rate` is null with a `reason`, never zero, until a backfill fills it from the venue's history."
          },
          "reason": {
            "$ref": "#/components/schemas/NullReason"
          },
          "rate": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The rate that settled, exactly as the venue publishes it: a fraction (`0.0001` is 0.01%) for the listing's own interval, never rescaled. Null when `status` is `missing`."
          },
          "rate_source": {
            "enum": [
              "venue_history",
              "last_sample",
              "first_sample_after",
              "unsampled"
            ],
            "type": "string",
            "description": "Where the rate was read: `venue_history` the venue's own funding-history endpoint; `last_sample` the last rate the platform received before the instant; `first_sample_after` the first received after it, on a venue whose feed names the rate that has just settled (OKX); `unsampled` none (the rate is null)."
          },
          "interval": {
            "type": [
              "null",
              "string"
            ],
            "description": "The funding interval in force at that print, as DQL text (`8h`): the gap to the listing's previous print where it is one of 1, 2, 4 or 8 hours; where it is not (a halted listing), the interval of the print before. Derived by the platform. Null where there is neither a previous print nor a published interval."
          },
          "interval_source": {
            "enum": [
              "gap",
              "venue"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "`gap`: derived from the prints' own times. `venue`: no previous print, so the interval the venue publishes stands in."
          },
          "interval_published": {
            "type": [
              "null",
              "string"
            ],
            "description": "The interval the venue publishes for the listing at the print: the newest word the platform recorded from the venue that began before it, the first of them for an older print, the venue's current word where none was recorded. Null where the venue publishes none."
          },
          "interval_check": {
            "enum": [
              "match",
              "mismatch",
              "unchecked"
            ],
            "type": "string",
            "description": "Whether `interval` (from the gaps) equals `interval_published`. A `mismatch` is flagged and nothing is corrected: the row keeps the interval its gaps give, and the venue's word stays beside it (a venue can have changed the interval before the platform watched it). `unchecked`: one of the two is null."
          },
          "origin": {
            "enum": [
              "live",
              "backfill"
            ],
            "type": "string",
            "description": "`live`: recorded as it settled, from the venue's funding data. `backfill`: read afterwards from the venue's own history. A live print whose rate a backfill confirmed stays `live`."
          },
          "rate_8h": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "`rate` restated over 8 hours by the interval of the print: `rate` × 8 h / `interval`. Null where either is null."
          },
          "cap": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The highest rate the venue lets a settlement take, as its API published it for the listing at the print, for the same interval as `rate`. Null where the venue's API publishes none, or none had been observed by then (a print is never judged against a later cap)."
          },
          "floor": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The lowest rate the venue lets a settlement take, as for `cap`."
          },
          "cap_8h": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "`cap` restated over 8 hours exactly as `rate_8h`."
          },
          "floor_8h": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "`floor` restated over 8 hours exactly as `rate_8h`."
          },
          "at_cap": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "True when `rate` sits on a bound the venue published (`rate >= cap` or `rate <= floor`); false only when both bounds are known and it is between them; null when it cannot be judged."
          }
        },
        "additionalProperties": false,
        "description": "One settlement print of one listing: what the venue settled at an instant. The rate is the venue's own, for the listing's own interval; `rate_8h` restates it on the 8 h basis of `funding_8h`."
      },
      "FundingSettlementsResponse": {
        "required": [
          "evaluated_at",
          "from",
          "to",
          "order",
          "listings",
          "items_sha256",
          "not_recorded",
          "items",
          "next_cursor"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The instant the platform evaluated this answer at (UTC)."
          },
          "served_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ServedAt"
              }
            ],
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits)."
          },
          "receipt_id": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ReceiptId"
              }
            ],
            "description": "Names this exact response. Log it next to the decision made from it."
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The start of the window actually read (exclusive). Pinned by the first page and the same on every page of a cursor."
          },
          "to": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The end of the window actually read (inclusive)."
          },
          "order": {
            "enum": [
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "The order of `items` by `time` (then instrument)."
          },
          "listings": {
            "type": "integer",
            "description": "How many listings the selection named."
          },
          "items_sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "SHA-256 of `items` as serialised."
          },
          "not_recorded": {
            "type": "array",
            "items": {
              "required": [
                "venue",
                "reason"
              ],
              "type": "object",
              "properties": {
                "venue": {
                  "type": "string",
                  "description": "The venue's public code."
                },
                "reason": {
                  "enum": [
                    "funding_continuous",
                    "not_recorded"
                  ],
                  "type": "string",
                  "description": "`funding_continuous`: the venue accrues funding continuously and has no settlement. `not_recorded`: it settles, and the platform does not record its prints yet."
                }
              },
              "additionalProperties": false
            },
            "description": "The venues of the selection the platform holds no settlement prints for, each with why. An empty page of such a venue is not a quiet venue."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundingSettlement"
            },
            "description": "The prints."
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Opaque continuation cursor. Null means this is the last page. Keep the other options unchanged; a stale or foreign cursor returns `DQL_CURSOR` and the read restarts from the first page."
          }
        },
        "additionalProperties": false,
        "description": "A page of settlement prints, one row per print of the selected listings in the window, newest first unless `order=asc`. Follow `next_cursor` until null."
      },
      "GapCause": {
        "enum": [
          "ws_disconnected",
          "ws_sequence_gap",
          "resync",
          "rate_limited",
          "collector_down",
          "bus_unavailable",
          "writer_rejected",
          "venue_rejected",
          "state_lag",
          "not_collected",
          "undetected",
          "bootstrap_restart",
          "history_lane_lost"
        ],
        "type": "string",
        "description": "What the platform recorded about a hole in its history. `bus_unavailable`: the platform's own message bus refused what the collector observed. `rate_limited`: a poll ran late against the venue's budget. `venue_rejected`: the venue refused the requests. `ws_disconnected`: the venue's socket was down. `ws_sequence_gap` and `resync`: a hole in the venue's own sequence, or a book rebuilt from a snapshot — a moment, not an interval. `collector_down`: the collector sent no heartbeat, whatever the reason. `writer_rejected`: the observation reached the platform and could not be stored. `state_lag`: the platform's own live projection fell behind its bus — the venue and the connection were fine, and history was not affected, but the live answer was older than it claimed. `not_collected`: the platform was not collecting this listing at all — it was taken off collection by an operator or by a rule, or its group's policy switched every dataset of it off — until it was collected again; a decision of the platform's, not a fault of the venue, the connection or the bus, and the one cause that is about one listing and not about its segment. `undetected`: a settled rollup check found a missing native one-minute candle with no recorded collector gap; the cause of the underlying loss is unknown. It identifies the missing minute and listing/price type, and is closed only after Writer confirms the native candle and the required rollups are visible. `bootstrap_restart`: a one-time authorized collector replacement recorded the restart interval; it is closed only when supported native candle data and required rollups are Writer-confirmed. `history_lane_lost`: our own wiring defect (#450, 2026-10-14/15) — the value was observed and published live, but the sampled history layers (ticker, mark, funding, open interest, stats, derived and venue depth) never reached history; not a fault of the venue, the socket, the bus or the Writer, and candles and trades were not affected. Recorded as a bounded interval after the fact, never repaired."
      },
      "HistoryGap": {
        "required": [
          "from",
          "to",
          "reason"
        ],
        "type": "object",
        "properties": {
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "Where the stretch begins, not before the range's own start."
          },
          "to": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "Where it ends, not after the range's own end; null for a recorded hole whose end was never recorded."
          },
          "reason": {
            "enum": [
              "not_retained",
              "collector_gap"
            ],
            "type": "string",
            "description": "`not_retained`: older than what is kept for this listing (`retention_from`). `collector_gap`: the platform recorded a hole; `gap_cause` says what."
          },
          "gap_cause": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GapCause"
              }
            ],
            "description": "With reason `collector_gap`: what the platform recorded. A `state_lag` is never one: State's projection fell behind, the stored history did not."
          }
        },
        "additionalProperties": false,
        "description": "A stretch of a `raw` history range that holds no row because of something the platform recorded, written out so that an empty stretch is never read as a quiet one."
      },
      "HistoryItem": {
        "required": [
          "instrument",
          "venue",
          "venue_symbol",
          "quote",
          "layers"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when this listing maps to no instrument."
          },
          "reason": {
            "type": "string",
            "description": "Why the listing maps to no instrument. Present only when `instrument` is null."
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "venue_symbol": {
            "type": "string",
            "description": "The venue's own symbol."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "Mapping recorded after deployment or reconstructed from the pre-deployment cache."
          },
          "identity_corrected_at": {
            "description": "Start of the next mapping interval for this listing, when one exists.",
            "$ref": "#/components/schemas/Instant"
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot"
            ],
            "type": "string",
            "description": "The market kind of this listing. Added with change set 37; absent from earlier responses."
          },
          "layers": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/HistoryLayer"
                },
                {
                  "$ref": "#/components/schemas/HistorySummaryLayer"
                }
              ]
            },
            "description": "Each layer asked for, by name."
          }
        },
        "additionalProperties": false,
        "description": "One listing's history, layer by layer."
      },
      "HistoryLayer": {
        "required": [
          "retention_from",
          "units",
          "rows"
        ],
        "type": "object",
        "properties": {
          "retention_from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "The earliest instant this layer is kept for this listing: the later of the oldest week its retention class holds and the moment that class was last raised for it (a move to a group that keeps longer, or its group's retention raised). A question about anything earlier answers `not_retained`."
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Status"
              }
            ],
            "description": "Present only when the layer is `off` or `not_published` throughout — then there are no rows to look at."
          },
          "reason": {
            "$ref": "#/components/schemas/NullReason"
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "What each field counts."
          },
          "rows": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/HistoryRow"
                },
                {
                  "$ref": "#/components/schemas/HistoryRawRow"
                }
              ]
            },
            "description": "Ascending in time."
          },
          "liquidity_rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryRawRow"
            },
            "description": "In `raw` mode, the book layer's band observations — a separate stream from the rows above, because the depth is measured separately from the ticker and dating one by the other would overstate it."
          },
          "gaps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryGap"
            },
            "description": "In `raw` mode, what the range missed: the stretches with no row because the platform recorded a hole, or because they are older than `retention_from`. Empty when nothing was missed or with `include_gaps: false`. `interval` mode shows the same holes as gap rows, `at` mode beside a stale reading."
          }
        },
        "additionalProperties": false,
        "description": "One layer's history for one listing."
      },
      "HistoryRawRow": {
        "required": [
          "received_at",
          "venue_ts",
          "values"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "Mapping at this row's instant."
          },
          "base": {
            "type": [
              "null",
              "string"
            ],
            "description": "The base asset at this row's instant."
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing was quoted in at this row's instant."
          },
          "multiplier": {
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The venue's price multiplier at this row's instant, where it has one."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "`recorded`: the mapping interval was written after identity history began. `reconstructed`: the migration knew the listing's first observed time and its then-current mapping, not when any earlier change happened."
          },
          "identity_corrected_at": {
            "$ref": "#/components/schemas/Instant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Number"
                },
                {
                  "$ref": "#/components/schemas/Liquidity"
                }
              ]
            },
            "description": "The layer's fields at that point. The `book` and `venue_depth` layers also carry `liquidity`. In the `funding` layer `funding_cap`, `funding_floor` and `funding_at_cap` are judged against the bounds in force at the point's own time, never against a later one; a point older than the first observed bound has null for them (`not_retained`)."
          },
          "reasons": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/NullReason"
            },
            "description": "Why a value is null, by field."
          }
        },
        "additionalProperties": false,
        "description": "One row exactly as it arrived, in `raw` mode: no sampling, no bucketing, one object per message received."
      },
      "HistoryRequest": {
        "$comment": "Task 119. Each allOf entry is an implication written as anyOf [not IF, THEN], not as if/then: the OpenAPI reader this file is served through keeps if/then as unrecognized keywords, and this form it reads whole. First: interval, or raw: true, implies from and to. Second: at implies neither from nor to. src/Debyko.Dql.Docs/EndpointsPage.cs reads the first form to print `with interval/raw` in the required column.",
        "type": "object",
        "allOf": [
          {
            "anyOf": [
              {
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "interval"
                      ]
                    },
                    {
                      "required": [
                        "raw"
                      ],
                      "properties": {
                        "raw": {
                          "enum": [
                            true
                          ]
                        }
                      }
                    }
                  ]
                }
              },
              {
                "required": [
                  "from",
                  "to"
                ]
              }
            ]
          },
          {
            "anyOf": [
              {
                "not": {
                  "required": [
                    "at"
                  ]
                }
              },
              {
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "from"
                      ]
                    },
                    {
                      "required": [
                        "to"
                      ]
                    }
                  ]
                }
              }
            ]
          }
        ],
        "properties": {
          "where": {
            "$ref": "#/components/schemas/Selection"
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot",
              "all"
            ],
            "type": "string",
            "description": "Market kind to select. Defaults to perpetual, preserving the prior V2 selection. `all` includes spot and perpetual listings.",
            "default": "perpetual"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "What quantities are expressed in.",
            "default": "published"
          },
          "number_format": {
            "enum": [
              "json",
              "string"
            ],
            "type": "string",
            "description": "`string` returns every number as a string with the same digits.",
            "default": "json"
          },
          "include_synthetic": {
            "type": "boolean",
            "description": "Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra.",
            "default": false
          },
          "layers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnapshotLayer"
            },
            "description": "Which layers to read."
          },
          "interval": {
            "examples": [
              "1m",
              "1h"
            ],
            "type": "string",
            "description": "One row per period of this length, each holding the last reading in it."
          },
          "at": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An ISO-8601 UTC instant."
            },
            "description": "One row per instant, strictly ascending: what history had recorded as of it — the last stored reading visible then (a sampled reading counts from the end of its window, `history_cadence` on `/v2/instruments`). `from` and `to` are refused here. A live answer served at that instant can be newer, by up to one window."
          },
          "raw": {
            "type": "boolean",
            "description": "Every row as it arrived, unsampled.",
            "default": false
          },
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "Start of the window. Required with `interval` and `raw`; refused with `at`."
          },
          "to": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "End of the window. Required with `interval` and `raw`; refused with `at`."
          },
          "include_gaps": {
            "type": "boolean",
            "description": "Keep the rows that have no reading. Keeping them is the default because dropping them turns a gap into a shorter series.",
            "default": true
          },
          "summary": {
            "type": "boolean",
            "description": "With `interval`: answer one object per layer of each listing instead of its rows: the number of readings and, per numeric field, the min, max, first and last value, each as `[value, time]`, over `from`–`to`. No series. The readings are the interval's samples (the last reading of each period), so a finer `interval` finds a finer extreme: `1m` sees a one-minute spike that `1h` does not. `mode` is `summary`. Plan depth and x402 pricing are those of the same request without it.",
            "default": false
          },
          "fields": {
            "examples": [
              [
                "funding_8h"
              ]
            ],
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With `summary: true`: only these fields of the layers asked for (default: every numeric field). `[\"funding_8h\"]` is the one to compare venues' funding by: it restates every venue's rate on the 8 h basis."
          },
          "freshness": {
            "examples": [
              "30s"
            ],
            "type": "string",
            "description": "Override the freshness bound for every layer asked for."
          },
          "allow_stale": {
            "type": "boolean",
            "description": "ADR-025: return a stale value under `withheld` — never in the value field. Off by default: a stale value is not in the answer at all, only its status, reason and dates. For post-mortems; never feed `withheld` into a live decision.",
            "default": false
          }
        },
        "additionalProperties": false,
        "description": "The same snapshot as it stood in the past. Exactly one of `interval`, `at` and `raw: true` — they are three different questions: one row per period, one row per named instant, or every row as it arrived. `from` and `to` are required with `interval` and `raw`, and refused with `at`."
      },
      "HistoryResponse": {
        "required": [
          "evaluated_at",
          "settled",
          "items_sha256",
          "mode",
          "units",
          "freshness",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "settled": {
            "type": "boolean",
            "description": "Whether the window is far enough in the past that a late arrival can no longer change it."
          },
          "items_sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "SHA-256 of `items` as serialised."
          },
          "mode": {
            "enum": [
              "interval",
              "at",
              "raw",
              "summary"
            ],
            "type": "string",
            "description": "Which question was asked."
          },
          "interval": {
            "type": "string",
            "description": "The period, in `interval` mode."
          },
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "The window, in `interval` and `raw` modes. Absent in `at` mode."
          },
          "to": {
            "$ref": "#/components/schemas/NullableInstant"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "The unit mode applied."
          },
          "normalisation_version": {
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store.",
            "$ref": "#/components/schemas/NormalisationVersion"
          },
          "field_units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "In `summary` mode: what each field counts."
          },
          "freshness": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "null",
                "string"
              ]
            },
            "description": "ADR-025: the request's own bound per layer, or null where none was set — every value has its own horizon (`valid_until`) either way, and a bound only tightens it."
          },
          "listings_as_of": {
            "description": "When the set of listings was last known to change. Present when asking about the past.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "capabilities_as_of": {
            "description": "When what each venue publishes was last known to change.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryItem"
            },
            "description": "One object per listing."
          }
        },
        "additionalProperties": false,
        "description": "The snapshot as it stood in the past. `mode` says which of the three questions was asked, and the rows carry `bucket_end`, `at` or neither to match."
      },
      "HistoryRow": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "bucket_end": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The end of the period. Present in `interval` mode."
          },
          "at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The instant asked for. Present in `at` mode."
          },
          "status": {
            "enum": [
              "present",
              "stale",
              "missing",
              "not_published",
              "off",
              "gap"
            ],
            "type": "string",
            "description": "A snapshot's own words — `present`, `stale`, `missing`, `not_published`, `off` — and, in `interval` mode only, `gap`: a period the platform collected and holds no reading of (`at` mode never says it; a snapshot could not)."
          },
          "reason": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullReason"
              }
            ],
            "description": "Why there is no reading, in a snapshot's words (`policy_off` with `off`, `venue_capability` with `not_published`, `no_value` or `not_retained` with `missing`); a `gap` says `no_value`, or `collector_gap` when the platform recorded a hole there — then `gap_cause` says what."
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "In `at` mode, the age at the instant, as a snapshot reports it (C25-01: from `venue_ts` where the horizon counts from the venue's clock, from `received_at` otherwise)."
          },
          "venue_age_ms": {
            "description": "Age by venue time: milliseconds from `venue_ts` to the instant asked about, on the venue's clock whatever the anchor. Null when the venue sends no time. `age_ms` is the age the value is judged by.",
            "$ref": "#/components/schemas/VenueAgeMs"
          },
          "valid_until": {
            "description": "The instant after which the value is no longer current (UTC). At `valid_until` itself it is still current. Null while a push feed's connection is alive and when no cadence fact covers the value.",
            "$ref": "#/components/schemas/ValidUntil"
          },
          "horizon_source": {
            "description": "Where `valid_until` comes from: `venue_declared`, `measured`, `documented`, `assumed` or `connection`. Null when no cadence fact covers the value, which is then stale with reason `horizon_unknown`.",
            "$ref": "#/components/schemas/HorizonSource"
          },
          "anchor": {
            "description": "Which clock the age and the horizon count from: `venue` (the venue's own timestamp, where it sends one and it dates the publication) or `receipt` (`received_at`).",
            "$ref": "#/components/schemas/Anchor"
          },
          "gap_cause": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GapCause"
              }
            ],
            "description": "What the platform recorded about the hole this point lies in — with reason `collector_gap` in `interval` mode, and in `at` mode beside a `stale` or `missing` reading (over the freshness bound before the instant). In `at` mode it changes nothing else in the row: history knows it, a snapshot served then could not."
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "Mapping at this row's instant."
          },
          "base": {
            "type": [
              "null",
              "string"
            ],
            "description": "The base asset at this row's instant."
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing was quoted in at this row's instant."
          },
          "multiplier": {
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The venue's price multiplier at this row's instant, where it has one."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "`recorded`: the mapping interval was written after identity history began. `reconstructed`: the migration knew the listing's first observed time and its then-current mapping, not when any earlier change happened."
          },
          "identity_corrected_at": {
            "$ref": "#/components/schemas/Instant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Number"
                },
                {
                  "$ref": "#/components/schemas/Liquidity"
                }
              ]
            },
            "description": "The layer's fields at that point. The `book` and `venue_depth` layers also carry `liquidity`. In the `funding` layer `funding_cap`, `funding_floor` and `funding_at_cap` are judged against the bounds in force at the point's own time, never against a later one; a point older than the first observed bound has null for them (`not_retained`)."
          },
          "reasons": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/NullReason"
            },
            "description": "Why a value is null, by field."
          },
          "carried": {
            "const": "True",
            "type": "boolean",
            "description": "ADR-025, `interval` mode: the reading was received before this period and carried into it, because it lives on its connection (a push feed that sends only on change) and the connection was alive through the period. Absent on a reading observed in its period."
          },
          "withheld": {
            "type": "object",
            "description": "ADR-025, `at` mode: the values of a stale reading, only when the request set `allow_stale`."
          }
        },
        "additionalProperties": false,
        "description": "One point of one layer's history. In `at` mode it is the layer as history had recorded it as of that instant, in a snapshot's words — status, reason, `venue_ts`, `received_at`, `age_ms`, values and reasons, written as `/v2/snapshots` writes them; a live answer served then may show a newer reading of the window still open, by up to one window. In `interval` mode a period without a reading is a gap with its reason — never the previous value carried forward silently, which would invent a measurement that was not taken; the one exception (ADR-025) is a push feed that sends only on change, whose value is carried while its connection lives and says `carried: true`."
      },
      "HistorySummaryField": {
        "required": [
          "min",
          "max",
          "first",
          "last"
        ],
        "type": "object",
        "properties": {
          "min": {
            "$ref": "#/components/schemas/HistorySummaryPoint"
          },
          "max": {
            "$ref": "#/components/schemas/HistorySummaryPoint"
          },
          "first": {
            "$ref": "#/components/schemas/HistorySummaryPoint"
          },
          "last": {
            "$ref": "#/components/schemas/HistorySummaryPoint"
          },
          "n": {
            "minimum": 1,
            "type": "integer",
            "description": "Only when fewer than the layer's `n`."
          }
        },
        "additionalProperties": false,
        "description": "One field over the window: `[value, time]` of the reading (`venue_ts`, else `received_at`); the earliest wins a tie. Observed at the interval's samples, not settled."
      },
      "HistorySummaryLayer": {
        "required": [
          "status",
          "n"
        ],
        "type": "object",
        "properties": {
          "status": {
            "enum": [
              "present",
              "gap",
              "off",
              "not_published",
              "missing"
            ],
            "type": "string",
            "description": "`present`: at least one reading; otherwise what a row would say."
          },
          "reason": {
            "$ref": "#/components/schemas/NullReason"
          },
          "gap_cause": {
            "$ref": "#/components/schemas/GapCause"
          },
          "n": {
            "minimum": 0,
            "type": "integer",
            "description": "Readings in the window, each counted once."
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/HistorySummaryField"
            },
            "description": "Each numeric field that had a number in the window."
          },
          "reasons": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Why a field has no number in the window."
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Only where it differs from `field_units`."
          }
        },
        "additionalProperties": false,
        "description": "One layer of one listing in `summary` mode. With no reading in the window: its state and `n: 0`, never zeros."
      },
      "HistorySummaryPoint": {
        "maxItems": 2,
        "minItems": 2,
        "type": "array",
        "items": {
          "type": [
            "number",
            "string"
          ]
        },
        "description": "`[value, time]`."
      },
      "HorizonSource": {
        "enum": [
          "venue_declared",
          "measured",
          "documented",
          "assumed",
          "connection"
        ],
        "type": [
          "null",
          "string"
        ],
        "description": "ADR-025: where `valid_until` comes from. `venue_declared` — the venue said when the next value comes (a settled rate and the interval it publishes with it); `measured` — a cadence the platform measured; `documented` — the venue's documentation; `assumed` — a cadence the platform assumes (a published fact, listed in the Freshness section); `connection` — the value holds while the connection that delivered it is alive (a push feed that sends only on change). Null when no cadence fact covers the value: it is then stale, `horizon_unknown`."
      },
      "HotWindow": {
        "required": [
          "hot_days",
          "reads_days",
          "archive_since"
        ],
        "type": "object",
        "properties": {
          "hot_days": {
            "type": "integer",
            "description": "Days the database holds it: the shortest class of any collected listing."
          },
          "hot_days_longest": {
            "type": "integer",
            "description": "The longest class of any collected listing, present only where listings differ."
          },
          "reads_days": {
            "type": "integer",
            "description": "Days of it this plan reads: the smaller of `hot_days` and the plan's own cap (Free and Mini keep theirs)."
          },
          "archive_since": {
            "type": [
              "null",
              "string"
            ],
            "description": "The first UTC day with a verified archive file for the layer (`GET /v2/archive/{listing}/{layer}/{day}`); null when the archive does not hold the layer.",
            "format": "date"
          }
        },
        "additionalProperties": false,
        "description": "One layer or candle timeframe."
      },
      "Instant": {
        "examples": [
          "2026-09-23T12:00:05Z",
          "2026-09-23T12:00:05.250Z"
        ],
        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{3})?Z$",
        "type": "string",
        "description": "An instant, ISO-8601, always UTC, with milliseconds only when they are not zero. Every instant the platform prints has this shape."
      },
      "InstrumentsResponse": {
        "required": [
          "evaluated_at",
          "as_of",
          "catalogue",
          "units",
          "registry_revision",
          "next_cursor",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "registry_revision": {
            "type": "string",
            "description": "Stable registry snapshot identity shared by all pages: the UTC Snapshot.ReadAt timestamp, a dot, and the lowercase SHA-256 digest of the effective registry row, identity, policy, and catalogue-version projection."
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Opaque continuation cursor for the next page. Null means this is the last page. Keep all other request options unchanged; a stale cursor or changed scope returns `DQL_CURSOR` and requires restarting from the first page."
          },
          "as_of": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The instant the answer describes: the moment of the request, or the `as_of` it asked for."
          },
          "catalogue": {
            "type": "string",
            "description": "The catalogue version the answer was built against."
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "The unit mode applied."
          },
          "normalisation_version": {
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store.",
            "$ref": "#/components/schemas/NormalisationVersion"
          },
          "listings_as_of": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "When the listing set itself was last known to change. Present when asking about the past."
          },
          "capabilities_as_of": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "When what each venue publishes was last known to change."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Listing"
            },
            "description": "The listings, one object each."
          }
        },
        "additionalProperties": false,
        "description": "A bounded page of selected listings at the instant asked about — mapped or not. Follow `next_cursor` until null to read the complete catalogue. No key: what exists is not a paid fact."
      },
      "LayerPolicy": {
        "required": [
          "policy",
          "cadence"
        ],
        "type": "object",
        "properties": {
          "policy": {
            "enum": [
              "on",
              "off",
              "not_published"
            ],
            "type": "string",
            "description": "`on` when collected, `off` when the listing's group does not collect it, `not_published` when the venue does not publish it at all. `off` is a choice and can change; `not_published` is a fact about the venue."
          },
          "cadence": {
            "examples": [
              "1s",
              "8h"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "How often the venue publishes it, when it says."
          },
          "history_cadence": {
            "enum": [
              "1s",
              "10s",
              "15s",
              "1m"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "How often history keeps a value of it for this listing (C6-07). History holds the last value of every window of this length: the listing's policy cadence, or the stored bucket when that is longer (funding is kept per ten seconds, so it says `10s` at a one-second cadence). The set is closed and grows by migration: `1s`, `10s`, `15s` (the top-100 group's slow layers and the tail's ticker, 2026-10-01) and `1m` (the tail). It is also the most a live answer can be ahead of history. Every tick stays in the live answers whatever this says. `null` when the layer is not kept in history or is not sampled at all (`candles`, `trades` and `liquidations` keep every event). Absent in answers from before C6-07."
          },
          "horizon": {
            "type": [
              "null",
              "object"
            ],
            "properties": {
              "mode": {
                "enum": [
                  "poll",
                  "stream",
                  "on_change",
                  "on_change_hb",
                  "settle",
                  "derived"
                ],
                "type": "string",
                "description": "How the layer's values arrive: `poll` (read on a clock), `stream` (pushed by the venue), `on_change` (pushed only when the value changes), `on_change_hb` (pushed on change, with a heartbeat), `settle` (set at a settlement, so the interval is the listing's own) or `derived` (computed from another layer, `derived_from`)."
              },
              "interval": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The interval the cadence fact states, as a duration such as `60s`; null where the mode has none (a value pushed only on change, or one set at a settlement)."
              },
              "label": {
                "enum": [
                  "documented",
                  "measured",
                  "assumed"
                ],
                "type": "string",
                "description": "What the cadence rests on: `documented` (the venue's documentation), `measured` (a cadence the platform measured) or `assumed` (a cadence the platform assumes, published as such)."
              },
              "source_time": {
                "enum": [
                  "publication",
                  "settlement",
                  "none"
                ],
                "type": "string",
                "description": "What the venue's own timestamp dates: `publication` (when the value was published), `settlement` (the settlement it belongs to) or `none` (the venue sends no time)."
              },
              "derived_from": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "For a `derived` layer, the layer it is computed from; otherwise null."
              },
              "effective_from": {
                "description": "The instant this cadence fact took effect.",
                "$ref": "#/components/schemas/NullableInstant"
              },
              "evidence": {
                "type": "string",
                "description": "What the fact rests on, in words."
              }
            },
            "additionalProperties": false,
            "description": "ADR-025: the cadence fact the horizon of this layer's values is computed from, as known at the instant asked about: `mode` (`poll`, `stream`, `on_change`, `on_change_hb`, `settle`, `derived`), `interval`, `label` (`documented`, `measured`, `assumed`), what the venue's own timestamp dates (`source_time`: `publication`, `settlement`, `none`), `derived_from`, `effective_from` and the `evidence`. Null when no fact covers it: every value of the layer is then stale, `horizon_unknown`. Absent on candles, trades and liquidations, and in answers from before ADR-025."
          }
        },
        "additionalProperties": false,
        "description": "Whether the platform collects a layer for this listing, and how often the venue publishes it."
      },
      "LayerReading": {
        "required": [
          "status",
          "venue_ts",
          "received_at",
          "values"
        ],
        "type": "object",
        "properties": {
          "status": {
            "description": "Whether the value is current: `present`, `stale`, `missing`, `not_published` or `off`. Only a `present` value comes with a number. A stale value is withheld, and a missing, unpublished or switched-off one has none, so a value that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Status"
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The value's age at the instant asked about, in milliseconds (C25-01: one definition of age): from `venue_ts` where its horizon counts from the venue's clock (`anchor: venue`), from `received_at` otherwise."
          },
          "venue_age_ms": {
            "description": "Age by venue time: milliseconds from `venue_ts` to the instant asked about, on the venue's clock whatever the anchor. Null when the venue sends no time. `age_ms` is the age the value is judged by.",
            "$ref": "#/components/schemas/VenueAgeMs"
          },
          "valid_until": {
            "description": "The instant after which the value is no longer current (UTC). At `valid_until` itself it is still current. Null while a push feed's connection is alive and when no cadence fact covers the value.",
            "$ref": "#/components/schemas/ValidUntil"
          },
          "horizon_source": {
            "description": "Where `valid_until` comes from: `venue_declared`, `measured`, `documented`, `assumed` or `connection`. Null when no cadence fact covers the value, which is then stale with reason `horizon_unknown`.",
            "$ref": "#/components/schemas/HorizonSource"
          },
          "anchor": {
            "description": "Which clock the age and the horizon count from: `venue` (the venue's own timestamp, where it sends one and it dates the publication) or `receipt` (`received_at`).",
            "$ref": "#/components/schemas/Anchor"
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Number"
                },
                {
                  "$ref": "#/components/schemas/Liquidity"
                }
              ]
            },
            "description": "The layer's fields. The `book` and `venue_depth` layers also carry `liquidity`. The `funding` layer carries the venue's rate (`funding`, as the venue published it, for the listing's own `funding_interval`) and `funding_8h`, the same rate restated over 8 hours: `funding` × 8 h / `funding_interval`, or, on a venue that accrues funding continuously, `funding` × the number of rate periods in 8 hours (8 per hour, 28 800 per second); null where the registry holds no interval or unit for the listing. Beside them are `funding_cap` and `funding_floor` (the venue's published bounds of the rate, in force at the rate's own time), their 8-hour restatements `funding_cap_8h` and `funding_floor_8h`, and `funding_at_cap`: true when the rate sits on a bound, false when it is between two known bounds, null when no bound was observed by then."
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "What each value counts. Present only where a value has a unit."
          },
          "reasons": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/NullReason"
            },
            "description": "Why a value is null, by field. Present only where one is."
          },
          "raw": {
            "type": [
              "null",
              "object"
            ],
            "description": "The venue's message as received, when the request asked for `include_raw`; null otherwise."
          },
          "withheld": {
            "type": "object",
            "description": "ADR-025: the values of a stale reading, only when the request set `allow_stale` — `values` is then empty. Same shape as the layer's own `values`, `units` and `reasons`."
          }
        },
        "additionalProperties": false,
        "description": "One layer as it stood at the instant asked about: what was received, when, how old it was, and whether that made it usable."
      },
      "Liquidation": {
        "required": [
          "event_time",
          "price",
          "size",
          "side",
          "venue_uid",
          "received_at"
        ],
        "type": "object",
        "properties": {
          "event_time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The venue's time of the liquidation; the instant the platform received it only where the venue sent none."
          },
          "price": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The price of the forced order, in the quote currency."
          },
          "size": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The quantity of the forced order, in the unit named by the item's `units.size`."
          },
          "side": {
            "enum": [
              "buy",
              "sell"
            ],
            "type": "string",
            "description": "The side of the forced order as the venue reports it: `buy` closes a short position, `sell` closes a long one. A venue that states the closed position instead is translated by its adapter and says so in its card. This is the venue's word for an order in a data row, not an instruction."
          },
          "venue_uid": {
            "type": [
              "null",
              "string"
            ],
            "description": "The venue's own id of the event, where it sends one."
          },
          "received_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "When the platform received it."
          }
        },
        "additionalProperties": false,
        "description": "One forced closure exactly as the venue published it, digits as stored. Nothing is synthesised: a venue that sends no id of the event has `venue_uid: null`, and the platform never makes one up."
      },
      "LiquidationGap": {
        "required": [
          "from",
          "to",
          "reason"
        ],
        "type": "object",
        "properties": {
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "Where the stretch begins, not before the window's own start."
          },
          "to": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "Where it ends, not after the window's own end; null for a recorded hole whose end was never recorded."
          },
          "reason": {
            "enum": [
              "not_retained",
              "collector_gap"
            ],
            "type": "string",
            "description": "`not_retained`: older than what is kept for this listing (`retention_from`). `collector_gap`: the platform recorded a hole that lost events; `gap_cause` says what."
          },
          "gap_cause": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GapCause"
              }
            ],
            "description": "With reason `collector_gap`: what the platform recorded. A `state_lag` is never one: State's projection fell behind, the stored history did not."
          }
        },
        "additionalProperties": false,
        "description": "A stretch of the window in which the list is known to be incomplete — written out rather than left as a quiet stretch, so that a window with no event in it is never read as a window in which none happened."
      },
      "LiquidationItem": {
        "required": [
          "instrument",
          "venue",
          "venue_symbol",
          "quote",
          "status",
          "retention_from",
          "units",
          "truncated",
          "events",
          "gaps"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when this listing maps to no instrument — and then `reason` says why."
          },
          "reason": {
            "$ref": "#/components/schemas/NullReason"
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "venue_symbol": {
            "type": "string",
            "description": "The venue's own symbol."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "Mapping recorded after deployment or reconstructed from the pre-deployment cache."
          },
          "identity_corrected_at": {
            "description": "Start of the next mapping interval for this listing, when one exists.",
            "$ref": "#/components/schemas/Instant"
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot"
            ],
            "type": "string",
            "description": "The market kind of this listing. Added with change set 37; absent from earlier responses."
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Status"
              }
            ],
            "description": "`present` when the platform keeps this listing's liquidations and the venue publishes them — with no event in the window too, which is an empty `events`, never `missing`. `off`: the listing's group does not keep them. `not_published`: the venue publishes none. `missing`: the listing has no stored history to read."
          },
          "retention_from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "The earliest instant liquidations are kept for this listing: the later of the oldest week its retention class holds and the moment that class was last raised for it."
          },
          "units": {
            "required": [
              "price",
              "size"
            ],
            "type": "object",
            "properties": {
              "price": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The unit of `price`."
              },
              "size": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The unit of `size`."
              }
            },
            "additionalProperties": false,
            "description": "What the numbers count."
          },
          "truncated": {
            "type": "boolean",
            "description": "Whether the window held more events than `limit`; the events shown are then the newest."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Liquidation"
            },
            "description": "Ascending by `event_time`, each event once — a message the platform received twice, or an id a venue sent twice, is one."
          },
          "gaps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LiquidationGap"
            },
            "description": "Where the list is known to be incomplete. Empty does not prove completeness: only what was recorded is written."
          }
        },
        "additionalProperties": false,
        "description": "One listing's liquidations over the window asked for."
      },
      "LiquidationsRequest": {
        "type": "object",
        "properties": {
          "where": {
            "$ref": "#/components/schemas/Selection"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "What quantities are expressed in.",
            "default": "published"
          },
          "number_format": {
            "enum": [
              "json",
              "string"
            ],
            "type": "string",
            "description": "`string` returns every number as a string with the same digits.",
            "default": "json"
          },
          "include_synthetic": {
            "type": "boolean",
            "description": "Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra.",
            "default": false
          },
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The start of the window, exclusive. Without it: an hour before `to`, or as far back as the key's plan reads when that is less. At most a week before `to`."
          },
          "to": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The end of the event window, inclusive. Without it, or later than the availability cutoff: the cutoff (as_of, or now)."
          },
          "limit": {
            "maximum": 1000,
            "minimum": 1,
            "type": "integer",
            "description": "The newest events of each listing to return. When there were more in the window, `truncated` is true on its item and the events shown are the newest.",
            "default": 1000
          },
          "include_gaps": {
            "type": "boolean",
            "description": "Write out, per listing, where the feed is known to be incomplete (`gaps`).",
            "default": true
          },
          "as_of": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "Receipt-time availability cutoff. from/to bound event times; as_of bounds when events were received. Defaults to now; future cutoffs are refused."
          }
        },
        "additionalProperties": false,
        "description": "The liquidations the venues published for the selected listings, one by one, in a window."
      },
      "LiquidationsResponse": {
        "required": [
          "evaluated_at",
          "settled",
          "items_sha256",
          "from",
          "to",
          "units",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `to`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "settled": {
            "type": "boolean",
            "description": "Whether the window is far enough in the past, and written far enough, that a late arrival can no longer change it."
          },
          "items_sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "SHA-256 of `items` as serialised. Two answers with the same hash are the same answer, which is how a client can skip work rather than re-parse."
          },
          "from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The start of the window actually read (exclusive)."
          },
          "to": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "The end of the window actually read (inclusive)."
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "The unit mode applied."
          },
          "normalisation_version": {
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store.",
            "$ref": "#/components/schemas/NormalisationVersion"
          },
          "listings_as_of": {
            "description": "When the set of listings was last known to change. Present when asking about the past.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "capabilities_as_of": {
            "description": "When what each venue publishes was last known to change.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LiquidationItem"
            },
            "description": "One object per listing."
          },
          "data_as_of": {
            "description": "The explicit receipt-time availability cutoff; present when as_of was requested.",
            "$ref": "#/components/schemas/Instant"
          }
        },
        "additionalProperties": false,
        "description": "The liquidations of the selected listings in a window."
      },
      "Liquidity": {
        "required": [
          "reference",
          "status",
          "venue_ts",
          "received_at",
          "bands",
          "levels_received",
          "units"
        ],
        "type": "object",
        "properties": {
          "reference": {
            "enum": [
              "mid",
              "venue"
            ],
            "type": "string",
            "description": "The price the bands are measured from. `mid` on the `book` layer, which the platform computed from the levels it received. `venue` on `venue_depth`, where the venue published the figures and its own reference is stated in its venue card — the platform will not restate it as ours."
          },
          "status": {
            "description": "Whether the value is current: `present`, `stale`, `missing`, `not_published` or `off`. Only a `present` value comes with a number. A stale value is withheld, and a missing, unpublished or switched-off one has none, so a value that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Status"
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The value's age at the instant asked about, in milliseconds (C25-01: one definition of age): from `venue_ts` where its horizon counts from the venue's clock (`anchor: venue`), from `received_at` otherwise."
          },
          "venue_age_ms": {
            "description": "Age by venue time: milliseconds from `venue_ts` to the instant asked about, on the venue's clock whatever the anchor. Null when the venue sends no time. `age_ms` is the age the value is judged by.",
            "$ref": "#/components/schemas/VenueAgeMs"
          },
          "valid_until": {
            "description": "The instant after which the value is no longer current (UTC). At `valid_until` itself it is still current. Null while a push feed's connection is alive and when no cadence fact covers the value.",
            "$ref": "#/components/schemas/ValidUntil"
          },
          "horizon_source": {
            "description": "Where `valid_until` comes from: `venue_declared`, `measured`, `documented`, `assumed` or `connection`. Null when no cadence fact covers the value, which is then stale with reason `horizon_unknown`.",
            "$ref": "#/components/schemas/HorizonSource"
          },
          "anchor": {
            "description": "Which clock the age and the horizon count from: `venue` (the venue's own timestamp, where it sends one and it dates the publication) or `receipt` (`received_at`).",
            "$ref": "#/components/schemas/Anchor"
          },
          "bands": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Band"
            },
            "description": "One entry per band of the platform's set, keyed by the band."
          },
          "coverage_bps": {
            "type": "object",
            "properties": {
              "bid": {
                "type": [
                  "null",
                  "number"
                ],
                "description": "How far below the mid the bid side reaches, in bps."
              },
              "ask": {
                "type": [
                  "null",
                  "number"
                ],
                "description": "How far above the mid the ask side reaches, in bps."
              }
            },
            "additionalProperties": false,
            "description": "Only on a `book` whose depth is a window the platform keeps (Binance USD-M's core listings: a REST snapshot of the book and the diff stream, where levels beyond the snapshot's edge that never change are never sent): how far each side reaches from the mid, in basis points. Bands whose edge is inside it are exact to the last update; a band beyond it is null with `partial_coverage`, never the sum of the part that is known. Absent on a book that has no window."
          },
          "levels_received": {
            "required": [
              "bid",
              "ask"
            ],
            "type": "object",
            "properties": {
              "bid": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Bid levels received."
              },
              "ask": {
                "type": [
                  "null",
                  "integer"
                ],
                "description": "Ask levels received."
              }
            },
            "additionalProperties": false,
            "description": "How many levels the received book had, before any band was measured."
          },
          "units": {
            "required": [
              "qty",
              "value"
            ],
            "type": "object",
            "properties": {
              "qty": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The unit of every `*_qty`."
              },
              "value": {
                "const": "quote",
                "type": "string",
                "description": "The unit of every `*_value`."
              }
            },
            "additionalProperties": false,
            "description": "What the band figures count."
          },
          "withheld": {
            "type": "object",
            "description": "ADR-025: the bands of a stale observation, only when the request set `allow_stale` — `bands` is then empty."
          }
        },
        "additionalProperties": false,
        "description": "Depth in bands, dated by its own observation rather than by the ticker's — the two arrive separately and pretending otherwise would overstate how fresh the depth is. It appears on two layers that must not be confused: `book`, which the platform measured from levels the venue sent, and `venue_depth`, which is what the venue itself asserted. A venue may answer on one, the other, both or neither, and where both answer they are allowed to disagree — they are different measurements."
      },
      "Listing": {
        "required": [
          "instrument",
          "venue",
          "venue_symbol",
          "base",
          "base_venue_alias",
          "quote",
          "kind",
          "venue_kind",
          "pair",
          "status",
          "post_only",
          "contract_size",
          "multiplier",
          "tick_size",
          "lot_size",
          "min_qty",
          "min_notional",
          "price_decimals",
          "qty_decimals",
          "units",
          "funding_interval",
          "funding_normalisation",
          "rules_normalisation",
          "candles",
          "layers",
          "not_published",
          "bands",
          "listed_at",
          "first_seen_at",
          "delisted_at",
          "venue_ts",
          "received_at",
          "age_ms"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code for what this listing is. Null when the listing is mapped to no instrument, and then `reason` says why — an unmapped listing is shown rather than hidden."
          },
          "reason": {
            "type": "string",
            "description": "Why the listing is mapped to no instrument. Present only when `instrument` is null."
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "venue_symbol": {
            "examples": [
              "PF_XBTUSD",
              "BTC-USDT-SWAP"
            ],
            "type": "string",
            "description": "The venue's own symbol, spelled as the venue spells it. This is what you send to the venue; `instrument` is what you send to DQL."
          },
          "dex": {
            "examples": [
              "xyz",
              "hyna"
            ],
            "type": "string",
            "description": "The builder-deployed perpetual dex (Hyperliquid HIP-3) the listing trades on, as its `venue_symbol` prefix spells it (`xyz` for `xyz:GOLD`). Present only for such a listing; a main-dex listing has none. The same base on two dexes is two listings of one venue, told apart by this field and the `quote` the dex's collateral sets."
          },
          "base": {
            "type": [
              "null",
              "string"
            ],
            "description": "The base asset."
          },
          "base_venue_alias": {
            "type": [
              "null",
              "string"
            ],
            "description": "The venue's own name for the base asset, when it differs from the platform's."
          },
          "renamed_from": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RenamedFrom"
              }
            ],
            "description": "Present only for 90 days after the platform renamed the listing's instrument — a venue's thousand-fold listing (`1000PEPE-PERP`, `kPEPE-PERP`) moved to the bare market (`PEPE-PERP`). The old name and the instant of the rename; `GET /v2/instruments?renamed_from=1000PEPE-PERP` finds the listings that carried it. DQL has no alias: the old name cannot be written in `where`."
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "kind": {
            "examples": [
              "perpetual"
            ],
            "enum": [
              "perpetual",
              "spot"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "The actual market kind of this listing: `perpetual` or `spot`."
          },
          "venue_kind": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the venue calls it."
          },
          "collection_group": {
            "type": [
              "null",
              "string"
            ],
            "description": "The storage-policy group for this listing, or null when it has no group. Optional until C37 metadata is deployed."
          },
          "collected": {
            "type": "boolean",
            "description": "Whether at least one dataset is enabled for collection. Optional until C37 metadata is deployed."
          },
          "datasets": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ListingDatasetPolicy"
            },
            "description": "Current policy and venue capability for each canonical dataset. Optional until C37 metadata is deployed."
          },
          "pair": {
            "type": [
              "null",
              "string"
            ],
            "description": "The venue's pair name, where it has one apart from the symbol."
          },
          "status": {
            "enum": [
              "tradeable",
              "halted",
              "delisted"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "`tradeable`, `halted` when the venue says it is not tradeable, `delisted` after it goes. Null when the venue does not say."
          },
          "post_only": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether the venue accepts only post-only orders here."
          },
          "contract_size": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "How much of the base one contract is."
          },
          "multiplier": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The venue's price multiplier, where it has one."
          },
          "tick_size": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The smallest price step. Null when it cannot be expressed in the units asked for."
          },
          "lot_size": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The smallest quantity step."
          },
          "min_qty": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The smallest order quantity."
          },
          "min_notional": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "The smallest order value, in the quote currency."
          },
          "price_decimals": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many decimals the venue prints prices to."
          },
          "qty_decimals": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many decimals the venue prints quantities to."
          },
          "units": {
            "$ref": "#/components/schemas/ContractUnits"
          },
          "funding_interval": {
            "examples": [
              "1h",
              "8h"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "How often funding settles here: the interval the venue's funding rate on this listing is published for, as the registry holds it (`1h`, `4h`, `8h`, ...), and the base of `funding_8h` (the rate × 8 h / `funding_interval`). From the venue's data where the venue publishes it, from the venue's documentation where it does not (then `funding_interval_source` says where). Null with `funding_interval_reason` where there is none."
          },
          "funding_interval_reason": {
            "examples": [
              "venue_capability",
              "funding_continuous"
            ],
            "type": "string",
            "description": "Why the interval is unknown. Present only when it is: `venue_capability`, or `funding_continuous` on a venue that accrues funding continuously and never settles."
          },
          "funding_interval_source": {
            "type": "string",
            "description": "Where the interval came from when the venue does not publish it in its data — its documentation, for instance. Present only then, because a documented constant is a weaker fact than a measured one and should not pass for it."
          },
          "funding_cap": {
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The highest funding rate the venue lets a settlement of this listing take, as the venue's API publishes it, in the unit of `funding` (a fraction for the listing's own `funding_interval`): the cap in force at the instant of the answer. Null with `funding_cap_reason` where the venue's API publishes none (`venue_capability`), or none has been observed yet (`not_retained`, `no_value`). A cap the venue documents only in prose is not stored."
          },
          "funding_floor": {
            "type": [
              "null",
              "number",
              "string"
            ],
            "description": "The lowest funding rate the venue lets a settlement of this listing take, as published, for the same interval and instant as `funding_cap`. Null for the same reasons, or where the venue publishes a cap and no floor."
          },
          "funding_cap_reason": {
            "examples": [
              "venue_capability",
              "not_retained",
              "no_value"
            ],
            "type": "string",
            "description": "Why `funding_cap` is null: `venue_capability` (the venue's API publishes no cap), `not_retained` (it publishes one and none was observed by the instant asked about) or `no_value` (not collected yet, or not resolved). Present only when the cap is null."
          },
          "funding_cap_observed_at": {
            "description": "When the platform received the observation `funding_cap` and `funding_floor` come from. A cap holds from this instant until the next observation; a funding value older than the first observation is never judged against it.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "funding_rate_unit": {
            "examples": [
              "per_hour",
              "per_second"
            ],
            "type": [
              "null",
              "string"
            ],
            "description": "On a venue that accrues funding continuously (`funding_interval` null, `funding_continuous`): the period its published rate is per, from the registry. `funding_8h` is the rate times the number of such periods in eight hours (8 per hour, 28 800 per second). Null where the registry holds none: then `funding_8h` is null too. Present only on such a venue."
          },
          "funding_rate_unit_source": {
            "type": "string",
            "description": "Where `funding_rate_unit` comes from: the venue's document and the check behind it. Present with the unit."
          },
          "funding_normalisation": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Normalisation"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the venue's funding figure became the platform's: the venue's own field and what was done to it. The rate is stored as the venue published it (`identity`); `funding_8h` is derived from it and the interval, never the other way round. Null when none was needed."
          },
          "rules_normalisation": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Normalisation"
            },
            "description": "The same, per contract rule."
          },
          "candles": {
            "$ref": "#/components/schemas/ListingCandles"
          },
          "layers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/LayerPolicy"
            },
            "description": "What is collected for this listing, layer by layer, plus `book_bands`."
          },
          "not_published": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every field this venue does not publish. Asking for one gives null with reason `venue_capability`."
          },
          "bands": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The price bands the depth functions can be asked for here."
          },
          "listed_at": {
            "$ref": "#/components/schemas/NullableInstant"
          },
          "first_seen_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "When the platform first saw this listing."
          },
          "delisted_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "When it went, if it has. Null while it is live."
          },
          "venue_ts": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "The venue's own timestamp on the instrument record."
          },
          "received_at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "When the platform received it."
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Milliseconds between `received_at` and the instant asked about."
          },
          "raw": {
            "type": [
              "null",
              "object"
            ],
            "description": "The venue's instrument object exactly as received. Present only when the request asked for `include_raw`; null when nothing was stored."
          }
        },
        "additionalProperties": false,
        "description": "One venue's listing of one instrument: how the venue names it, the rules it trades under, what the platform collects for it, and when it was last heard from."
      },
      "ListingCandles": {
        "required": [
          "base_timeframe",
          "price_types",
          "timeframes"
        ],
        "type": "object",
        "properties": {
          "base_timeframe": {
            "const": "1m",
            "type": "string",
            "description": "The period the platform stores and rolls every other period up from."
          },
          "price_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Which prices this venue publishes candles of. A venue missing from a price type here answers `not_published`, not zero."
          },
          "timeframes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every period that can be asked for."
          }
        },
        "additionalProperties": false,
        "description": "What candles exist for this listing."
      },
      "ListingDatasetPolicy": {
        "required": [
          "live",
          "hot",
          "cold",
          "publishes"
        ],
        "type": "object",
        "properties": {
          "live": {
            "enum": [
              "off",
              "on"
            ],
            "type": "string",
            "description": "`on` when the dataset is collected live for this listing, `off` when its group does not collect it."
          },
          "hot": {
            "enum": [
              "off",
              "1h",
              "4h",
              "24h",
              "48h",
              "—"
            ],
            "type": "string",
            "description": "How long it is kept in the fast store: `off`, or a duration such as `24h`; `—` where the dataset has none."
          },
          "cold": {
            "enum": [
              "off",
              "3d",
              "7d",
              "1w",
              "1mo",
              "6mo",
              "1y",
              "2y",
              "5y",
              "10y",
              "—"
            ],
            "type": "string",
            "description": "How long it is kept in the long-term store: `off`, or a duration such as `1y`; `—` where the dataset has none."
          },
          "publishes": {
            "type": "boolean",
            "description": "Whether the venue publishes the dataset at all. False is a fact about the venue (`not_published`), not a choice of the platform."
          }
        },
        "additionalProperties": false,
        "description": "Whether the platform collects one dataset for this listing and how long it keeps it."
      },
      "MarketEnvelope": {
        "required": [
          "schemaVersion",
          "segment",
          "symbol",
          "kind",
          "generation",
          "sequence",
          "instanceId",
          "receivedAt",
          "sourceTime",
          "transport",
          "data"
        ],
        "type": "object",
        "properties": {
          "schemaVersion": {
            "const": "1",
            "type": "integer",
            "description": "The version of the envelope's form."
          },
          "segment": {
            "type": "string",
            "description": "The synthetic segment the event belongs to."
          },
          "symbol": {
            "type": [
              "null",
              "string"
            ],
            "description": "The listing's symbol; null for a health, gap or catalogue event, which belongs to the segment."
          },
          "kind": {
            "type": "string",
            "description": "What the event is: a kind of observation (for example a trade, a candle or a liquidation), a gap or a health message."
          },
          "generation": {
            "type": "integer",
            "description": "The connector generation. Events are ordered by `generation` and `sequence`, never by `receivedAt`."
          },
          "sequence": {
            "type": "integer",
            "description": "The position of the event within its generation."
          },
          "venueSequence": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The venue's own sequence number for the event, where the venue carries one."
          },
          "instanceId": {
            "type": "string",
            "description": "The connector instance that produced the event.",
            "format": "uuid"
          },
          "receivedAt": {
            "description": "Received time: when the platform received the event.",
            "$ref": "#/components/schemas/Instant"
          },
          "sourceTime": {
            "type": [
              "null",
              "string"
            ],
            "description": "Venue time: the timestamp the venue put on the event; null where it sends none.",
            "format": "date-time"
          },
          "transport": {
            "type": "string",
            "description": "How the event arrived: `ws`, `rest` or `internal`."
          },
          "data": {
            "type": "object",
            "description": "The observation itself; its shape follows `kind`."
          },
          "origin": {
            "type": [
              "null",
              "string"
            ],
            "description": "Absent for a live event; `backfill` or `replay` otherwise."
          },
          "cadence": {
            "type": [
              "null",
              "string"
            ],
            "description": "The cadence window this event is the last value of; absent on a live tick."
          }
        },
        "description": "Canonical raw envelope passed through the synthetic-only `/v2/events/stream`; the `data` object is kind-specific and is forwarded unchanged."
      },
      "MarketKindSelector": {
        "enum": [
          "perpetual",
          "spot",
          "all"
        ],
        "type": "string",
        "description": "Market kind to select. The default preserves the prior V2 selection scope.",
        "default": "perpetual"
      },
      "Normalisation": {
        "required": [
          "venue_field",
          "transform"
        ],
        "type": "object",
        "properties": {
          "venue_field": {
            "type": "string",
            "description": "The venue's own field name."
          },
          "transform": {
            "examples": [
              "identity",
              "rate / interval_hours * 8"
            ],
            "type": "string",
            "description": "What was done to it."
          }
        },
        "additionalProperties": false,
        "description": "How a venue's own field was turned into the platform's. Published so a reader can check the arithmetic rather than trust it — and so a number that looks wrong can be traced back to what the venue actually sent."
      },
      "NormalisationVersion": {
        "examples": [
          "2026-10-07"
        ],
        "type": "string",
        "description": "Which conversion rules produced the figures of this answer, present only when it applied `units: base`: the date the rules took their shape, such as `2026-10-07`. It changes with any change to how a quantity or a price is converted to the base asset, or to how a listing's contract size and multiplier are chosen, and with nothing else. Store it beside numbers you keep: two figures under different versions were converted by different rules. A correction of one listing's own contract size is not a change of the rules; that figure is in `GET /v2/instruments` (`contract_size`, `multiplier`)."
      },
      "NotListed": {
        "required": [
          "instrument",
          "venue",
          "reason"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "The instrument asked for."
          },
          "venue": {
            "type": "string",
            "description": "The venue asked for."
          },
          "reason": {
            "enum": [
              "not_listed"
            ],
            "type": "string",
            "description": "Why there is nothing: `not_listed` means no venue lists the instrument there."
          }
        },
        "additionalProperties": false,
        "description": "An instrument and venue that were asked for and do not exist together. Returned rather than dropped: a client that asked for a pair it will never get should be told so, not left to infer it from a short answer."
      },
      "NullReason": {
        "enum": [
          "not_retained",
          "gap",
          "insufficient_history",
          "reference_not_listed",
          "policy_off",
          "venue_capability",
          "no_value",
          "band_truncated",
          "partial_coverage",
          "unit_unknown",
          "unmapped",
          "funding_continuous",
          "collector_gap",
          "horizon_passed",
          "connection_lost",
          "state_lag",
          "source_error",
          "horizon_unknown",
          "freshness_bound",
          "halted",
          "no_update",
          "not_in_scope",
          "no_venues"
        ],
        "type": "string",
        "description": "Why the value is null — or, with status `stale`, why it is stale (ADR-025: `horizon_passed` — no new value within its horizon; `connection_lost` — the connection that delivered it was recorded lost; `state_lag` — the platform's own live projection lagged, not the venue; `source_error` — the venue refused our requests for the layer (an error status, not a rate limit) since the value arrived; `horizon_unknown` — no cadence fact covers it; `freshness_bound` — older than the request's own bound; `halted` — the venue said it does not trade the listing at that instant: its figures are the venue's last, not a market; `no_update` — it is pushed only on change, its connection is alive, and it has not changed for longer than its pair's no-update threshold). `reference_not_listed` — corr/beta: the reference instrument has no listing on the venue it is read on. `not_in_scope` — ref (change set 34): the instrument it reads is not listed on that venue at the instant, is halted there, or a layer its expression reads is `off` or `not_published` for that listing. `no_venues` — a quantifier or aggregate had no listing left in its scope (`venues_in_scope` 0), so its value is unknown. Informative, never queryable: a query cannot branch on a reason."
      },
      "NullableInstant": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/Instant"
          },
          {
            "type": "null"
          }
        ],
        "description": "An instant, or null when there is none to state."
      },
      "Number": {
        "type": [
          "null",
          "boolean",
          "number",
          "string"
        ],
        "description": "A measured or computed value. A number by default; a string with the same digits when the request asked for `number_format: string`, which is how a client keeps digits a double would round. Booleans occur where the language's value is a truth, null where there is no value — and then the object carries a `reason`."
      },
      "OperationalBudget": {
        "required": [
          "ceiling_requests_per_second",
          "ceiling_max_concurrent",
          "effective_requests_per_second",
          "requests_sent",
          "observed_requests_per_second",
          "in_flight",
          "p50_latency_ms",
          "p95_latency_ms",
          "rate_limited_count",
          "other_failure_count",
          "throttle_wait_ms",
          "state",
          "weight_ceiling_per_minute",
          "weight_used_per_minute",
          "concurrency_wait_ms"
        ],
        "type": "object",
        "properties": {
          "ceiling_requests_per_second": {
            "type": "integer",
            "description": "The ceiling on requests a second, from the venue's current assignment."
          },
          "ceiling_max_concurrent": {
            "type": "integer",
            "description": "The ceiling on requests in flight at once."
          },
          "effective_requests_per_second": {
            "type": "number",
            "description": "The pace the connector allows itself right now. It is halved when the venue answers 429 or 418 and raised by a tenth of the ceiling for each quiet minute."
          },
          "requests_sent": {
            "type": "integer",
            "description": "Requests the connector has sent to the venue so far."
          },
          "observed_requests_per_second": {
            "type": "number",
            "description": "Requests a second observed in the trailing 60 seconds."
          },
          "in_flight": {
            "type": "integer",
            "description": "Requests in flight now."
          },
          "p50_latency_ms": {
            "type": "number",
            "description": "Median latency of the venue's answers in the trailing 60 seconds, in milliseconds."
          },
          "p95_latency_ms": {
            "type": "number",
            "description": "95th-percentile latency of the venue's answers in the trailing 60 seconds, in milliseconds."
          },
          "rate_limited_count": {
            "type": "integer",
            "description": "Answers refused as rate-limited in the trailing 60 seconds."
          },
          "other_failure_count": {
            "type": "integer",
            "description": "Requests that failed for any other reason in the trailing 60 seconds."
          },
          "throttle_wait_ms": {
            "type": "number",
            "description": "How long requests wait before they are sent, in milliseconds: for the pace and for a concurrency slot together."
          },
          "state": {
            "type": "string",
            "description": "The state of the budget as the connector reports it."
          },
          "weight_ceiling_per_minute": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The venue's weight ceiling a minute; null where the domain has none."
          },
          "weight_used_per_minute": {
            "type": [
              "null",
              "number"
            ],
            "description": "Weight used in the trailing minute; null where the domain has no weight ceiling."
          },
          "concurrency_wait_ms": {
            "type": [
              "null",
              "number"
            ],
            "description": "The part of `throttle_wait_ms` spent waiting for a concurrency slot; null for older heartbeats."
          }
        },
        "additionalProperties": false,
        "description": "The request budget of one rate-limit domain of a venue, live: the ceiling, the pace the connector allows itself now, and what was observed in the trailing 60 seconds."
      },
      "Page": {
        "required": [
          "limit",
          "returned",
          "next_cursor"
        ],
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "description": "The page size that was applied."
          },
          "returned": {
            "type": "integer",
            "description": "How many instruments this page holds."
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Pass it back to continue. Null on the last page. A cursor pins the instant, so a page taken later sees the same world as the first."
          }
        },
        "additionalProperties": false,
        "description": "Where a page of results sits: its size, how many it holds and the cursor for the next."
      },
      "ParseRequest": {
        "required": [
          "query"
        ],
        "type": "object",
        "properties": {
          "query": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object"
              }
            ],
            "description": "The query, as text or as the machine form of specification §3.1."
          },
          "dql": {
            "const": "1",
            "type": "string",
            "description": "The language version. Only `1` exists."
          },
          "context": {
            "const": "screen",
            "type": "string",
            "description": "What the query is for. Only `screen` exists."
          }
        },
        "additionalProperties": false,
        "description": "A query to check. Nothing is read and nothing is charged; an editor may call this on every keystroke."
      },
      "ParseResponse": {
        "required": [
          "dql",
          "query",
          "atoms",
          "timeframes",
          "complexity"
        ],
        "type": "object",
        "properties": {
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "dql": {
            "const": "1",
            "type": "string",
            "description": "The language version."
          },
          "query": {
            "required": [
              "string",
              "json"
            ],
            "type": "object",
            "properties": {
              "string": {
                "type": "string",
                "description": "The canonical text — what the platform understood."
              },
              "json": {
                "type": "object",
                "description": "The canonical machine form."
              }
            },
            "additionalProperties": false,
            "description": "The query in both forms, canonical."
          },
          "atoms": {
            "required": [
              "instrument",
              "venue"
            ],
            "type": "object",
            "properties": {
              "instrument": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Instrument-scoped names it reads."
              },
              "venue": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Venue-scoped names it reads."
              }
            },
            "additionalProperties": false,
            "description": "What the query reads, by scope. Useful for showing a reader which data a query depends on."
          },
          "timeframes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every period the query reads."
          },
          "complexity": {
            "required": [
              "nodes",
              "bars",
              "cost"
            ],
            "type": "object",
            "properties": {
              "nodes": {
                "type": "integer",
                "description": "Nodes in the parsed query."
              },
              "bars": {
                "type": "integer",
                "description": "Bars of history it will read."
              },
              "cost": {
                "type": "integer",
                "description": "Its total cost. Compare with `limits.cost` in the catalogue."
              }
            },
            "additionalProperties": false,
            "description": "What the query costs, against the catalogue's limits."
          }
        },
        "additionalProperties": false,
        "description": "A query checked but not run: what it means, what it will read, and what it will cost. An editor calls this on every keystroke; it touches no market data and needs no key."
      },
      "PaymentRequired": {
        "required": [
          "x402Version",
          "error",
          "resource",
          "accepts",
          "errors"
        ],
        "type": "object",
        "properties": {
          "x402Version": {
            "enum": [
              2
            ],
            "type": "integer",
            "description": "The x402 protocol version of this document: 2."
          },
          "error": {
            "type": "string",
            "description": "Why payment is required: no payment was sent, or what was wrong with the one that was."
          },
          "resource": {
            "required": [
              "url",
              "description",
              "mimeType"
            ],
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "The URL of the request that was refused."
              },
              "description": {
                "type": "string",
                "description": "What the request returns."
              },
              "mimeType": {
                "type": "string",
                "description": "The media type of the answer."
              },
              "serviceName": {
                "maxLength": 32,
                "type": "string",
                "description": "The bazaar extension's service name: DEBYKO. Present with the extension."
              },
              "tags": {
                "maxItems": 5,
                "type": "array",
                "items": {
                  "maxLength": 32,
                  "type": "string"
                },
                "description": "The bazaar extension's topical tags. Present with the extension."
              },
              "iconUrl": {
                "maxLength": 2048,
                "type": "string",
                "description": "The bazaar extension's icon: an absolute URL. Present with the extension."
              }
            },
            "additionalProperties": false,
            "description": "What is being paid for: the request that was refused."
          },
          "accepts": {
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentRequirements"
            },
            "description": "The ways to pay. The first entry is the price of this request; the others are plans on sale for USDC."
          },
          "extensions": {
            "required": [
              "bazaar"
            ],
            "type": "object",
            "properties": {
              "bazaar": {
                "required": [
                  "info",
                  "schema"
                ],
                "type": "object",
                "properties": {
                  "info": {
                    "type": "object",
                    "description": "An example input and output of the endpoint."
                  },
                  "schema": {
                    "type": "object",
                    "description": "The JSON Schema of that example, derived from the published schemas."
                  }
                },
                "additionalProperties": false,
                "description": "The x402 Bazaar discovery extension: how to call this endpoint, so a client can find and call it without documentation."
              }
            },
            "additionalProperties": false,
            "description": "The x402 version 2 extensions of this 402. `bazaar` (docs.x402.org/extensions/bazaar) declares the endpoint for discovery: `info` is how to call it (an example request and answer) and `schema` is a JSON Schema 2020-12 that `info` validates against, with the request and response schemas of this document inside. A client that pays echoes it in its payment, and the facilitator catalogues the service after that settlement."
          },
          "errors": {
            "minItems": 1,
            "type": "array",
            "items": {
              "required": [
                "code",
                "message"
              ],
              "type": "object",
              "properties": {
                "code": {
                  "enum": [
                    "PAYMENT_REQUIRED"
                  ],
                  "type": "string",
                  "description": "The stable name of the fault. Branch on this, never on the message."
                },
                "message": {
                  "type": "string",
                  "description": "The way out in a sentence."
                },
                "hint": {
                  "type": "string",
                  "description": "The way out with an API key."
                }
              },
              "additionalProperties": false
            },
            "description": "What to do instead, with an API key."
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanOffer"
            },
            "description": "The plans that can be bought with one payment instead of this one request (a plan is a key of that plan, 30 days, no renewal): each is also an entry of `accepts`, which carries only an amount, so this names which amount is which plan. Absent when no plan is on sale."
          },
          "plans_note": {
            "type": "string",
            "description": "How a plan is bought: pay the amount of that plan's entry in `accepts`; the answer is not data but a key."
          }
        },
        "additionalProperties": false,
        "description": "The 402 of a payable endpoint called with no credentials, or with a payment that was not accepted: the x402 version 2 `PaymentRequired` object (the same document, base64, is in the `PAYMENT-REQUIRED` header) with the usual `errors` list beside it, which is where the way out with an API key is said. Only when the operator has switched x402 on. `accepts` holds the requirement for this request first and then, when plans are on sale, one for each plan."
      },
      "PaymentRequirements": {
        "required": [
          "scheme",
          "network",
          "amount",
          "asset",
          "payTo",
          "maxTimeoutSeconds"
        ],
        "type": "object",
        "properties": {
          "scheme": {
            "enum": [
              "exact"
            ],
            "type": "string",
            "description": "The x402 payment scheme: `exact`, one payment of exactly `amount`."
          },
          "network": {
            "examples": [
              "eip155:8453"
            ],
            "type": "string",
            "description": "CAIP-2 chain id: `eip155:8453` is Base."
          },
          "amount": {
            "examples": [
              "1000"
            ],
            "pattern": "^[0-9]+$",
            "type": "string",
            "description": "The price in atomic units of `asset` (USDC has six decimals: `1000` is 0.001 USDC). A string, because it is an integer that can outgrow a double."
          },
          "asset": {
            "type": "string",
            "description": "The token contract (native USDC on Base: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)."
          },
          "payTo": {
            "type": "string",
            "description": "The receiving address."
          },
          "maxTimeoutSeconds": {
            "type": "integer",
            "description": "How long a signed payment may be valid for."
          },
          "extra": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "The name of the asset's token contract, as its EIP-712 domain states it."
              },
              "version": {
                "type": "string",
                "description": "The version of the asset's token contract, as its EIP-712 domain states it."
              }
            },
            "additionalProperties": false,
            "description": "The token's EIP-712 domain (`name`, `version`), which the signature is made over."
          }
        },
        "additionalProperties": false,
        "description": "One way to pay for the call, as the x402 version 2 specification defines it (`scheme: exact`, EIP-3009). Sign a transfer of exactly `amount` of `asset` to `payTo` on `network`, valid for at most `maxTimeoutSeconds`, and send it in the `PAYMENT-SIGNATURE` header."
      },
      "PlanAgentLimits": {
        "required": [
          "rules",
          "min_interval_s",
          "checks_per_minute",
          "webhooks",
          "telegram_chats",
          "notifications_per_day",
          "evaluations_per_day"
        ],
        "type": "object",
        "properties": {
          "rules": {
            "type": "integer",
            "description": "Active rules the plan holds."
          },
          "min_interval_s": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The shortest interval a rule is checked at on a schedule, seconds."
          },
          "checks_per_minute": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Checks a minute the account's rules may spend together: the hard cap, whatever the intervals."
          },
          "webhooks": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Webhook channels; null is no limit."
          },
          "telegram_chats": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Telegram chats the account may link; a rule sends to any number of the account's channels."
          },
          "notifications_per_day": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Notifications the account's rules may deliver in a UTC day: one per channel a firing reaches (a firing to 3 channels is 3). Over it a firing is recorded as not delivered until 00:00 UTC and the rule keeps running. Null is no cap."
          },
          "evaluations_per_day": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Evaluations a day the plan includes; null is unlimited."
          }
        },
        "additionalProperties": false,
        "description": "What a plan's Agent may do. Every number is the plan table's."
      },
      "PlanHistory": {
        "required": [
          "plan_days",
          "layers",
          "candles",
          "not_swept",
          "archive"
        ],
        "type": "object",
        "properties": {
          "plan_days": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The plan's own cap in days (`history_days`); null is no cap."
          },
          "layers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/HotWindow"
            },
            "description": "Per layer (`ticker`, `mark`, `funding`, `oi`, `book`, `stats`, `venue_depth`, `trade`) that is collected."
          },
          "candles": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/HotWindow"
            },
            "description": "Per candle timeframe (`1m` .. `1d`)."
          },
          "not_swept": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Layers no retention sweep drops (`funding_settlement`, `liquidation`): they have no hot window."
          },
          "archive": {
            "required": [
              "files_per_month",
              "file",
              "list"
            ],
            "type": "object",
            "properties": {
              "files_per_month": {
                "type": "integer",
                "description": "Archive files the plan includes in a calendar month (UTC); 0 is none. Beyond it a file is paid with x402."
              },
              "file": {
                "type": "string",
                "description": "The path of one file."
              },
              "list": {
                "type": "string",
                "description": "The path that lists a listing's files."
              }
            },
            "additionalProperties": false,
            "description": "The plan's archive files."
          }
        },
        "additionalProperties": false,
        "description": "What is kept and for how long, as numbers, derived from the retention classes in force and the archive manifest. Everything older than the hot window is an archive file."
      },
      "PlanItem": {
        "required": [
          "code",
          "name",
          "price_usd_per_month",
          "venues",
          "instruments",
          "history_days",
          "candle_history_days",
          "book_levels",
          "dql_per_minute",
          "requests_per_second",
          "requests_per_day",
          "stream_connections",
          "api_keys",
          "archive_files_per_month",
          "agent"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The plan's code (`free`, `mini`, `standard`, `pro`, `pro-plus`)."
          },
          "name": {
            "type": "string",
            "description": "The plan's name."
          },
          "price_usd_per_month": {
            "minimum": 0,
            "type": "number",
            "description": "What the plan costs a month, US dollars; a fraction only when the price has cents."
          },
          "venues": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Venues the plan includes; null is every venue."
          },
          "instruments": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Instruments the plan includes, counted once across its venues; null is every instrument."
          },
          "history_days": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Days of history the plan reads; null is no plan limit."
          },
          "history": {
            "$ref": "#/components/schemas/PlanHistory"
          },
          "candle_history_days": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "null",
                "integer"
              ]
            },
            "description": "Days of candles the plan reads, by timeframe (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`; a timeframe between two takes the one below it). The Free plan reads every timeframe, a fine one a short way back and a coarse one far back; the other plans read `history_days` for all of them. A null value is no plan limit."
          },
          "book_levels": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Levels a side of `/v2/books` returns; null is the most the endpoint serves."
          },
          "dql_per_minute": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Queries a minute (`/v2/screen`, `/v2/dql/parse`)."
          },
          "requests_per_second": {
            "type": "integer",
            "description": "Requests a second the plan allows, sustained: the bucket refills at this rate."
          },
          "requests_burst": {
            "type": "integer",
            "description": "Requests a key may send at once after a quiet moment: the capacity of the per-second bucket, 4 times `requests_per_second`, at least 10, on every plan."
          },
          "requests_per_day": {
            "type": "integer",
            "description": "Requests a UTC day the plan allows."
          },
          "stream_connections": {
            "type": "integer",
            "description": "Streams open at once."
          },
          "api_keys": {
            "type": "integer",
            "description": "Keys an account may hold."
          },
          "archive_files_per_month": {
            "type": "integer",
            "description": "Archive files included in a calendar month (UTC); 0 is none."
          },
          "agent": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PlanAgentLimits"
              },
              {
                "type": "null"
              }
            ],
            "description": "The plan's Agent limits; null is a plan without Agent."
          }
        },
        "additionalProperties": false,
        "description": "One self-serve plan and its limits. A null limit is no limit: every venue, every instrument, no cap on how far back the plan reads, the deepest book served."
      },
      "PlanOffer": {
        "required": [
          "code",
          "name",
          "price_usd",
          "amount",
          "days"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The plan's code (`mini`, `standard`, `pro`, `pro-plus`)."
          },
          "name": {
            "type": "string",
            "description": "The plan's name."
          },
          "price_usd": {
            "pattern": "^[0-9]+(\\.[0-9]+)?$",
            "type": "string",
            "description": "The price in US dollars and in USDC, the same as the plan's monthly price at checkout."
          },
          "amount": {
            "pattern": "^[0-9]+$",
            "type": "string",
            "description": "The amount in atomic units of the asset (USDC has six decimals): the `amount` of the matching entry in `accepts`."
          },
          "days": {
            "type": "integer",
            "description": "How long the key lasts: 30, from the payment, not renewed."
          }
        },
        "additionalProperties": false,
        "description": "One plan on sale for USDC."
      },
      "PlanPurchaseResponse": {
        "required": [
          "plan",
          "plan_name",
          "api_key",
          "issued_at",
          "expires_at",
          "valid_days",
          "payment",
          "notes",
          "served_at",
          "receipt_id"
        ],
        "type": "object",
        "properties": {
          "plan": {
            "type": "string",
            "description": "The plan's code."
          },
          "plan_name": {
            "type": "string",
            "description": "The plan's name."
          },
          "api_key": {
            "pattern": "^dbk_[0-9A-Za-z]{44}$",
            "type": "string",
            "description": "A normal key of the plan, sent as `Authorization: Bearer <key>`. Shown once: DEBYKO keeps its first twelve characters and a hash of the rest."
          },
          "issued_at": {
            "$ref": "#/components/schemas/Instant"
          },
          "expires_at": {
            "description": "When the key stops working: 30 days after the payment. From three days before it, every response carries `X-Debyko-Key-Expires`.",
            "$ref": "#/components/schemas/Instant"
          },
          "valid_days": {
            "type": "integer",
            "description": "How long the key lasts, in days."
          },
          "payment": {
            "required": [
              "transaction",
              "network",
              "payer",
              "amount",
              "price_usd"
            ],
            "type": "object",
            "properties": {
              "transaction": {
                "pattern": "^0x[0-9a-f]{64}$",
                "type": "string",
                "description": "The settlement transaction hash."
              },
              "network": {
                "type": "string",
                "description": "The network the payment settled on."
              },
              "payer": {
                "pattern": "^0x[0-9a-f]{40}$",
                "type": "string",
                "description": "The address that paid."
              },
              "amount": {
                "pattern": "^[0-9]+$",
                "type": "string",
                "description": "The amount paid, in atomic units of the asset (USDC has six decimals)."
              },
              "price_usd": {
                "type": "string",
                "description": "The plan's price in US dollars."
              }
            },
            "additionalProperties": false,
            "description": "The payment this key was issued for."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What to know about the key: it is shown once, how long it lasts, how to send it."
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          }
        },
        "additionalProperties": false,
        "description": "The answer to a payment of a plan's price (x402, no key): not the data of the path it was sent to, but a key of the plan. The key is in this response only; the settlement is also in the `PAYMENT-RESPONSE` header (base64: success, transaction, network, payer)."
      },
      "PlansResponse": {
        "required": [
          "evaluated_at",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanItem"
            },
            "description": "The plans, in the order of the table."
          }
        },
        "additionalProperties": false,
        "description": "Every self-serve plan and its limits, in the order of the Compare-plans table, read from the plan table (a change there shows within a minute). No key, and not counted."
      },
      "QuantifierScope": {
        "required": [
          "venues_listed",
          "venues_in_scope",
          "excluded"
        ],
        "type": "object",
        "properties": {
          "venues_listed": {
            "minimum": 0,
            "type": "integer",
            "description": "The instrument's listings, the same number as `venues_listed`."
          },
          "venues_in_scope": {
            "minimum": 0,
            "type": "integer",
            "description": "The listings the construct was evaluated over: `venues_listed` less `excluded`."
          },
          "excluded": {
            "type": "array",
            "items": {
              "required": [
                "venue",
                "symbol",
                "reason",
                "layer"
              ],
              "type": "object",
              "properties": {
                "venue": {
                  "examples": [
                    "AVANTIS-PERP"
                  ],
                  "type": "string",
                  "description": "The public code of the venue the listing is on."
                },
                "symbol": {
                  "examples": [
                    "BTC-USD"
                  ],
                  "type": "string",
                  "description": "The venue's own symbol for the listing: a venue may list the instrument more than once, in different quote currencies."
                },
                "reason": {
                  "enum": [
                    "halted",
                    "off",
                    "not_published"
                  ],
                  "type": "string",
                  "description": "`halted`: the venue does not trade the listing at the instant evaluated. `off`: DEBYKO does not collect that layer for the listing. `not_published`: the venue does not publish it."
                },
                "layer": {
                  "examples": [
                    "mark"
                  ],
                  "type": [
                    "null",
                    "string"
                  ],
                  "description": "The layer the construct reads that has no value there; null for `halted`, which is the whole listing."
                }
              },
              "additionalProperties": false
            },
            "description": "Every listing left out, and why."
          }
        },
        "additionalProperties": false,
        "description": "What one quantifier or aggregate was computed over, for one instrument."
      },
      "ReceiptId": {
        "$comment": "Task 118. Optional until production serves it, like `served_at`.",
        "examples": [
          "3yLdkPqXw7ZaB2nVt0RhUe"
        ],
        "pattern": "^[0-9A-Za-z]{22}$",
        "type": "string",
        "description": "An opaque name for this exact response: 128 random bits in base 62, 22 characters. It is generated per response (per event on the stream), is not derived from the content and is not stored: it exists to be logged next to a decision, and the response is replayed by `as_of`, never looked up by this id."
      },
      "ReferenceValue": {
        "required": [
          "value",
          "from",
          "as_of"
        ],
        "type": "object",
        "properties": {
          "value": {
            "description": "The value of the instrument's field, or null with `reason` when the platform has none.",
            "$ref": "#/components/schemas/Number"
          },
          "unit": {
            "$ref": "#/components/schemas/Unit"
          },
          "from": {
            "const": "reference",
            "type": "string",
            "description": "Always `reference`: the value comes from the instrument's reference data, not from a venue."
          },
          "as_of": {
            "description": "The instant the reference data was read at.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          }
        },
        "additionalProperties": false,
        "description": "A field of the instrument itself rather than of a venue — it has no venue and no age, only the moment the reference data was read."
      },
      "RenamedFrom": {
        "required": [
          "instrument",
          "at"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "examples": [
              "1000PEPE-PERP"
            ],
            "type": "string",
            "description": "The instrument code the listing carried before."
          },
          "at": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Instant"
              }
            ],
            "description": "When the listing was renamed."
          }
        },
        "additionalProperties": false,
        "description": "The instrument code a listing carried before the platform renamed it, and when."
      },
      "ResolvedFrom": {
        "examples": [
          {
            "BINANCE-PERP": "BINANCE-USDM"
          }
        ],
        "type": "object",
        "additionalProperties": {
          "type": "string"
        },
        "description": "Present when the request wrote a venue by a common name instead of its registry code (`BINANCE-PERP` for `BINANCE-USDM`): each name written, with the code it was answered as. Absent when every venue was written as its code."
      },
      "ScreenInstrument": {
        "required": [
          "instrument",
          "result",
          "values",
          "venues"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "examples": [
              "BTC-PERP"
            ],
            "type": "string",
            "description": "The platform's code for the instrument."
          },
          "result": {
            "enum": [
              "true",
              "false",
              "unknown"
            ],
            "type": "string",
            "description": "What the condition came to for this instrument. `unknown` is its own answer, not a failure: it means the data needed to decide was missing or stale. Only instruments that came to `true` are returned unless the request asked for the others."
          },
          "values": {
            "$ref": "#/components/schemas/ValueMap"
          },
          "scopes": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/QuantifierScope"
            },
            "description": "The listings each quantifier and aggregate of the query ran over (`any`, `all`, `count`, `max`, `min`, `sum`), keyed by its canonical string; absent when the query has none. A listing halted at the instant evaluated, or one on which a layer the construct reads is `off` or `not_published`, is left out and named here with the reason; it keeps its row in `venues`. `stale` and `missing` listings stay in."
          },
          "venues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenVenue"
            },
            "description": "The listings of the instrument, one per venue, each with the values the query selected for it and the venue that published each."
          }
        },
        "additionalProperties": false,
        "description": "One instrument that matched, with what the query selected for it and the venues it was read on."
      },
      "ScreenRequest": {
        "type": "object",
        "properties": {
          "query": {
            "examples": [
              "any(venues where funding > 0)"
            ],
            "type": "string",
            "description": "The query in DQL."
          },
          "query_object": {
            "type": "object",
            "description": "The same query in the machine form of specification §3.1."
          },
          "limit": {
            "minimum": 1,
            "type": "integer",
            "description": "How many instruments to return in one page. The catalogue states the ceiling your plan allows.",
            "default": 100
          },
          "cursor": {
            "type": "string",
            "description": "A cursor from a previous answer's `page.next_cursor`. It pins the instant, so page two sees the world page one saw."
          },
          "include_unknown": {
            "type": "boolean",
            "description": "Also return the instruments the data could not decide, with `result: unknown`, instead of dropping them. Ask for this whenever coverage matters.",
            "default": false
          },
          "include_atoms": {
            "type": "boolean",
            "description": "Also return, for every value the platform computed, the values it was computed from — each with its own venue, receipt time, age and status. `derived: true` marks a computed value whether or not this is asked for; this adds the evidence behind it. Off by default because the evidence is several times the size of the answer.",
            "default": false
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "What quantities are expressed in. `published` leaves each venue's own unit alone; `base` converts to the base asset, and gives null with `unit_unknown` where a contract size is not known.",
            "default": "published"
          },
          "number_format": {
            "enum": [
              "json",
              "string"
            ],
            "type": "string",
            "description": "`string` returns every number as a string with the same digits, for a client whose JSON parser would round them.",
            "default": "json"
          },
          "allow_stale": {
            "type": "boolean",
            "description": "ADR-025: return a stale value under `withheld` — never in the value field. Off by default: a stale value is not in the answer at all, only its status, reason and dates. For post-mortems; never feed `withheld` into a live decision.",
            "default": false
          }
        },
        "additionalProperties": false,
        "description": "A query to run. Send exactly one of `query` (the text form) and `query_object` (the machine form); an editor that builds queries structurally sends the second and never has to quote."
      },
      "ScreenResponse": {
        "required": [
          "dql",
          "query",
          "evaluated_at",
          "as_of",
          "settled",
          "freshness",
          "instruments",
          "page"
        ],
        "type": "object",
        "properties": {
          "dql": {
            "type": "string",
            "description": "The query in canonical form — what the platform understood, which may differ in spacing and clause order from what was sent."
          },
          "query": {
            "required": [
              "string",
              "json"
            ],
            "type": "object",
            "properties": {
              "string": {
                "type": "string",
                "description": "The query as text."
              },
              "json": {
                "type": "object",
                "description": "The parsed query. Its shape is the language's abstract syntax, given in the specification."
              }
            },
            "additionalProperties": false,
            "description": "The query echoed in both forms, so a client that sent text can keep the machine form and a client that sent the machine form can show the text."
          },
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "as_of": {
            "$ref": "#/components/schemas/NullableInstant"
          },
          "settled": {
            "type": "boolean",
            "description": "Whether the instant is far enough in the past that late arrivals can no longer change the answer. A false here means the same query may answer differently in two minutes; that is the honest state, not an error."
          },
          "timeframe": {
            "type": "string",
            "description": "The period the query's series were read at, when it asked for one."
          },
          "normalisation_version": {
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store.",
            "$ref": "#/components/schemas/NormalisationVersion"
          },
          "freshness": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "null",
                "string"
              ]
            },
            "description": "ADR-025: the query's own `freshness` bound per layer, or null where it sets none — every value then has only its own horizon (`valid_until`). The bound only tightens."
          },
          "listings_as_of": {
            "description": "When the set of listings was last known to change. Present when asking about the past.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "capabilities_as_of": {
            "description": "When what each venue publishes was last known to change.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "instruments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenInstrument"
            },
            "description": "The instruments that matched, each with the venues it was read on. With `include_unknown`, also those the data could not decide."
          },
          "page": {
            "description": "The page that was returned and the cursor for the next.",
            "$ref": "#/components/schemas/Page"
          }
        },
        "additionalProperties": false,
        "description": "The answer to a DQL query: the query as the platform read it, the instant it was answered at, and what matched."
      },
      "ScreenVenue": {
        "required": [
          "venue",
          "symbol",
          "quote",
          "values"
        ],
        "type": "object",
        "properties": {
          "venue": {
            "examples": [
              "BYBIT-PERP"
            ],
            "type": "string",
            "description": "The venue's public code."
          },
          "symbol": {
            "examples": [
              "BTCUSDT"
            ],
            "type": "string",
            "description": "The venue's own symbol for the listing, as the venue spells it."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "Mapping recorded after deployment or reconstructed from the pre-deployment cache."
          },
          "identity_corrected_at": {
            "description": "Start of the next mapping interval for this listing, when one exists.",
            "$ref": "#/components/schemas/Instant"
          },
          "quote": {
            "examples": [
              "USDT"
            ],
            "type": "string",
            "description": "What the listing is quoted in."
          },
          "values": {
            "$ref": "#/components/schemas/ValueMap"
          }
        },
        "additionalProperties": false,
        "description": "One venue's listing of the instrument, and the values read from it."
      },
      "Selection": {
        "examples": [
          "venue = BYBIT-PERP and base in (BTC, ETH)"
        ],
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "object"
          }
        ],
        "description": "Which listings to answer for, in the DQL selection grammar — `venue = HYPERLIQUID and base = BTC`, with or without the leading `where`. The machine form of the same node is accepted as an object. Omit it and every listing is selected, which the endpoint's limits will usually refuse.\n\nUnmapped listings are selected too and come back with `instrument: null`; `instrument = X` never matches one."
      },
      "SeriesValue": {
        "required": [
          "value",
          "venue",
          "layer",
          "timeframe",
          "venue_ts",
          "received_at",
          "age_ms",
          "status"
        ],
        "type": "object",
        "properties": {
          "value": {
            "description": "The number for this period, as the venue published it, or null when the period has no reading (`status` and `reason` say why). A reading that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Number"
          },
          "unit": {
            "$ref": "#/components/schemas/Unit"
          },
          "venue": {
            "type": "string",
            "description": "The public code of the venue that published the reading."
          },
          "instrument": {
            "type": "string",
            "description": "Change set 34: on a value read through `ref`, the instrument it was read for."
          },
          "layer": {
            "type": "string",
            "description": "The layer the reading belongs to."
          },
          "price_type": {
            "enum": [
              "trade",
              "mark",
              "index"
            ],
            "type": "string",
            "description": "Which price the reading is of, where a layer publishes more than one: `trade`, `mark` or `index`."
          },
          "timeframe": {
            "examples": [
              "1m",
              "15m",
              "1h",
              "1d"
            ],
            "type": "string",
            "description": "The period of the series."
          },
          "bars": {
            "type": "integer",
            "description": "How many periods the function read. A window that could not be filled gives null with `insufficient_history`; for a total over the events of a window, the periods the window spans."
          },
          "candle_end": {
            "description": "When the series is candles: the end of the period S[0] stands for (UTC).",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "sample_end": {
            "description": "When the series is a sampled snapshot layer: the end of the sampling window S[0] stands for (UTC).",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "window_start": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "C8-01: on a total over the events of a window (`liquidation_count(n)` and its eight siblings), the start of the window — `timeframe` × `bars` before `window_end`, exclusive. Such a value has no `candle_end` or `sample_end`: it is not a reading of one period."
          },
          "window_end": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableInstant"
              }
            ],
            "description": "C8-01: the end of the window — the latest period end at the instant of the query, inclusive. An event at exactly this instant is in the window, one at exactly `window_start` is not."
          },
          "band": {
            "type": "string",
            "description": "The band this depth figure covers, as a fraction of the reference price."
          },
          "reference": {
            "type": "string",
            "description": "The price the band is measured from."
          },
          "levels": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many book levels fell inside the band; null when the book did not reach its edge."
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The reading's age in milliseconds at the instant asked about: from `venue_ts` where its horizon counts from the venue's clock, from `received_at` otherwise. Null when nothing was received."
          },
          "status": {
            "description": "Whether the value is current: `present`, `stale`, `missing`, `not_published` or `off`. Only a `present` value comes with a number. A stale value is withheld, and a missing, unpublished or switched-off one has none, so a value that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Status"
          },
          "derived": {
            "const": "True",
            "type": "boolean",
            "description": "Present when the platform computed this value rather than reading it — `mid` from `bid` and `ask`, `basis` from `mark` and `index`, `funding_8h` from the rate and the interval, `funding_short` from `funding`, a series function from its source, `age` and `status` from the row and the instant. The value still carries the provenance of the observation it was computed from, because it has one. Ask for `include_atoms` to get the values behind it."
          },
          "atoms": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Value"
            },
            "description": "The values this one was computed from, by name. Present only when the request asked for `include_atoms`."
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          },
          "gap_cause": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GapCause"
              }
            ],
            "description": "With reason `gap`: what the platform recorded about a missing period of the window. Absent when nothing recorded explains it."
          },
          "carried": {
            "type": "boolean",
            "description": "ADR-025: on a bare sampled field, whether the value at `sample_end` was carried into its period from an earlier one (a push feed that sends only on change, its connection alive) rather than observed in it. The language asks the same with `carried(S, n)`."
          },
          "withheld": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "ADR-025: a stale S[0], only when the request set `allow_stale`. `value` is then null."
          }
        },
        "additionalProperties": false,
        "description": "A reading taken from a series — candles, or the snapshot layers sampled once a period — or (C8-01) a total over the events of a window of periods. It carries the period it belongs to and how many bars the function needed."
      },
      "ServedAt": {
        "$comment": "Task 118. Optional in every response schema until production serves it; it becomes `required` in a separate commit, after that (the rule in the $comment at the top of this file).",
        "examples": [
          "2026-09-29T10:15:30.123456Z"
        ],
        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$",
        "type": "string",
        "description": "The response's own as-of instant: the visibility cut its reads used, the same instant as `evaluated_at`, on the clock `received_at` is stamped with. RFC 3339, UTC, always six fractional digits (the clock has millisecond resolution today, so the last three are zeros). The live answer is the freshest we have seen; history is what we stored; between them is a gap of up to one sampling window, whose size is `history_cadence` on `/v2/instruments`. Querying the same data with `as_of` set to this instant returns what had been recorded as of it — every reading visible then (a stored reading counts from the end of its window), with its `received_at` and status — the same every time; a live answer may show a newer reading of the window still open at this instant. Log the response to keep exactly what was read; `/v2/stream` events are ticks and are not replayed one by one."
      },
      "SnapshotItem": {
        "required": [
          "instrument",
          "venue",
          "venue_symbol",
          "quote",
          "layers"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when this listing maps to no instrument — and then `reason` says why."
          },
          "reason": {
            "type": "string",
            "description": "Why the listing maps to no instrument. Present only when `instrument` is null."
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "venue_symbol": {
            "type": "string",
            "description": "The venue's own symbol."
          },
          "identity_basis": {
            "enum": [
              "recorded",
              "reconstructed"
            ],
            "type": "string",
            "description": "Mapping recorded after deployment or reconstructed from the pre-deployment cache."
          },
          "identity_corrected_at": {
            "description": "Start of the next mapping interval for this listing, when one exists.",
            "$ref": "#/components/schemas/Instant"
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot"
            ],
            "type": "string",
            "description": "The market kind of this listing. Added with change set 37; absent from earlier responses."
          },
          "layers": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/LayerReading"
            },
            "description": "Each layer asked for, by name."
          }
        },
        "additionalProperties": false,
        "description": "One listing, layer by layer."
      },
      "SnapshotLayer": {
        "enum": [
          "ticker",
          "mark",
          "funding",
          "oi",
          "book",
          "stats",
          "venue_depth"
        ],
        "type": "string",
        "description": "A snapshot layer, spelled as every endpoint, the DQL field table and the MCP tools spell it. `ticker`: last price and the best bid and ask with their sizes. `mark`: mark and index price, and the basis. `funding`: the funding rate and its interval. `oi`: open interest. `book`: best bid and ask, mid, spread and the liquidity in bands around the mid, measured by the platform from the book it received. `stats`: 24 h volume, turnover, change, high and low. `venue_depth`: the depth figures a venue publishes itself."
      },
      "SnapshotValue": {
        "required": [
          "value",
          "venue",
          "layer",
          "venue_ts",
          "received_at",
          "age_ms",
          "status"
        ],
        "type": "object",
        "properties": {
          "value": {
            "description": "The number as the venue published it (or, with `derived`, as the platform computed it from such numbers), in the unit named by `unit`. Null when the value is not current: a stale, missing, not published or switched-off value is never returned as a number, and a stale one is under `withheld` only when the request sets `allow_stale`.",
            "$ref": "#/components/schemas/Number"
          },
          "unit": {
            "$ref": "#/components/schemas/Unit"
          },
          "venue": {
            "examples": [
              "KRAKEN-FUTURES"
            ],
            "type": "string",
            "description": "The public code of the venue that published it."
          },
          "instrument": {
            "examples": [
              "BTC-PERP"
            ],
            "type": "string",
            "description": "Change set 34: on a value read through `ref`, the instrument it was read for — with `venue`, the listing whose value this is. Absent on every value that is the evaluated listing's own."
          },
          "layer": {
            "examples": [
              "mark",
              "funding",
              "book",
              "venue_depth",
              "oi",
              "stats",
              "reference",
              "liquidation"
            ],
            "type": "string",
            "description": "The layer it was read from."
          },
          "price_type": {
            "enum": [
              "trade",
              "mark",
              "index"
            ],
            "type": "string",
            "description": "Which price the reading is of, where a layer publishes more than one."
          },
          "band": {
            "examples": [
              "0.001"
            ],
            "type": "string",
            "description": "The band this depth figure covers, as a fraction of the reference price."
          },
          "reference": {
            "examples": [
              "mid",
              "mark"
            ],
            "type": "string",
            "description": "The price the band is measured from."
          },
          "levels": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many book levels fell inside the band; null when the book did not reach its edge, and then `reason` is `band_truncated`."
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The value's age at the instant asked about, in milliseconds (C25-01: one definition of age): from `venue_ts` where its horizon counts from the venue's clock (`anchor: venue`), from `received_at` otherwise. Null when nothing was received."
          },
          "venue_age_ms": {
            "description": "Age by venue time: milliseconds from `venue_ts` to the instant asked about, on the venue's clock whatever the anchor. Null when the venue sends no time. `age_ms` is the age the value is judged by.",
            "$ref": "#/components/schemas/VenueAgeMs"
          },
          "valid_until": {
            "description": "The instant after which the value is no longer current (UTC). At `valid_until` itself it is still current. Null while a push feed's connection is alive and when no cadence fact covers the value.",
            "$ref": "#/components/schemas/ValidUntil"
          },
          "horizon_source": {
            "description": "Where `valid_until` comes from: `venue_declared`, `measured`, `documented`, `assumed` or `connection`. Null when no cadence fact covers the value, which is then stale with reason `horizon_unknown`.",
            "$ref": "#/components/schemas/HorizonSource"
          },
          "anchor": {
            "description": "Which clock the age and the horizon count from: `venue` (the venue's own timestamp, where it sends one and it dates the publication) or `receipt` (`received_at`).",
            "$ref": "#/components/schemas/Anchor"
          },
          "status": {
            "description": "Whether the value is current: `present`, `stale`, `missing`, `not_published` or `off`. Only a `present` value comes with a number. A stale value is withheld, and a missing, unpublished or switched-off one has none, so a value that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Status"
          },
          "derived": {
            "const": "True",
            "type": "boolean",
            "description": "Present when the platform computed this value rather than reading it — `mid` from `bid` and `ask`, `basis` from `mark` and `index`, `funding_8h` from the rate and the interval, `funding_short` from `funding`, a series function from its source, `age` and `status` from the row and the instant. The value still carries the provenance of the observation it was computed from, because it has one. Ask for `include_atoms` to get the values behind it."
          },
          "atoms": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Value"
            },
            "description": "The values this one was computed from, by name. Present only when the request asked for `include_atoms`."
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          },
          "withheld": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Number"
              }
            ],
            "description": "ADR-025: the value of a stale reading, only when the request set `allow_stale`. `value` is then null."
          }
        },
        "additionalProperties": false,
        "description": "The latest reading of one field on one venue at the instant of the query. A reading is stored as the venue published it: no rounding, rescaling or averaging across venues; a value the platform computed (for example `funding_8h`) says so in `derived`. `venue_ts` is the venue's own time, `received_at` the platform's, and `age_ms` how old the value is, counted from the venue's time where the venue dates the value and from `received_at` otherwise."
      },
      "SnapshotsRequest": {
        "type": "object",
        "properties": {
          "where": {
            "$ref": "#/components/schemas/Selection"
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot",
              "all"
            ],
            "type": "string",
            "description": "Market kind to select. Defaults to perpetual, preserving the prior V2 selection. `all` includes spot and perpetual listings.",
            "default": "perpetual"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "What quantities are expressed in.",
            "default": "published"
          },
          "number_format": {
            "enum": [
              "json",
              "string"
            ],
            "type": "string",
            "description": "`string` returns every number as a string with the same digits.",
            "default": "json"
          },
          "include_synthetic": {
            "type": "boolean",
            "description": "Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra.",
            "default": false
          },
          "layers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnapshotLayer"
            },
            "description": "Which layers to read. Every layer when omitted."
          },
          "include_raw": {
            "type": "boolean",
            "description": "Also return each layer's message as the venue sent it.",
            "default": false
          },
          "allow_stale": {
            "type": "boolean",
            "description": "ADR-025: return a stale value under `withheld` — never in the value field. Off by default: a stale value is not in the answer at all, only its status, reason and dates. For post-mortems; never feed `withheld` into a live decision.",
            "default": false
          }
        },
        "additionalProperties": false,
        "description": "Which listings and which layers to read now."
      },
      "SnapshotsResponse": {
        "required": [
          "evaluated_at",
          "units",
          "freshness",
          "items",
          "missing"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "The unit mode applied."
          },
          "normalisation_version": {
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store.",
            "$ref": "#/components/schemas/NormalisationVersion"
          },
          "freshness": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "null",
                "string"
              ]
            },
            "description": "ADR-025: the request's own bound per layer, or null where none was set — every value has its own horizon (`valid_until`) either way, and a bound only tightens it."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnapshotItem"
            },
            "description": "One object per listing."
          },
          "missing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotListed"
            },
            "description": "The instrument-venue pairs that do not exist."
          }
        },
        "additionalProperties": false,
        "description": "The latest reading of each layer for the selected listings."
      },
      "Status": {
        "enum": [
          "present",
          "stale",
          "missing",
          "not_published",
          "off"
        ],
        "type": "string",
        "description": "How the platform stands to this value at the instant of the query. `present`: received and still current — within its validity horizon (`valid_until`) and any bound the request set. `stale`: received, but no longer current — it compares as unknown, and its value is withheld: not in the value field, and under `withheld` only when the request sets `allow_stale` (ADR-025). `missing`: nothing received. `not_published`: the venue does not publish it, a fact about the venue. `off`: the platform does not collect it for this listing's group, a choice that can change. Only `present` comes with a number; a value that is not current is never returned as one,, and a missing value is never written as zero."
      },
      "StatusAllCollectedStale": {
        "required": [
          "configured_listings",
          "eligible_listings",
          "all_stale_listings",
          "no_relevant_layers",
          "halted_listings",
          "all_stale",
          "membership_revision",
          "source_retired"
        ],
        "type": "object",
        "properties": {
          "configured_listings": {
            "minimum": 0,
            "type": "integer",
            "description": "Unique configured-collected listing identities, including halted identities."
          },
          "eligible_listings": {
            "minimum": 0,
            "type": "integer",
            "description": "Unique listings with at least one collected, published freshness layer used by this predicate."
          },
          "all_stale_listings": {
            "minimum": 0,
            "type": "integer",
            "description": "Eligible unique listings whose every relevant layer is stale; halted listings count as stale."
          },
          "no_relevant_layers": {
            "minimum": 0,
            "type": "integer",
            "description": "Configured listings with no relevant freshness layers; these prevent an all-stale result."
          },
          "halted_listings": {
            "minimum": 0,
            "type": "integer",
            "description": "Listings the venue halted. They count as stale for this predicate; missing, off and not-published measurements cannot satisfy it."
          },
          "all_stale": {
            "type": "boolean",
            "description": "True only when at least one configured listing exists and every configured identity is eligible and stale; false for an explicitly retired source."
          },
          "membership_revision": {
            "maxLength": 64,
            "minLength": 64,
            "pattern": "^[0-9a-f]{64}$",
            "type": "string",
            "description": "Opaque digest of this venue's configured listing identities and relevant dataset policy. A change means continuous-observation timers must restart."
          },
          "source_retired": {
            "type": "boolean",
            "description": "The venue's source was explicitly retired. Configured listing count remains for historical context; the venue is excluded from active outage paging."
          }
        },
        "additionalProperties": false,
        "description": "The all-stale predicate of a venue, used for the two-hour all-stale alert: whether every collected listing of the venue is stale."
      },
      "StatusBreak": {
        "required": [
          "cause",
          "since"
        ],
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "The cause the platform recorded (a gap cause such as `ws_disconnected`)."
          },
          "since": {
            "$ref": "#/components/schemas/Instant"
          }
        },
        "additionalProperties": false,
        "description": "A recorded break of the venue's connection that has not ended."
      },
      "StatusLayer": {
        "required": [
          "layer",
          "present",
          "stale",
          "missing",
          "not_published",
          "off",
          "oldest_age_ms",
          "newest_age_ms"
        ],
        "type": "object",
        "properties": {
          "layer": {
            "type": "string",
            "description": "The layer: `ticker`, `mark`, `funding`, `oi`, `book`, `stats` or `venue_depth`."
          },
          "present": {
            "type": "integer",
            "description": "Listings whose value is current."
          },
          "stale": {
            "type": "integer",
            "description": "Listings whose value was received and is no longer current. Such a value is never returned as a number."
          },
          "missing": {
            "type": "integer",
            "description": "Listings for which nothing was received."
          },
          "not_published": {
            "type": "integer",
            "description": "Listings for which the venue does not publish the layer. A fact about the venue."
          },
          "off": {
            "type": "integer",
            "description": "Listings for which the platform does not collect the layer. A choice of the platform."
          },
          "stale_reasons": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Why the stale ones are stale, by reason (`horizon_passed`, `connection_lost`, `state_lag`, `horizon_unknown`, ...), counted over the stale listings."
          },
          "oldest_age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The age in milliseconds of the oldest current value; null when none is current."
          },
          "newest_age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The age in milliseconds of the newest current value; null when none is current."
          },
          "stale_causes": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "Whose standstill the stale ones are: `venue` (the venue's own timestamp ran out while our receipts are within the horizon), `us` (our receipts are older than the horizon, a connection broke, our projection lagged, or no fact covers the value) or `awaiting_first_trade` (our connector restarted and the venue's ticker is made of its trades). Kinds with none are left out; they add up to `stale`."
          }
        },
        "additionalProperties": false,
        "description": "One layer of one venue: how many of the venue's collected listings answer each of the five ways."
      },
      "StatusNotCurrent": {
        "required": [
          "instrument",
          "symbol",
          "layer",
          "status",
          "reason",
          "age_ms",
          "cause",
          "venue_age_ms",
          "received_age_ms"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when the listing maps to no instrument."
          },
          "symbol": {
            "type": "string",
            "description": "The venue's own symbol."
          },
          "layer": {
            "type": "string",
            "description": "The layer of the value."
          },
          "status": {
            "description": "`stale` or `missing`.",
            "$ref": "#/components/schemas/Status"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ],
            "description": "The reason of `/v2`: why the value is stale (`horizon_passed`, `connection_lost`, ...) or missing. Null when there is none."
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How old the value is in milliseconds: the one age every verdict is judged by, from the venue's own timestamp where its horizon counts from it, from receipt otherwise. Null for a missing value."
          },
          "cause": {
            "type": [
              "null",
              "string"
            ],
            "description": "Whose standstill a stale value is: `venue`, `us` or `awaiting_first_trade`. Beside the reason, never instead of it. Null for a missing value."
          },
          "venue_age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How old the value is by the venue's own timestamp; null without one."
          },
          "received_age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How long ago the platform received the value; null for a missing value."
          }
        },
        "additionalProperties": false,
        "description": "A value that should be there and is not current: stale, with its reason and age, or missing."
      },
      "StatusResponse": {
        "required": [
          "evaluated_at",
          "data_as_of",
          "breaks_known",
          "totals",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "data_as_of": {
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "breaks_known": {
            "type": "boolean",
            "description": "False when the record of connection breaks could not be read: a value that holds only while its connection lives is then stale with `horizon_unknown`, and `breaks` is empty because nothing is known, not because nothing is broken."
          },
          "totals": {
            "description": "The counts over every venue in `items`.",
            "$ref": "#/components/schemas/StatusTotals"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusVenue"
            },
            "description": "One object per venue."
          }
        },
        "additionalProperties": false,
        "description": "Collection status and freshness by venue and layer. Every status is decided by the one rule `/v2/snapshots` answers by, so this page and a snapshot cannot say different things about the same value."
      },
      "StatusTotals": {
        "required": [
          "venues",
          "venues_live",
          "listings",
          "present",
          "stale",
          "missing"
        ],
        "type": "object",
        "properties": {
          "venues": {
            "type": "integer",
            "description": "Venues counted."
          },
          "venues_live": {
            "type": "integer",
            "description": "Venues whose connector is live."
          },
          "listings": {
            "type": "integer",
            "description": "Listings counted."
          },
          "present": {
            "type": "integer",
            "description": "Values that are current."
          },
          "stale": {
            "type": "integer",
            "description": "Values that were received and are no longer current."
          },
          "missing": {
            "type": "integer",
            "description": "Values for which nothing was received."
          },
          "stale_causes": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            },
            "description": "The stale values by whose standstill they are (`venue`, `us`, `awaiting_first_trade`), all three present; they add up to `stale`."
          }
        },
        "additionalProperties": false,
        "description": "Counts over every venue, listing and layer."
      },
      "StatusVenue": {
        "required": [
          "venue",
          "name",
          "kind",
          "synthetic",
          "connector_live",
          "listings",
          "halted",
          "layers",
          "breaks",
          "not_current",
          "not_current_total"
        ],
        "type": "object",
        "properties": {
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "name": {
            "type": [
              "null",
              "string"
            ],
            "description": "The venue's own name, when it has told us one."
          },
          "kind": {
            "type": [
              "null",
              "string"
            ],
            "description": "The registry kind of the venue: `order_book`, `oracle` or `spot`."
          },
          "synthetic": {
            "type": "boolean",
            "description": "Whether the venue is a synthetic test segment."
          },
          "connector_live": {
            "type": "boolean",
            "description": "Whether the venue's connector sent a heartbeat that has not expired."
          },
          "listings": {
            "type": "integer",
            "description": "Listings of this venue the platform collects."
          },
          "halted": {
            "type": "integer",
            "description": "Listings the platform would collect and the venue halted. Their data is not collected while the venue does not trade them, so they are in no layer's counts: a halt is the venue's, neither stale nor missing."
          },
          "layers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusLayer"
            },
            "description": "The counts per layer."
          },
          "breaks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusBreak"
            },
            "description": "The venue's connection breaks that have not ended. Empty when `breaks_known` is false does not mean nothing is broken."
          },
          "not_current": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatusNotCurrent"
            },
            "description": "The values that are stale or missing, oldest first, at most a bounded number; `not_current_total` says how many there are in all."
          },
          "not_current_total": {
            "type": "integer",
            "description": "How many values are stale or missing in all."
          },
          "all_collected_stale": {
            "description": "Unique-listing all-stale predicate for real venues; omitted for synthetic venues.",
            "$ref": "#/components/schemas/StatusAllCollectedStale"
          },
          "depth_watch": {
            "required": [
              "total",
              "last_24_hours",
              "since",
              "last_at",
              "last_symbol",
              "last_reason"
            ],
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "Times a guard of the venue's book depth fired since the connector process started."
              },
              "last_24_hours": {
                "type": "integer",
                "description": "Times in the last 24 hours of that process."
              },
              "since": {
                "$ref": "#/components/schemas/Instant"
              },
              "last_at": {
                "$ref": "#/components/schemas/NullableInstant"
              },
              "last_symbol": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The listing it last fired on; null if it has not."
              },
              "last_reason": {
                "enum": [
                  "watchdog",
                  "invalid_book",
                  "partial_coverage"
                ],
                "type": [
                  "null",
                  "string"
                ],
                "description": "Why it last fired: `watchdog` (the derived depth gave no reading for three horizons while the book moved; the book was dropped and laid again), `invalid_book` (a side empty or the book crossed; taken away) or `partial_coverage` (the book's window stayed short of the bands it covers for longer than a renewal should take). Null if it has not fired."
              }
            },
            "additionalProperties": false,
            "description": "What the guards of the venue's book depth have done in its connector process, while the connector is live. Zeros are guards that are armed and have never fired. Operators are alerted from it."
          },
          "book_crossed": {
            "required": [
              "total",
              "last_24_hours",
              "since",
              "last_at",
              "last_symbol"
            ],
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "Times the guard took a crossed book away since the connector process started."
              },
              "last_24_hours": {
                "type": "integer",
                "description": "Times in the last 24 hours of that process."
              },
              "since": {
                "$ref": "#/components/schemas/Instant"
              },
              "last_at": {
                "$ref": "#/components/schemas/NullableInstant"
              },
              "last_symbol": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "The listing it last fired on; null if it has not."
              }
            },
            "additionalProperties": false,
            "description": "Only for a venue whose order book the platform assembles itself, while its connector is live: what the guard against a crossed book has done. Zeros are a guard that is armed and has never fired."
          }
        },
        "additionalProperties": false,
        "description": "Collection status of one venue: whether its connector is live, any open connection breaks, the counts per layer, and the values that are not current."
      },
      "StreamEvent": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/StreamUpdate"
          },
          {
            "$ref": "#/components/schemas/StreamHeartbeat"
          }
        ],
        "description": "The `data:` of one event. `snapshot` and `update` carry a layer of one listing; `heartbeat` carries only the instant. The event name is in the `event:` line, not in the payload."
      },
      "StreamHeartbeat": {
        "required": [
          "evaluated_at"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          }
        },
        "additionalProperties": false,
        "description": "The payload of a `heartbeat` event, every fifteen seconds. It proves the connection is alive when nothing is changing, so silence can be read as a broken connection rather than as a quiet market."
      },
      "StreamUpdate": {
        "required": [
          "evaluated_at",
          "instrument",
          "venue",
          "symbol",
          "quote",
          "layer",
          "status",
          "venue_ts",
          "received_at",
          "values"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when the listing maps to none."
          },
          "instrument_reason": {
            "type": "string",
            "description": "Why it maps to none. Present only when `instrument` is null."
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "symbol": {
            "type": "string",
            "description": "The venue's own symbol."
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "layer": {
            "type": "string",
            "description": "Which layer changed."
          },
          "normalisation_version": {
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store.",
            "$ref": "#/components/schemas/NormalisationVersion"
          },
          "status": {
            "description": "Whether the value is current: `present`, `stale`, `missing`, `not_published` or `off`. Only a `present` value comes with a number. A stale value is withheld, and a missing, unpublished or switched-off one has none, so a value that is not current is never returned as a number.",
            "$ref": "#/components/schemas/Status"
          },
          "reason": {
            "description": "Set when there is no current number, and says why: for example `venue_capability` (the venue does not publish it), `policy_off` (the platform does not collect it for this listing), `no_value` (nothing was received) or, with status `stale`, `horizon_passed`, `connection_lost`, `halted` or `no_update`.",
            "$ref": "#/components/schemas/NullReason"
          },
          "venue_ts": {
            "description": "Venue time: the timestamp the venue itself put on the value, on the venue's own clock, stored as the venue published it. Null where the venue sends no time.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "received_at": {
            "description": "Received time: when the platform received the value, on the platform's own clock. Null when nothing was received.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "age_ms": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The value's age at the instant asked about, in milliseconds (C25-01: one definition of age): from `venue_ts` where its horizon counts from the venue's clock (`anchor: venue`), from `received_at` otherwise."
          },
          "venue_age_ms": {
            "description": "Age by venue time: milliseconds from `venue_ts` to the instant asked about, on the venue's clock whatever the anchor. Null when the venue sends no time. `age_ms` is the age the value is judged by.",
            "$ref": "#/components/schemas/VenueAgeMs"
          },
          "valid_until": {
            "description": "The instant after which the value is no longer current (UTC). At `valid_until` itself it is still current. Null while a push feed's connection is alive and when no cadence fact covers the value.",
            "$ref": "#/components/schemas/ValidUntil"
          },
          "horizon_source": {
            "description": "Where `valid_until` comes from: `venue_declared`, `measured`, `documented`, `assumed` or `connection`. Null when no cadence fact covers the value, which is then stale with reason `horizon_unknown`.",
            "$ref": "#/components/schemas/HorizonSource"
          },
          "anchor": {
            "description": "Which clock the age and the horizon count from: `venue` (the venue's own timestamp, where it sends one and it dates the publication) or `receipt` (`received_at`).",
            "$ref": "#/components/schemas/Anchor"
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Number"
                },
                {
                  "$ref": "#/components/schemas/Liquidity"
                }
              ]
            },
            "description": "The layer's fields, by name, as a layer carries them in `POST /v2/snapshots`."
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "What each value counts."
          },
          "reasons": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/NullReason"
            },
            "description": "Why a value is null, by field."
          },
          "resumed": {
            "type": "boolean",
            "description": "True on the first events after a reconnect. A reconnect is answered with a fresh snapshot, never a replay: a replayed price is a lie about when it was true."
          },
          "withheld": {
            "type": "object",
            "description": "ADR-025: the values of a stale reading, only when the subscription set `allow_stale=true`."
          }
        },
        "additionalProperties": false,
        "description": "The payload of a `snapshot` or an `update` event: one layer of one listing, in the shape a layer takes in `POST /v2/snapshots`.\n\nA status change is an update too. A listing going stale sends an event with its status, the reason and no value (the value only under `withheld`, with `allow_stale=true`) — it never sends a zero, because a client that received a zero would trade on it."
      },
      "TradeEvent": {
        "required": [
          "event_time",
          "instrument",
          "base",
          "quote",
          "multiplier",
          "units",
          "price",
          "size",
          "side",
          "venue_uid",
          "received_at"
        ],
        "type": "object",
        "properties": {
          "event_time": {
            "description": "Venue time: when the trade happened, on the venue's clock.",
            "$ref": "#/components/schemas/Instant"
          },
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code at the trade's event time, or null when the listing mapped to no instrument then."
          },
          "base": {
            "type": [
              "null",
              "string"
            ],
            "description": "The base asset at the trade's event time."
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing was quoted in at the trade's event time."
          },
          "multiplier": {
            "description": "The venue's price multiplier at the trade's event time, where it has one.",
            "$ref": "#/components/schemas/Number"
          },
          "identity_basis": {
            "type": "string",
            "description": "`recorded` or `reconstructed`: whether the mapping interval was written after identity history began."
          },
          "identity_corrected_at": {
            "description": "Start of the next mapping interval for this listing, when one exists.",
            "$ref": "#/components/schemas/Instant"
          },
          "units": {
            "required": [
              "price",
              "size"
            ],
            "type": "object",
            "properties": {
              "price": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "What the price counts; null where it cannot be expressed in the units asked for."
              },
              "size": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "What the size counts; null where it cannot be expressed in the units asked for."
              }
            },
            "additionalProperties": false,
            "description": "What `price` and `size` count."
          },
          "price": {
            "description": "The price, as the venue published it unless `units: base` was asked.",
            "$ref": "#/components/schemas/Number"
          },
          "price_reason": {
            "const": "unit_unknown",
            "description": "Present when `price` is null: `unit_unknown`, the conversion asked for needs a contract size that is not known."
          },
          "size": {
            "description": "The size, as the venue published it unless `units: base` was asked.",
            "$ref": "#/components/schemas/Number"
          },
          "size_reason": {
            "const": "unit_unknown",
            "description": "Present when `size` is null: `unit_unknown`, the conversion asked for needs a contract size that is not known."
          },
          "side": {
            "type": "string",
            "description": "The trade's side as the venue states it."
          },
          "venue_uid": {
            "type": "string",
            "description": "The venue's own identifier of the trade. It tells apart several trades at one instant."
          },
          "received_at": {
            "description": "Received time: when the platform received the trade.",
            "$ref": "#/components/schemas/Instant"
          }
        },
        "additionalProperties": false,
        "description": "One trade as the venue published it, with the mapping of the listing at its event time."
      },
      "TradeGap": {
        "required": [
          "from",
          "to",
          "reason",
          "dataset"
        ],
        "type": "object",
        "properties": {
          "from": {
            "description": "Where the stretch begins, not before the interval's own start.",
            "$ref": "#/components/schemas/Instant"
          },
          "to": {
            "description": "Where it ends, not after the interval's own end; null for a recorded hole whose end was never recorded.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "reason": {
            "description": "`not_retained`: older than what is kept for this listing (`retention_from`). `collector_gap`: the platform recorded a hole; `gap_cause` says what.",
            "$ref": "#/components/schemas/NullReason"
          },
          "gap_cause": {
            "type": "string",
            "description": "With reason `collector_gap`: what the platform recorded."
          },
          "dataset": {
            "const": "trade",
            "description": "Always `trade`."
          }
        },
        "additionalProperties": false,
        "description": "A stretch of the interval in which the trade history is known to be incomplete, or older than what is kept."
      },
      "TradeStreamEvent": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/TradeStreamMetadata"
          },
          {
            "$ref": "#/components/schemas/MarketEnvelope"
          }
        ],
        "description": "The `data:` payload of the initial `metadata` event or a later raw `trade` event. The SSE event name and connection-local id are transport metadata."
      },
      "TradeStreamMetadata": {
        "required": [
          "evaluated_at",
          "kind",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot",
              "all"
            ],
            "type": "string",
            "description": "The market kind selected: `perpetual`, `spot` or `all`."
          },
          "items": {
            "type": "array",
            "items": {
              "required": [
                "venue",
                "instrument",
                "symbol",
                "kind",
                "status",
                "live_collection"
              ],
              "type": "object",
              "properties": {
                "venue": {
                  "type": "string",
                  "description": "The venue's public code."
                },
                "instrument": {
                  "type": [
                    "null",
                    "string"
                  ],
                  "description": "The platform's code, or null when the listing maps to no instrument."
                },
                "symbol": {
                  "type": "string",
                  "description": "The venue's own symbol."
                },
                "kind": {
                  "enum": [
                    "perpetual",
                    "spot"
                  ],
                  "type": "string",
                  "description": "The market kind of the listing: `perpetual` or `spot`."
                },
                "status": {
                  "$ref": "#/components/schemas/Status"
                },
                "reason": {
                  "type": "string",
                  "description": "Why the listing is not live, present when `status` is not `present`."
                },
                "live_collection": {
                  "enum": [
                    "on",
                    "off"
                  ],
                  "type": "string",
                  "description": "`on` when the platform collects the listing's trades live, so `trade` events will follow; `off` when it does not."
                }
              },
              "additionalProperties": false
            },
            "description": "The selected listings."
          }
        },
        "additionalProperties": false,
        "description": "The first event of `GET /v2/trades/stream`: which listings the stream was opened for and whether each is collected live."
      },
      "TradesItem": {
        "required": [
          "instrument",
          "venue",
          "kind",
          "venue_symbol",
          "quote",
          "status",
          "retention_from",
          "units",
          "truncated",
          "events",
          "gaps"
        ],
        "type": "object",
        "properties": {
          "instrument": {
            "type": [
              "null",
              "string"
            ],
            "description": "The platform's code, or null when this listing maps to no instrument."
          },
          "reason": {
            "type": "string",
            "description": "Present when `instrument` is null (why the listing maps to no instrument) and when `status` is not `present` (why there are no trades: `policy_off`, `venue_capability` or `no_value`)."
          },
          "venue": {
            "type": "string",
            "description": "The venue's public code."
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot"
            ],
            "type": "string",
            "description": "The market kind of this listing: `perpetual` or `spot`."
          },
          "venue_symbol": {
            "type": "string",
            "description": "The venue's own symbol, spelled as the venue spells it."
          },
          "quote": {
            "type": [
              "null",
              "string"
            ],
            "description": "What the listing is quoted in."
          },
          "identity_basis": {
            "type": "string",
            "description": "`recorded` or `reconstructed`: whether the mapping interval was written after identity history began."
          },
          "identity_corrected_at": {
            "description": "Start of the next mapping interval for this listing, when one exists.",
            "$ref": "#/components/schemas/Instant"
          },
          "status": {
            "description": "Whether trades are collected for this listing: `present`, or `off` when the platform does not collect them for it, `not_published` when the venue does not publish them.",
            "$ref": "#/components/schemas/Status"
          },
          "retention_from": {
            "description": "The earliest instant trades are kept for this listing. A question about anything earlier is a `not_retained` gap.",
            "$ref": "#/components/schemas/NullableInstant"
          },
          "units": {
            "required": [
              "price",
              "size"
            ],
            "type": "object",
            "properties": {
              "price": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "What the price counts; null where it cannot be expressed in the units asked for."
              },
              "size": {
                "type": [
                  "null",
                  "string"
                ],
                "description": "What the size counts; null where it cannot be expressed in the units asked for."
              }
            },
            "additionalProperties": false,
            "description": "What `price` and `size` count."
          },
          "truncated": {
            "type": "boolean",
            "description": "True when the interval held more trades than `limit`: the events shown are the newest, and an earlier part of the interval is not shown. It does not say the interval is complete when false: read `gaps`."
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TradeEvent"
            },
            "description": "The trades of the interval in ascending event time, each once."
          },
          "gaps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TradeGap"
            },
            "description": "Where the trade history is known to be incomplete, written out so that an empty stretch is never read as a quiet market. Filled only with `include_gaps`; empty otherwise, which does not mean the interval is complete."
          }
        },
        "additionalProperties": false,
        "description": "Trade history and known coverage for one selected listing."
      },
      "TradesRequest": {
        "type": "object",
        "properties": {
          "where": {
            "$ref": "#/components/schemas/Selection"
          },
          "kind": {
            "enum": [
              "perpetual",
              "spot",
              "all"
            ],
            "type": "string",
            "description": "Market kind to select. Defaults to perpetual; `all` includes spot and perpetual listings.",
            "default": "perpetual"
          },
          "from": {
            "description": "Exclusive start of the event-time interval; defaults to seven days before `to`.",
            "$ref": "#/components/schemas/Instant"
          },
          "to": {
            "description": "Inclusive end of the event-time interval; defaults to `as_of` or now.",
            "$ref": "#/components/schemas/Instant"
          },
          "as_of": {
            "description": "Receipt-time availability cutoff. Future cutoffs are refused.",
            "$ref": "#/components/schemas/Instant"
          },
          "limit": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "description": "Maximum newest events per listing. Returned events are ascending; `truncated` indicates more rows existed.",
            "default": 50
          },
          "include_gaps": {
            "type": "boolean",
            "description": "Include known trade dataset gaps and retention boundaries.",
            "default": true
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "What quantities are expressed in: `published` leaves each venue's own unit alone, `base` converts to the base asset and gives null with `unit_unknown` where a contract size is not known.",
            "default": "published"
          },
          "number_format": {
            "enum": [
              "json",
              "string"
            ],
            "type": "string",
            "description": "`string` returns every number as a string with the same digits.",
            "default": "json"
          },
          "include_synthetic": {
            "type": "boolean",
            "description": "Include venues that exist in the registry but are not published. For the platform's own use; a public key sees nothing extra.",
            "default": false
          }
        },
        "additionalProperties": false,
        "description": "Stored trade events for selected listings and an event-time interval."
      },
      "TradesResponse": {
        "required": [
          "evaluated_at",
          "settled",
          "items_sha256",
          "from",
          "to",
          "units",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "resolved_from": {
            "$ref": "#/components/schemas/ResolvedFrom"
          },
          "trial": {
            "$ref": "#/components/schemas/Trial"
          },
          "data_as_of": {
            "description": "The receipt-time availability cutoff; present when `as_of` was requested.",
            "$ref": "#/components/schemas/Instant"
          },
          "settled": {
            "type": "boolean",
            "description": "Whether the interval is far enough in the past that a late arrival can no longer change it."
          },
          "items_sha256": {
            "pattern": "^[a-f0-9]{64}$",
            "type": "string",
            "description": "SHA-256 of `items` as serialised."
          },
          "from": {
            "description": "The exclusive start of the event-time interval.",
            "$ref": "#/components/schemas/Instant"
          },
          "to": {
            "description": "The inclusive end of the event-time interval.",
            "$ref": "#/components/schemas/Instant"
          },
          "units": {
            "enum": [
              "published",
              "base"
            ],
            "type": "string",
            "description": "The unit mode applied."
          },
          "normalisation_version": {
            "type": "string",
            "description": "Present only with `units: base`: which conversion rules produced the figures, such as `2026-10-07`. Keep it beside numbers you store."
          },
          "listings_as_of": {
            "description": "When the set of listings was last known to change. Present when asking about the past.",
            "$ref": "#/components/schemas/Instant"
          },
          "capabilities_as_of": {
            "description": "When what each venue publishes was last known to change.",
            "$ref": "#/components/schemas/Instant"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TradesItem"
            },
            "description": "One object per listing."
          }
        },
        "additionalProperties": false,
        "description": "Stored trade events in the requested event-time interval, with explicit known gaps."
      },
      "Trial": {
        "required": [
          "plan",
          "until"
        ],
        "type": "object",
        "properties": {
          "plan": {
            "type": "string"
          },
          "until": {
            "$ref": "#/components/schemas/Instant"
          },
          "layer": {
            "type": "string"
          },
          "asked_days": {
            "type": "integer"
          },
          "cap": {
            "type": "string"
          },
          "limit": {
            "type": "integer"
          }
        },
        "additionalProperties": false,
        "description": "On the answer that opened the Standard trial only: `until` (UTC) ends it."
      },
      "Unit": {
        "examples": [
          "base",
          "quote",
          "ratio"
        ],
        "type": "string",
        "description": "What the number counts: `base` for the base asset, `quote` for the quote currency, `contracts` for the venue's own contract, `ratio`, `bps`, `percent`, `ms`. Absent where the value is not a quantity."
      },
      "ValidUntil": {
        "type": [
          "null",
          "string"
        ],
        "description": "ADR-025: the instant after which the value is no longer treated as current (UTC). Null while a push feed's connection is alive (`horizon_source: connection`) and when no fact covers the value. At `valid_until` itself the value is still current.",
        "format": "date-time"
      },
      "Value": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/SnapshotValue"
          },
          {
            "$ref": "#/components/schemas/SeriesValue"
          },
          {
            "$ref": "#/components/schemas/ReferenceValue"
          },
          {
            "$ref": "#/components/schemas/AggregateValue"
          },
          {
            "$ref": "#/components/schemas/DerivedValue"
          }
        ],
        "description": "One value with everything needed to judge it: what it is, which venue published it, when it arrived, how old it was, and whether that made it usable. Every number the platform returns is wrapped this way — a bare number cannot say whether it is three seconds or three hours old.\n\nFive variants, told apart by their own properties: a snapshot reading, a series reading, an instrument's reference field, an aggregate across venues, and a value derived from others."
      },
      "ValueMap": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/Value"
        },
        "description": "The values a `select` asked for, by the name it asked for them under."
      },
      "VenueAgeMs": {
        "type": [
          "null",
          "integer"
        ],
        "description": "ADR-025: milliseconds between the venue's own timestamp (`venue_ts`) and the instant asked about — the venue's clock whatever the anchor; `age_ms` is the age the value is judged by. Null when the venue sends no time."
      },
      "VenuesResponse": {
        "required": [
          "evaluated_at",
          "registry_revision",
          "next_cursor",
          "items"
        ],
        "type": "object",
        "properties": {
          "evaluated_at": {
            "description": "The instant the platform evaluated this answer at (UTC).",
            "$ref": "#/components/schemas/Instant"
          },
          "served_at": {
            "description": "The response's own as-of instant (the same as `evaluated_at`, six fractional digits). Replay it with `as_of`.",
            "$ref": "#/components/schemas/ServedAt"
          },
          "receipt_id": {
            "description": "Names this exact response. Log it next to the decision made from it.",
            "$ref": "#/components/schemas/ReceiptId"
          },
          "registry_revision": {
            "type": "string",
            "description": "Stable registry snapshot identity shared by all pages: the UTC Snapshot.ReadAt timestamp, a dot, and the lowercase SHA-256 digest of the effective registry row, identity, policy, and catalogue-version projection."
          },
          "next_cursor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Opaque continuation cursor for the next page. Null means this is the last page. Keep all other request options unchanged; a stale cursor or changed scope returns `DQL_CURSOR` and requires restarting from the first page."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollectedVenue"
            },
            "description": "The venues, by public code."
          }
        },
        "additionalProperties": false,
        "description": "A bounded page of venues in DQL. Follow `next_cursor` until null to read the complete catalogue. No key: a reader must be able to see what exists before deciding to pay for it."
      }
    },
    "securitySchemes": {
      "key": {
        "type": "http",
        "description": "A key from studio.debyko.com/account, as `Authorization: Bearer <key>`. Never in a URL.",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "Coverage",
      "description": "What exists and what may be asked — free to read, no key.\n\nThese endpoints describe the platform: which venues and instruments are collected, what a query may\nask for and within which limits, and whether a query you have written is valid. None of them returns a\nvenue's figure, so none of them needs a key — you can see what exists, and check your query against the\nreal grammar, before deciding to buy an answer.\n\nThe same coverage is published as a page on [debyko.com](https://debyko.com/data/coverage/); this is\nthe machine-readable form of it, and it is generated from the same registry the collectors work from,\nso the two cannot drift apart.\n\n`GET /v2/plans` is the plans the same way: every plan sold from the site, its price and each limit, read\nfrom the plan table the server enforces them from, so the numbers are the ones a key is held to.\n"
    },
    {
      "name": "Measurements",
      "description": "What the venues published. Every one of these needs a key.\n\nEvery `/v2` endpoint that returns a measurement needs a key:\n\n```\nAuthorization: Bearer dbk_…\n```\n\nA key is issued at [studio.debyko.com/account](https://studio.debyko.com/account). The Free plan is\nissued without a card; Mini, Standard and Pro start with a free trial, and Pro Plus is charged at\ncheckout. One key covers Studio and the API — whatever a plan includes in Studio, it includes here. Agent evaluates under its own allowance, shown in its row.\n\n**Never in a URL.** A key in a query string is written into server logs, proxy logs and browser\nhistory. A request that carries one is refused with `KEY_IN_URL` and the key should be replaced from\nyour account.\n\n## What a plan changes\n\nA plan limits history and request rates; every plan sees every venue and instrument:\n\n- **venues and instruments**: every plan sees every venue and instrument in the registry. `DQL_UNKNOWN_VENUE`\n  is for a code that is no venue at all;\n- **history**: asking further back than a plan reaches is refused with `PLAN_LIMIT`, naming the date\n  the plan reaches and what it would take to go further — never a shortened answer that looks whole.\n  The error carries `next` (one sentence with the earliest instant the plan reads for this request) and, for\n  `POST /v2/candles`, `earliest_from` and `retry_with`: the same request with `from` moved to that instant.\n  The first such refusal of a Free account that has never had a trial is not shown: Standard answers the request, the\n  answer carries `trial` (`plan`, `until`), and Standard stays open for 4 days (`plan.trial_until` of `GET /v2/account`).\n  The first refusal of Free's number of Agent rules, DQL screening requests a minute or requests a day opens it the same way\n  (`trial.cap`, `trial.limit`); the per-second burst does not. One trial per account, ever; at `until` the account is Free again.\n  Free, Mini and Standard read every candle timeframe, as deep as the timeframe allows: Free `1m` 48 hours, `5m` and `15m` 7 days, `1h` 30 days,\n  `4h` and `1d` 90 days; Mini 7, 30, 90 and 180 days; Standard, Pro and Pro Plus the whole database window. Everything else (snapshots, history, trades,\n  liquidations, funding settlements, `screen`) reaches the plan's `history_days` (Free 7, Mini 30; Standard, Pro and Pro Plus the database window).\n  How long each layer is held in the database is a number per layer and candle timeframe, read from the retention classes in force: `history` of `GET /v2/account`\n  (and of every plan in `GET /v2/plans`) gives `hot_days` (the shortest of any listing), `reads_days` (what this plan reads of it), `archive_since` (the first\n  day with a verified file) and `archive.files_per_month`. A request (history, trades or candles) that lies wholly before the hot window of everything it asks for is refused `PLAN_LIMIT` with the\n  layer, the window in days and the earliest hot instant, and then one of: the exact `GET /v2/archive/{listing}/{layer}/{day}` when that day has a file; `no data before <date>`\n  when the venue has none that early; or that the archive has no file for the day. A request that reaches into the window is answered, and what is older is `not_retained`, with the archive pointer where\n  a file exists. No Parquet is served through the other endpoints; per file, x402 pays when there is no key. `funding_settlement` and `liquidation` are not swept (`history.not_swept`).\n  `GET /v2/plans` lists the depth of every plan (`history_days`, and `candle_history_days` for each timeframe);\n- **rate**: requests per second and per day, and the number of live streams, are counted per key.\n  The per-second limit is a token bucket: the plan's sustained rate refills it and its burst (4 times the rate, at least 10: Free is 2 a second, burst 10) is\n  what a key may send at once. Exceeding a limit is a `429` with `Retry-After` and, in `limit`, the name of the limit that stopped you.\n\nUsage is counted per key, per hour and per endpoint class, and is visible in your account. No\nper-request log of what you asked is kept.\n\n## Without a key: pay per call\n\n**On in production since 2026-10-02.** Six requests are payable without a key: `POST /v2/snapshots`, `POST /v2/snapshots/history`, `POST /v2/screen`,\n`POST /v2/candles`, `GET /v2/agent/state` (per rule named) and `GET /v2/archive/{listing}/{layer}/{day}` (per file). Called with no `Authorization` header they\nare answered `402` with a price in USDC on Base ([x402](https://www.x402.org)), and the same request\nwith a signed payment in `PAYMENT-SIGNATURE` is answered as Pro answers it, for that one request. A request that carries both a key and a payment is the\nkey's: the payment is not read. The prices, the order, and what is charged when something goes wrong are in the [limits](#limits) and at\n[docs.debyko.com/api/x402](https://docs.debyko.com/api/x402/).\n\nThe same 402 also offers **a plan** (Mini, Standard, Pro, Pro Plus, at the price of checkout) for 30 days with no renewal: pay its amount and the answer is a key of that plan, shown once, with no account\n(Agent rules need a free account the key is linked to). From three days before such a key expires every response carries `X-Debyko-Key-Expires`. `GET /v2/agent/state` is payable per rule named, and a file of the [archive](https://docs.debyko.com/data/archive/) per file (0.10 core, 0.05 top-100).\n[Pay with USDC](https://docs.debyko.com/api/pay-with-usdc/) has the whole of it.\n"
    }
  ]
}
