> ## 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.

# Registry

> Perpetual and order-book market identity, settlement tokens and which apps get credit.

Market identity lives in two registry tables.

* `dimensions.perp_markets`: one row per perpetual futures market.
* `dimensions.order_book_markets`: one row per order-book market that has traded, covering spot books and outcome markets.

## Tables

<Tabs>
  <Tab title="Perpetual futures">
    A perpetual future is a contract that tracks the price of something without ever expiring: nobody holds the thing itself, and traders settle up in a token instead. `dimensions.perp_markets` says who runs each market and what it tracks. `base_reference_asset_id` names the thing whose price the market follows. `quote_asset_id` names the token positions settle in.

    Each market credits two apps. `exchange_app_id` is the venue that matches buyers with sellers and settles the trades. `interface_app_id` is whoever built the front end the trades came through; on the venue's own markets the two read the same. Notional volume, the total value of the contracts traded rather than cash changing hands, is published under both, in two separate columns. Each column is a complete account of the same trades, so adding them counts every trade twice.

    <table>
      <thead>
        <tr>
          <th width="280">Column</th>
          <th width="130">Type</th>
          <th>Description</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td><code>perp\_market\_id</code></td>
          <td><code>STRING</code></td>
          <td>Identifier of the market.</td>
        </tr>

        <tr>
          <td><code>project\_id</code></td>
          <td><code>STRING</code></td>
          <td>Project the exchange app belongs to.</td>
        </tr>

        <tr>
          <td><code>interface\_app\_id</code></td>
          <td><code>STRING</code></td>
          <td>The app whose front end the trades came through.</td>
        </tr>

        <tr>
          <td><code>chain\_id</code></td>
          <td><code>STRING</code></td>
          <td>Chain the market settles on.</td>
        </tr>

        <tr>
          <td><code>exchange\_app\_id</code></td>
          <td><code>STRING</code></td>
          <td>The venue that matches buyers with sellers.</td>
        </tr>

        <tr>
          <td><code>quote\_asset\_id</code></td>
          <td><code>STRING</code></td>
          <td>The token positions settle in, keyed like <code>dimensions.assets</code>.</td>
        </tr>

        <tr>
          <td><code>base\_reference\_asset\_id</code></td>
          <td><code>STRING</code></td>
          <td>The thing whose price the market follows, keyed like <code>dimensions.reference\_assets</code>.</td>
        </tr>

        <tr>
          <td><code>name</code></td>
          <td><code>STRING</code></td>
          <td>Readable market name, for example <code>BTC Perpetual</code>.</td>
        </tr>

        <tr>
          <td><code>status</code></td>
          <td><code>STRING</code></td>
          <td>Whether the market is still listed: <code>active</code> for every current row.</td>
        </tr>
      </tbody>
    </table>
  </Tab>

  <Tab title="Order-book markets">
    An order-book market is an ordinary market where the token itself changes hands, matched through a book of buy and sell orders. `dimensions.order_book_markets` is built from the markets that have traded rather than written out market by market, so nothing that traded is missing. `app_id` names the single app running the book.

    `quote_asset_id` is what lets us report volume in dollars without looking a price up. Every quote token we accept is a stablecoin worth about a dollar, so the size of a trade times its price is already its dollar value. The accepted list is short by design: `usdc`, `usdh`, `usdt0` and `usde`. A market quoted in anything else is held back rather than reported in dollars.

    <table>
      <thead>
        <tr>
          <th width="280">Column</th>
          <th width="130">Type</th>
          <th>Description</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td><code>order\_book\_market\_id</code></td>
          <td><code>STRING</code></td>
          <td>Identifier of the market.</td>
        </tr>

        <tr>
          <td><code>project\_id</code></td>
          <td><code>STRING</code></td>
          <td>Project the operating app belongs to.</td>
        </tr>

        <tr>
          <td><code>app\_id</code></td>
          <td><code>STRING</code></td>
          <td>The app running the book.</td>
        </tr>

        <tr>
          <td><code>chain\_id</code></td>
          <td><code>STRING</code></td>
          <td>Chain the book settles on.</td>
        </tr>

        <tr>
          <td><code>quote\_asset\_id</code></td>
          <td><code>STRING</code></td>
          <td>The token volume is measured in, keyed like <code>dimensions.assets</code>.</td>
        </tr>

        <tr>
          <td><code>base\_symbol</code></td>
          <td><code>STRING</code></td>
          <td>Symbol of the traded token.</td>
        </tr>

        <tr>
          <td><code>name</code></td>
          <td><code>STRING</code></td>
          <td>Readable pair name, for example <code>HYPE/USDC</code>.</td>
        </tr>

        <tr>
          <td><code>created\_at</code></td>
          <td><code>TIMESTAMP</code></td>
          <td>When we first saw the market trade.</td>
        </tr>
      </tbody>
    </table>
  </Tab>
</Tabs>

## Sample queries

<Tabs>
  <Tab title="Markets per interface app">
    **Count markets per interface app.**

    ```sql theme={null}
    select
        interface_app_id,
        count(*) as markets
    from `dimensions.perp_markets`
    group by interface_app_id
    order by markets desc
    ```
  </Tab>

  <Tab title="Markets per app and quote asset">
    **Count markets per app and quote asset.**

    ```sql theme={null}
    select
        app_id,
        quote_asset_id,
        count(*) as markets
    from `dimensions.order_book_markets`
    group by app_id, quote_asset_id
    order by markets desc
    ```
  </Tab>
</Tabs>

## Notes

A perpetual market points at a reference asset, because it only follows a price and never holds a token. An order-book market names its traded token by symbol alone. Symbols are not unique, several contracts can share one, so the table states `base_symbol` and stops there rather than guessing which contract is meant.
