> ## Documentation Index
> Fetch the complete documentation index at: https://tokenterminal.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To query the Token Terminal Data Catalog, read https://tokenterminal.com/docs/catalog/agents-manual.md first. It is the whole catalog as one page: table naming grammar, key columns, partition and cluster rules, units, additivity, and the tables that are documented but not served yet.
> Never query a catalog table on a time bound alone. Also filter its cluster key, which you read from INFORMATION_SCHEMA.COLUMNS; an empty result means the object is a view, whose pruning contract is on its page. Compute is billed to the caller's own Google Cloud project.

# Screener

> Rank perpetual futures markets by open interest, fees and trading volume across six windows.

One row per perpetual futures market in `screeners.perp_markets`, every figure as of `as_of`, the last complete day. For daily history, see [Metrics](https://tokenterminal.com/docs/catalog/perpetuals/metrics.md).

## Columns

> [tab] Keys
>
> The two key columns, then one FLOAT64 column per measure, window and aggregation. Join to the [market registry](https://tokenterminal.com/docs/catalog/perpetuals/registry.md) on `perp_market_id` for the market name, venue and chain.
>
> <table>
>   <thead>
>     <tr>
>       <th width="230">Column</th>
>       <th width="130">Type</th>
>       <th>Description</th>
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr><td>`as_of`</td><td>TIMESTAMP</td><td>The last complete day, the same on every row. Every window ends on it.</td></tr>
>     <tr><td>`perp_market_id`</td><td>STRING</td><td>Market identifier, such as `hlbtc-hypercore`.</td></tr>
>   </tbody>
> </table>

> [tab] Aggregations
>
> A window is `1d`, `7d`, `30d`, `90d`, `180d` or `365d`, and spans that many days ending on `as_of`, while the `max_` columns read the whole history. Which aggregations a measure has follows its `over_time` in [Metric definitions](https://tokenterminal.com/docs/catalog/metric-definitions.md): only a measure whose `over_time` is `sum` has `sum`.
>
> <table>
>   <thead>
>     <tr>
>       <th width="380">Column</th>
>       <th>What it holds</th>
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr><td>`<measure>_<window>_avg`</td><td>Mean of the daily values over the window.</td></tr>
>     <tr><td>`<measure>_<window>_sum`</td><td>Total of the daily values over the window. Flows only: the measures ticked under Sum.</td></tr>
>     <tr><td>`<measure>_<window>_change`</td><td>A comparison of two aggregations: the value on `as_of` against the value one window earlier, as `(now - then) / abs(then)`. Null when either value is missing or the earlier one is 0.</td></tr>
>     <tr><td>`<measure>_<window>_trend`</td><td>A comparison of two aggregations: the window's average against the average of the window before it, as `(avg - prior) / abs(prior)`. Null unless the window before has a value on every one of its days, and null when its average is 0.</td></tr>
>     <tr><td>`<measure>_max_latest`</td><td>The value on `as_of`. Null when there is none.</td></tr>
>     <tr><td>`<measure>_max_ath`</td><td>The highest daily value over the market's whole history.</td></tr>
>     <tr><td>`<measure>_max_atl`</td><td>The lowest daily value over the market's whole history.</td></tr>
>   </tbody>
> </table>

> [tab] Measures
>
> Every measure has the `avg`, `change`, `trend` and `max_` columns, and the flows also have `sum`.
>
> <table>
>   <thead>
>     <tr>
>       <th width="280">Measure</th>
>       <th>Sum</th>
>       <th>What it holds</th>
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr><td>`daily_active_traders`</td><td>✗</td><td>Distinct traders active in the perpetual futures market.</td></tr>
>     <tr><td>`daily_active_traders_long`</td><td>✗</td><td>Distinct traders with long positions in the perpetual futures market.</td></tr>
>     <tr><td>`daily_active_traders_short`</td><td>✗</td><td>Distinct traders with short positions in the perpetual futures market.</td></tr>
>     <tr><td>`funding_rate`</td><td>✗</td><td>Daily funding rate paid between long and short positions in the perpetual futures market.</td></tr>
>     <tr><td>`open_interest`</td><td>✗</td><td>Notional value of open positions in the perpetual futures market.</td></tr>
>     <tr><td>`open_interest_long`</td><td>✗</td><td>Notional value of open long positions in the perpetual futures market.</td></tr>
>     <tr><td>`open_interest_short`</td><td>✗</td><td>Notional value of open short positions in the perpetual futures market.</td></tr>
>     <tr><td>`position_size_average_long`</td><td>✗</td><td>Average notional size of long positions in the perpetual futures market.</td></tr>
>     <tr><td>`position_size_average_short`</td><td>✗</td><td>Average notional size of short positions in the perpetual futures market.</td></tr>
>     <tr><td>`position_size_median_long`</td><td>✗</td><td>Median notional size of long positions in the perpetual futures market.</td></tr>
>     <tr><td>`position_size_median_short`</td><td>✗</td><td>Median notional size of short positions in the perpetual futures market.</td></tr>
>     <tr><td>`price`</td><td>✗</td><td>Mark price of the perpetual futures market.</td></tr>
>     <tr><td>`trader_share_long_top10`</td><td>✗</td><td>Share of long open interest held by the ten largest long traders.</td></tr>
>     <tr><td>`trader_share_short_top10`</td><td>✗</td><td>Share of short open interest held by the ten largest short traders.</td></tr>
>     <tr><td>`volume_to_open_interest`</td><td>✗</td><td>Notional trading volume divided by open interest.</td></tr>
>     <tr><td>`fees`</td><td>✓</td><td>Fees paid by traders on the perpetual market.</td></tr>
>     <tr><td>`fees_supply_side`</td><td>✓</td><td>Fees passed through on the perpetual market, being the builder-code tip plus the HIP-3 deployer's cut.</td></tr>
>     <tr><td>`liquidation_volume_long`</td><td>✓</td><td>Notional value of long positions force-closed in the perpetual futures market.</td></tr>
>     <tr><td>`liquidation_volume_short`</td><td>✓</td><td>Notional value of short positions force-closed in the perpetual futures market.</td></tr>
>     <tr><td>`notional_trading_volume_exchange`</td><td>✓</td><td>Notional value traded in the perpetual futures market, attributed to the app whose matching engine settled the trade.</td></tr>
>     <tr><td>`notional_trading_volume_interface`</td><td>✓</td><td>Notional value traded in the perpetual futures market, attributed to the app whose interface the trade was placed through.</td></tr>
>     <tr><td>`revenue`</td><td>✓</td><td>Fees retained by the protocol on the perpetual market, net of the builder tip and HIP-3 deployer cut.</td></tr>
>     <tr><td>`trade_count`</td><td>✓</td><td>Number of trades executed in the perpetual futures market.</td></tr>
>   </tbody>
> </table>

## Sample queries

> [tab] One market
>
> Read the latest open interest, its change from seven days earlier and the fees over the last 30 days for one BTC market.
>
> ```sql theme={null}
> select
>     as_of,
>     open_interest_max_latest,
>     open_interest_7d_change,
>     fees_30d_sum
> from `screeners.perp_markets`
> where perp_market_id = 'hlbtc-hypercore'
> ```

> [tab] Top 25 by volume
>
> Rank markets by the last 30 days of notional trading volume attributed to the exchange that settled the trades.
>
> ```sql theme={null}
> select
>     perp_market_id,
>     markets.name,
>     screener.notional_trading_volume_exchange_30d_sum
> from `screeners.perp_markets` as screener
> join `dimensions.perp_markets` as markets using (perp_market_id)
> where screener.notional_trading_volume_exchange_30d_sum is not null
> order by screener.notional_trading_volume_exchange_30d_sum desc, perp_market_id
> limit 25
> ```

> [tab] Biggest open interest moves
>
> Rank markets by the size of their 30-day change in open interest. The signed change shows whether open interest rose or fell.
>
> ```sql theme={null}
> select perp_market_id, open_interest_max_latest, open_interest_30d_change
> from `screeners.perp_markets`
> where open_interest_30d_change is not null
> order by abs(open_interest_30d_change) desc, perp_market_id
> limit 25
> ```

> [tab] Fees per dollar traded
>
> Divide fees by exchange-attributed notional volume over the same 30 days.
>
> ```sql theme={null}
> select
>     perp_market_id,
>     safe_divide(fees_30d_sum, notional_trading_volume_exchange_30d_sum) as fees_per_dollar
> from `screeners.perp_markets`
> where notional_trading_volume_exchange_30d_sum > 0
>   and fees_30d_sum is not null
> order by fees_per_dollar desc, perp_market_id
> limit 25
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.