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

# Metrics

> Daily lending figures per market.

`metrics.lending_markets_daily` holds one row per lending market per day: total value locked, active loans and collateral. Figures are in USD. `lending_market_id` joins [Registry](/docs/catalog/lending/registry).

## Columns

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

  <tbody>
    <tr>
      <td><code>timestamp</code></td>
      <td><code>TIMESTAMP</code></td>
      <td>Day of the row. The partition column.</td>
    </tr>

    <tr>
      <td><code>lending\_market\_id</code></td>
      <td><code>STRING</code></td>
      <td>Market the row describes. Joins <code>dimensions.lending\_markets</code>.</td>
    </tr>

    <tr>
      <td><code>tvl</code></td>
      <td><code>BIGNUMERIC</code></td>
      <td>Total value supplied to the market, USD: idle plus borrowed.</td>
    </tr>

    <tr>
      <td><code>active\_loans</code></td>
      <td><code>BIGNUMERIC</code></td>
      <td>USD value of open loans (outstanding borrows) on the market.</td>
    </tr>

    <tr>
      <td><code>collateral</code></td>
      <td><code>BIGNUMERIC</code></td>
      <td>USD value of the market's tokens posted as collateral, backing open loans.</td>
    </tr>
  </tbody>
</table>

## Sample queries

<Tabs>
  <Tab title="One market's series">
    **Read one market's daily TVL, active loans and collateral.**

    ```sql theme={null}
    select
        metrics.timestamp,
        dims.underlying_symbol,
        dims.chain_id,
        metrics.tvl,
        metrics.active_loans,
        metrics.collateral
    from `metrics.lending_markets_daily` as metrics
    join `dimensions.lending_markets` as dims
        using (lending_market_id)
    where dims.underlying_symbol = 'USDC'
      and dims.chain_id = 'ethereum'
      and metrics.timestamp >= timestamp('2026-06-01')
    order by metrics.timestamp
    ```
  </Tab>

  <Tab title="Markets by TVL">
    **Rank markets by TVL on one day.**

    ```sql theme={null}
    select
        dims.underlying_symbol,
        dims.chain_id,
        dims.lending_pool_name,
        metrics.tvl
    from `metrics.lending_markets_daily` as metrics
    join `dimensions.lending_markets` as dims
        using (lending_market_id)
    where metrics.timestamp = timestamp('2026-08-01')
    order by metrics.tvl desc
    limit 25
    ```
  </Tab>
</Tabs>
