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

# Lending markets

> Lending markets and their reserves: the keys, and how to size them.

One row per lending market in `dimensions.lending_markets`, the boundary inside which deposits and debts back each other: the pool on Aave, one collateral and loan pair on Morpho Blue. `lending_market_reserve_id` keys `dimensions.lending_market_reserves`, one row per asset inside a market, and that is the grain a market's figures are summed from.

## Coverage

One row per app, and a tick marks every app that reports the measure at this grain. It is the same table as the Market tab of [Lending](https://tokenterminal.com/docs/catalog/lending.md).

<table>
  <thead>
    <tr>
      <th width="230">App</th>
      <th width="140">Project</th>
      <th>TVL</th>
      <th>Active loans</th>
      <th>Collateral</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`aave-v3`</td><td>`aave`</td><td>✓</td><td>✓</td><td>✓</td></tr>
    <tr><td>`aave-v4`</td><td>`aave`</td><td>✓</td><td>✓</td><td>✓</td></tr>
  </tbody>
</table>

## Columns

**Markets**

One row per lending market on one chain.

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

  <tbody>
    <tr><td>`lending_market_id`</td><td>STRING</td><td>Market key, formatted `{lending_market}-{chain_id}`.</td></tr>
    <tr><td>`app_id`</td><td>STRING</td><td>App operating the market, such as `aave-v3` or `morpho-blue`. Joins `dimensions.apps`.</td></tr>
    <tr><td>`chain_id`</td><td>STRING</td><td>Chain the market lives on.</td></tr>
    <tr><td>`project_id`</td><td>STRING</td><td>Project behind the app. Joins `dimensions.projects`.</td></tr>
    <tr><td>`lending_market`</td><td>STRING</td><td>The protocol's own key for the market: the pool contract address on pool lenders, the market hash on Morpho Blue.</td></tr>
    <tr><td>`lending_market_contract_address`</td><td>STRING</td><td>The deployed contract the market runs on. Matches `lending_market` on pool lenders; every Morpho Blue market on a chain shares one singleton contract.</td></tr>
    <tr><td>`lending_market_name`</td><td>STRING</td><td>Readable name of the market, such as `Core` or `Morpho Blue: cbBTC/USDC 86%`. A label, not a key.</td></tr>
  </tbody>
</table>

**Reserves**

One row per reserve, one asset inside one market. An Aave pool lists one reserve per underlying token and a Morpho Blue market exactly two, the loan side and the collateral side; where a pool lists the same token twice, the key is the protocol's listing rather than the token.

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

  <tbody>
    <tr><td>`lending_market_reserve_id`</td><td>STRING</td><td>Reserve key, formatted `{lending_market}-{lending_market_reserve}-{chain_id}`.</td></tr>
    <tr><td>`lending_market_id`</td><td>STRING</td><td>Market the reserve belongs to. Joins `dimensions.lending_markets`.</td></tr>
    <tr><td>`app_id`</td><td>STRING</td><td>App operating the market. Joins `dimensions.apps`.</td></tr>
    <tr><td>`chain_id`</td><td>STRING</td><td>Chain the market lives on.</td></tr>
    <tr><td>`project_id`</td><td>STRING</td><td>Project behind the app. Joins `dimensions.projects`.</td></tr>
    <tr><td>`lending_market`</td><td>STRING</td><td>The protocol's own key for the market, copied from the market row.</td></tr>
    <tr><td>`lending_market_contract_address`</td><td>STRING</td><td>The deployed contract the market runs on, copied from the market row.</td></tr>
    <tr><td>`lending_market_name`</td><td>STRING</td><td>Readable name of the market, copied from the market row.</td></tr>
    <tr><td>`lending_market_reserve`</td><td>STRING</td><td>The protocol's own key for the reserve inside its market: the underlying token address on Aave-style pools, the vToken contract on Venus, `loan` or `collateral` on Morpho Blue, the numeric reserve id on Aave v4.</td></tr>
    <tr><td>`lending_market_reserve_name`</td><td>STRING</td><td>Readable name: the market name and the token symbol, such as `Core: WETH`. A label, not a key.</td></tr>
    <tr><td>`token_id`</td><td>STRING</td><td>Key of the underlying token in `dimensions.tokens`, formatted `{token_address}-{chain_id}`.</td></tr>
    <tr><td>`token_address`</td><td>STRING</td><td>Address of the underlying token contract.</td></tr>
    <tr><td>`token_symbol`</td><td>STRING</td><td>Ticker symbol of the underlying token.</td></tr>
  </tbody>
</table>

## Sample queries

**Rank markets by size**

TVL is a balance, so read it on a single day. The registry turns `lending_market_id` into the market's name, its app and the chain it lives on.

```sql theme={null}
select
    markets.lending_market_name,
    markets.app_id,
    markets.chain_id,
    market_tvl.tvl
from `metrics_lending_markets.tvl_daily` as market_tvl
join `dimensions.lending_markets` as markets
    using (lending_market_id)
where market_tvl.timestamp = timestamp('2026-08-01')
order by market_tvl.tvl desc
limit 20
```

**What one market holds**

The reserve rows sit one level below the market and each names its token, so the registry turns each reserve key into a symbol. Filter the reserve side on `lending_market_id` to stay inside one market.

```sql theme={null}
select
    reserves.token_symbol,
    reserves.lending_market_reserve,
    reserve_tvl.tvl
from `metrics_lending_market_reserves.tvl_daily` as reserve_tvl
join `dimensions.lending_market_reserves` as reserves
    using (lending_market_reserve_id)
where reserve_tvl.timestamp = timestamp('2026-08-01')
  and reserves.lending_market_id = '0xc13e21b648a5ee794902342038ff3adab66be987-ethereum'
order by reserve_tvl.tvl desc
```


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