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

> Every lending market: one asset inside one lending pool.

`dimensions.lending_markets` holds one row per lending market: one asset inside one lending pool, the asset users supply and borrow there. Lending protocols usually call that a reserve. The table brings together every lending protocol we cover.

## Columns

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

  <tbody>
    <tr>
      <td><code>lending\_market\_id</code></td>
      <td><code>STRING</code></td>
      <td>Market key: <code>lending\_market\_address</code> joined to <code>chain\_id</code>.</td>
    </tr>

    <tr>
      <td><code>deployment\_id</code></td>
      <td><code>STRING</code></td>
      <td>Protocol version deployed on one chain, such as <code>aave-v3-ethereum</code>.</td>
    </tr>

    <tr>
      <td><code>protocol\_id</code></td>
      <td><code>STRING</code></td>
      <td>Protocol version across chains, such as <code>aave-v3</code>.</td>
    </tr>

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

    <tr>
      <td><code>project\_id</code></td>
      <td><code>STRING</code></td>
      <td>Project operating the protocol.</td>
    </tr>

    <tr>
      <td><code>version</code></td>
      <td><code>STRING</code></td>
      <td>Protocol version label, such as <code>v3</code>.</td>
    </tr>

    <tr>
      <td><code>lending\_pool\_address</code></td>
      <td><code>STRING</code></td>
      <td>Contract of the pool this market belongs to.</td>
    </tr>

    <tr>
      <td><code>lending\_pool\_name</code></td>
      <td><code>STRING</code></td>
      <td>Readable name of the pool, such as <code>Core</code> or <code>Polygon</code>.</td>
    </tr>

    <tr>
      <td><code>lending\_market\_address</code></td>
      <td><code>STRING</code></td>
      <td>Contract that identifies the market: the receipt token where the protocol issues one, the supplied token itself where it does not.</td>
    </tr>

    <tr>
      <td><code>underlying\_token\_address</code></td>
      <td><code>STRING</code></td>
      <td>Contract of the token users supply and borrow in this market.</td>
    </tr>

    <tr>
      <td><code>underlying\_symbol</code></td>
      <td><code>STRING</code></td>
      <td>Symbol of the underlying asset.</td>
    </tr>

    <tr>
      <td><code>market\_name</code></td>
      <td><code>STRING</code></td>
      <td>Display name of the market.</td>
    </tr>
  </tbody>
</table>

## Sample queries

<Tabs>
  <Tab title="Markets per chain">
    **Count markets per chain and version.**

    ```sql theme={null}
    select
        chain_id,
        version,
        count(*) as markets
    from `dimensions.lending_markets`
    where project_id = 'aave'
    group by chain_id, version
    order by markets desc
    ```
  </Tab>

  <Tab title="Markets in one pool">
    **List every market in one pool.**

    ```sql theme={null}
    select
        lending_market_id,
        underlying_symbol,
        market_name,
        underlying_token_address
    from `dimensions.lending_markets`
    where lending_pool_name = 'Core'
    order by underlying_symbol
    ```
  </Tab>

  <Tab title="Markets for one asset">
    **Find every market that lends one asset.**

    ```sql theme={null}
    select
        lending_market_id,
        chain_id,
        version,
        lending_pool_name
    from `dimensions.lending_markets`
    where underlying_symbol = 'USDC'
    order by chain_id, version
    ```
  </Tab>
</Tabs>
