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

ColumnData TypeDescription
projectVARCHARName of the lending project
protocolVARCHARUnderlying protocol that the lending protocol is utilising
lending_eventVARCHARType of lending event (always ‘deposits’ for this table)
event_nameVARCHARName of the event
market_addressVARCHARAddress of the lending market
depositor_addressVARCHARAddress of the depositor
target_addressVARCHARAddress of the target recipient of the deposit tokens
token_addressVARCHARAddress of the token deposited
token_nameVARCHARName of the token deposited
token_symbolVARCHARSymbol of the token deposited
token_decimalsINTEGERNumber of decimals of the token deposited
raw_amount_strVARCHARRaw amount of the token deposited, in string to retain precision
raw_amountFLOATRaw amount of the token deposited
amount_strVARCHARNormalised amount of the token deposited, in string to retain precision
amountFLOATNormalised amount of the token deposited
usd_amountFLOATUSD amount of the token deposited at the time of the transaction
usd_exchange_rateFLOATHourly USD exchange rate of the token deposited
receipt_token_addressVARCHARAddress of the receipt token received (e.g., aToken, cToken)
extra_fieldsVARIANTExtra fields from the event
transaction_hashVARCHARTransaction hash of the event
transaction_indexINTEGERIndex of the transaction in the block
transaction_from_addressVARCHARAddress of the sender of the transaction
transaction_to_addressVARCHARAddress of the recipient of the transaction
log_indexINTEGERIndex of the log in the transaction
topic0VARCHARTopic 0 of the event
block_numberINTEGERBlock number of the event
block_timestampTIMESTAMP_NTZ(9)Timestamp of the block
block_hashVARCHARHash of the block
unique_idVARCHARUnique ID of the event
created_atTIMESTAMP_NTZ(9)Timestamp of when the event was created
updated_atTIMESTAMP_NTZ(9)Timestamp of when the event was last updated