query_cross_section
Rank all coins for one day of a daily cross-section dataset (one row per coin per day, e.g. gold_positioning_funding_factors_1d) in a single call. Pass order_by (a numeric column), day (YYYY-MM-DD or "latest"), optional top_n (default 20), descending (default true), columns, and coins. Replaces fanning out read_dataset per coin. For a single coin's series use read_dataset.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| day | Yes | UTC day to rank, `YYYY-MM-DD`, or `"latest"` for the newest available day. | |
| asset | Yes | Dataset name. Must be a daily coin cross-section (one row per coin per `day`), e.g. `gold_positioning_funding_factors_1d`. | |
| coins | No | Optional: restrict to these coins. Coins outside the caller's plan are dropped. Omit to rank every coin the plan allows. | |
| top_n | No | Max coins to return (clamped to 1000). Defaults to 20. | |
| columns | No | Extra columns to include per row (besides `coin`, `day`, and `order_by`). Omit to return every column. | |
| order_by | Yes | Numeric column to rank coins by, e.g. a `factor_*` column. Call `describe_dataset` to see the options. | |
| descending | No | Sort direction. Defaults to true — highest `order_by` first. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| day | Yes | The day actually ranked (resolved when `day="latest"`), `YYYY-MM-DD`. | |
| note | No | Advisories: latest-day resolution, coins with no row that day (coverage varies by day), coins excluded for a null/non-numeric `order_by`, and any partitions skipped on a read error. | |
| rows | Yes | One object per coin, ranked; each includes `coin`, `day`, `order_by` and any requested `columns`. | |
| asset | Yes | ||
| columns | Yes | Columns present in each returned row. | |
| order_by | Yes | ||
| coin_count | Yes | Number of coins ranked (rows returned). | |
| descending | Yes |