The lending.tvl_daily contains the daily total value locked (TVL) for lending project by token.

For a lending protocol, the may be multiple protocols, e.g. Aave V1, V2, v3.

Each protocol can have a different market address (address) that holds tokens that contribute to the total TVL of the project.

We do not include assets that are being lent out to borrowers in the total TVL calculation. The TVL calculation only includes assets that are being held in the protocol.

Sample Query

Finding the daily TVL of Aave on Ethereum, we group by date and project.

select date, project, sum(usd_balance) as usd 
from ethereum.lending.tvl_daily
where project = 'aave'
group by all

Finding the total TVL of WETH across all protocol versions of Aave on Ethereum.

select
    date, 
    project, 
    protocol,,
    token_address,
    token_name, 
    sum(usd_balance) as usd 
from ethereum.lending.tvl_daily
where project = 'aave' and token_address = lower('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2') -- WETH Address
group by all

Table Columns

Unique Key: date, address, token_address

ColumnData TypeDescription
dateDATEDate of the TVL snapshot
projectVARCHARName of the lending project
protocolVARCHARUnderlying protocol that the lending project is utilizing
addressVARCHARAddress of the lending market or contract
token_addressVARCHARAddress of the token locked in the protocol
token_nameVARCHARName of the token locked in the protocol
token_symbolVARCHARSymbol of the token locked in the protocol
token_decimalsINTEGERNumber of decimals of the token
raw_balance_strVARCHARRaw token balance in string format to retain precision
raw_balanceFLOATRaw token balance as a numeric value
balance_strVARCHARNormalized token balance in string format to retain precision
balanceFLOATNormalized token balance as a numeric value
usd_balanceFLOATUSD value of the token balance at the time of the snapshot
usd_exchange_rateFLOATUSD exchange rate of the token at the time of the snapshot
last_block_timestampTIMESTAMP_NTZ(9)Timestamp of the last block included in the TVL calculation
last_block_numberINTEGERBlock number of the last block included in the TVL calculation
_created_atTIMESTAMP_NTZ(9)Timestamp of when the record was created
_updated_atTIMESTAMP_NTZ(9)Timestamp of when the record was last updated