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

# Deposits

> Every deposit into a lending market.

<Info>
  **In progress.** This table is not served yet. The page documents it as it lands.
</Info>

`facts.lending_market_deposits` combines the deposit events of every lending protocol we decode into one table: one row per deposit of a token into a lending market. A deposit supplies tokens to earn interest or to post collateral for borrowing. `lending_market_id` keys each row to its market in the [Registry](/docs/catalog/lending/registry).

## Columns

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

  <tbody>
    <tr>
      <td><code>block\_timestamp</code></td>
      <td><code>TIMESTAMP</code></td>
      <td>Time of the block containing the deposit. Partition column.</td>
    </tr>

    <tr>
      <td><code>block\_number</code></td>
      <td><code>INT64</code></td>
      <td>Number of the block containing the deposit.</td>
    </tr>

    <tr>
      <td><code>transaction\_hash</code></td>
      <td><code>STRING</code></td>
      <td>Hash of the transaction that emitted the deposit event.</td>
    </tr>

    <tr>
      <td><code>log\_index</code></td>
      <td><code>INT64</code></td>
      <td>Position of the deposit event in the block.</td>
    </tr>

    <tr>
      <td><code>unique\_id</code></td>
      <td><code>INT64</code></td>
      <td>Row key: fingerprint of <code>chain\_id</code>, <code>block\_number</code>, <code>transaction\_hash</code>, <code>log\_index</code>.</td>
    </tr>

    <tr>
      <td><code>chain\_id</code></td>
      <td><code>STRING</code></td>
      <td>Chain the deposit happened on.</td>
    </tr>

    <tr>
      <td><code>lending\_market\_id</code></td>
      <td><code>STRING</code></td>
      <td>Market the deposit entered; joins <code>dimensions.lending\_markets</code>.</td>
    </tr>

    <tr>
      <td><code>project\_id</code></td>
      <td><code>STRING</code></td>
      <td>Protocol operating the market, such as <code>aave</code>.</td>
    </tr>

    <tr>
      <td><code>token\_id</code></td>
      <td><code>STRING</code></td>
      <td>Token deposited: <code>\{token\_address}-\{chain\_id}</code>.</td>
    </tr>

    <tr>
      <td><code>token\_address</code></td>
      <td><code>STRING</code></td>
      <td>Contract address of the token deposited.</td>
    </tr>

    <tr>
      <td><code>depositor\_address</code></td>
      <td><code>STRING</code></td>
      <td>Account the protocol's event names as the supplier.</td>
    </tr>

    <tr>
      <td><code>on\_behalf\_of\_address</code></td>
      <td><code>STRING</code></td>
      <td>Account credited with the deposit position, when deposited for another account.</td>
    </tr>

    <tr>
      <td><code>amount\_raw</code></td>
      <td><code>STRING</code></td>
      <td>Raw amount as text; a <code>uint256</code> exceeds every BigQuery number type.</td>
    </tr>
  </tbody>
</table>

## Sample queries

<Warning>
  The table is partitioned on `block_timestamp`. Bound that column in every query; without a bound the query reads the whole table.
</Warning>

<Tabs>
  <Tab title="One market, one day">
    **Read one market's deposits on a single day.** Cast `amount_raw` to `BIGNUMERIC` and divide by `10^decimals` from `dimensions.tokens` to get the token amount.

    ```sql theme={null}
    select
        deposits.block_timestamp,
        deposits.transaction_hash,
        deposits.depositor_address,
        cast(deposits.amount_raw as bignumeric) / pow(10, tokens.decimals) as amount
    from `facts.lending_market_deposits` as deposits
    join `dimensions.lending_markets` as markets
        using (lending_market_id)
    join `dimensions.tokens` as tokens
        using (token_id)
    where markets.project_id = 'aave'
      and markets.underlying_symbol = 'WETH'
      and markets.chain_id = 'ethereum'
      and deposits.block_timestamp >= timestamp('2026-08-01')
      and deposits.block_timestamp < timestamp('2026-08-02')
    limit 100
    ```
  </Tab>

  <Tab title="Daily USD volume">
    **Sum daily deposit volume in USD per protocol.** The table carries token amounts; USD comes from [Prices](/docs/catalog/tokens/prices).

    ```sql theme={null}
    select
        timestamp_trunc(deposits.block_timestamp, day) as day,
        deposits.project_id,
        round(sum(cast(deposits.amount_raw as bignumeric) / pow(10, tokens.decimals) * prices.price)) as deposited_usd
    from `facts.lending_market_deposits` as deposits
    join `dimensions.tokens` as tokens
        using (token_id)
    join `metrics.tokens_prices_daily` as prices
        on prices.token_id = deposits.token_id
        and prices.timestamp = timestamp_trunc(deposits.block_timestamp, day)
    where deposits.block_timestamp >= timestamp('2026-08-01')
      and deposits.block_timestamp < timestamp('2026-08-08')
    group by day, deposits.project_id
    order by day, deposited_usd desc
    ```
  </Tab>
</Tabs>
