> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Deposits

Deposit events are when a user deposits tokens into a lending protocol, to earn interest or as collateral to borrow other assets from the protocol.

The `<chain>.lending.deposits` table contains deposit events from Aave v1, v2, v3 and Compound v2 and v3 and Morpho Blue protocols, consolidated into a single table for easy querying.

This table tracks all deposit activities across major lending protocols, providing comprehensive information about deposit amounts, tokens, participants, and transaction details.

### Sample Query

How much WETH has been deposited into Aave on Ethereum in the past 90 days?

```
select
    date(block_timestamp) as date, 
    project, 
    token_address,
    token_name, 
    sum(usd_amount) as usd 
from ethereum.lending.deposits
where project = 'aave'
and token_address = lower('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2') -- WETH Address
and block_timestamp  >= current_date - 90
group by all
```

What is the total deposit volume of all lending projects on Ethereum in the past 90 days?

```
select
    date(block_timestamp) as date, 
    project, 
    token_address,
    token_name, 
    sum(usd_amount) as usd 
from ethereum.lending.deposits
where 1=1 and block_timestamp  >= current_date - 90
group by all
```

#### Table Columns

Unique Key: `unique_id`

| Column                     | Data Type         | Description                                                             |
| -------------------------- | ----------------- | ----------------------------------------------------------------------- |
| project                    | VARCHAR           | Name of the lending project                                             |
| protocol                   | VARCHAR           | Underlying protocol that the lending protocol is utilising              |
| lending\_event             | VARCHAR           | Type of lending event (always 'deposits' for this table)                |
| event\_name                | VARCHAR           | Name of the event                                                       |
| market\_address            | VARCHAR           | Address of the lending market                                           |
| depositor\_address         | VARCHAR           | Address of the depositor                                                |
| target\_address            | VARCHAR           | Address of the target recipient of the deposit tokens                   |
| token\_address             | VARCHAR           | Address of the token deposited                                          |
| token\_name                | VARCHAR           | Name of the token deposited                                             |
| token\_symbol              | VARCHAR           | Symbol of the token deposited                                           |
| token\_decimals            | INTEGER           | Number of decimals of the token deposited                               |
| raw\_amount\_str           | VARCHAR           | Raw amount of the token deposited, in string to retain precision        |
| raw\_amount                | FLOAT             | Raw amount of the token deposited                                       |
| amount\_str                | VARCHAR           | Normalised amount of the token deposited, in string to retain precision |
| amount                     | FLOAT             | Normalised amount of the token deposited                                |
| usd\_amount                | FLOAT             | USD amount of the token deposited at the time of the transaction        |
| usd\_exchange\_rate        | FLOAT             | Hourly USD exchange rate of the token deposited                         |
| receipt\_token\_address    | VARCHAR           | Address of the receipt token received (e.g., aToken, cToken)            |
| extra\_fields              | VARIANT           | Extra fields from the event                                             |
| transaction\_hash          | VARCHAR           | Transaction hash of the event                                           |
| transaction\_index         | INTEGER           | Index of the transaction in the block                                   |
| transaction\_from\_address | VARCHAR           | Address of the sender of the transaction                                |
| transaction\_to\_address   | VARCHAR           | Address of the recipient of the transaction                             |
| log\_index                 | INTEGER           | Index of the log in the transaction                                     |
| topic0                     | VARCHAR           | Topic 0 of the event                                                    |
| block\_number              | INTEGER           | Block number of the event                                               |
| block\_timestamp           | TIMESTAMP\_NTZ(9) | Timestamp of the block                                                  |
| block\_hash                | VARCHAR           | Hash of the block                                                       |
| unique\_id                 | VARCHAR           | Unique ID of the event                                                  |
| created\_at                | TIMESTAMP\_NTZ(9) | Timestamp of when the event was created                                 |
| updated\_at                | TIMESTAMP\_NTZ(9) | Timestamp of when the event was last updated                            |
