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

# Deposits

> Every deposit into a lending market.

One row per deposit into a lending market. `amount` is the tokens supplied, and summing it per `user_address` replays a position.

## Columns

<table>
  <thead>
    <tr>
      <th width="270">Column</th>
      <th width="120">Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`block_timestamp`</td><td>TIMESTAMP</td><td>Time of the block containing the deposit. Partition column.</td></tr>
    <tr><td>`block_number`</td><td>INT64</td><td>Number of the block containing the deposit.</td></tr>
    <tr><td>`transaction_hash`</td><td>STRING</td><td>Hash of the transaction that emitted the deposit event.</td></tr>
    <tr><td>`log_index`</td><td>INT64</td><td>Position of the deposit event in the block.</td></tr>
    <tr><td>`unique_id`</td><td>INT64</td><td>Row key: fingerprint of `chain_id`, `block_number`, `transaction_hash`, `log_index`.</td></tr>
    <tr><td>`event_type`</td><td>STRING</td><td>Constant `deposits`; stacking key across the lending facts.</td></tr>
    <tr><td>`project_id`</td><td>STRING</td><td>Protocol operating the market, such as `aave`.</td></tr>
    <tr><td>`app_id`</td><td>STRING</td><td>Deployment of the protocol the market belongs to.</td></tr>
    <tr><td>`chain_id`</td><td>STRING</td><td>Chain the deposit happened on.</td></tr>
    <tr><td>`lending_market_id`</td><td>STRING</td><td>Market the deposit entered; joins `dimensions.lending_markets`.</td></tr>
    <tr><td>`lending_market_reserve_id`</td><td>STRING</td><td>Reserve within the market; joins `dimensions.lending_market_reserves`.</td></tr>
    <tr><td>`lending_market_contract_address`</td><td>STRING</td><td>Contract the market lives on; not a key.</td></tr>
    <tr><td>`receipt_token_address`</td><td>STRING</td><td>Receipt token whose balance moved (the aToken for Aave); null where positions are not tokenised.</td></tr>
    <tr><td>`token_id`</td><td>STRING</td><td>Token deposited: `{token_address}-{chain_id}`.</td></tr>
    <tr><td>`token_address`</td><td>STRING</td><td>Contract address of the token deposited.</td></tr>
    <tr><td>`token_symbol`</td><td>STRING</td><td>Symbol of the token deposited.</td></tr>
    <tr><td>`token_decimals`</td><td>INT64</td><td>Decimals of the token deposited.</td></tr>
    <tr><td>`depositor_address`</td><td>STRING</td><td>Account that acted: the supplier, or the sender on a receipt-token transfer.</td></tr>
    <tr><td>`user_address`</td><td>STRING</td><td>Account whose supplied balance rose; the position key across the lending facts.</td></tr>
    <tr><td>`shares_raw`</td><td>BIGNUMERIC</td><td>Movement in the protocol's interest-bearing unit, exact integer; summing per position replays the share balance.</td></tr>
    <tr><td>`shares`</td><td>BIGNUMERIC</td><td>`shares_raw` decimal-corrected.</td></tr>
    <tr><td>`amount_raw`</td><td>BIGNUMERIC</td><td>Event-time amount in the token's stored unit, exact integer.</td></tr>
    <tr><td>`amount`</td><td>BIGNUMERIC</td><td>`amount_raw` decimal-corrected into whole tokens.</td></tr>
  </tbody>
</table>

## Sample queries

> [!WARNING]
>
> This table is large and split by day. Bound `block_timestamp` and filter `chain_id` on every query, or you read the whole table and the whole table is billed to you.

**One day, one app**

`amount` is whole tokens and `amount_raw` the integer the contract emitted. `user_address` is whose supplied balance rose, and the account to group a position by.

```sql theme={null}
select
    events.block_timestamp,
    events.token_symbol,
    events.amount,
    events.user_address
from `facts_lending_markets.deposits` as events
where events.block_timestamp >= timestamp('2026-09-01')
  and events.block_timestamp < timestamp('2026-09-02')
  and events.chain_id = 'ethereum'
  and events.app_id = 'aave-v3'
order by events.amount desc
limit 100
```

**Daily deposits per app**

Group by `token_symbol` as well as app: `amount` is in each token's own units, so one sum per token is the comparable figure.

```sql theme={null}
select
    date(events.block_timestamp) as day,
    events.app_id,
    events.token_symbol,
    sum(events.amount) as deposited
from `facts_lending_markets.deposits` as events
where events.block_timestamp >= timestamp('2026-08-01')
  and events.block_timestamp < timestamp('2026-09-01')
  and events.chain_id = 'ethereum'
group by day, events.app_id, events.token_symbol
order by day, deposited desc
```

**Net supply for one user**

Deposits are the increase and [Withdrawals](https://tokenterminal.com/docs/catalog/lending/withdrawals.md) the decrease, so sign each side and sum. `event_type` is a constant on every lending fact, which keeps track of the source table across a wider `union all`.

```sql theme={null}
with movements as (
    select token_symbol, amount
    from `facts_lending_markets.deposits`
    where block_timestamp >= timestamp('2026-08-01')
      and chain_id = 'ethereum'
      and user_address = '0x0000000000000000000000000000000000000000'

    union all

    select token_symbol, -amount
    from `facts_lending_markets.withdrawals`
    where block_timestamp >= timestamp('2026-08-01')
      and chain_id = 'ethereum'
      and user_address = '0x0000000000000000000000000000000000000000'
)

select
    token_symbol,
    sum(amount) as net_supplied
from movements
group by token_symbol
order by net_supplied desc
```


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