The <chain>.lending.interest_rates table contains supply and borrowing interest rate as well as outstanding loans from Aave and Morpho Blue.

The interest rates of lending pools for most protocols are updated on-chain when a lending event occurs.

This model maps the various interest rate data, such as supply and borrowing APYs, outstanding loans, and available liquidity, to the corresponding lending protocol and market.

Note that not all fields are applicable to all protocols.

Sample Query

Fetch the variable borrow APY for Aave v3 on Ethereum in the past 180 days.

select 
    date(block_timestamp) as date,
    project,
    protocol,
    token_address,
    token_name,
    token_symbol,
    median(variable_borrow_apy) as variable_borrow_apy -- APY for borrowing 
from ethereum.lending.interest_rates
where project = 'aave' and protocol = 'aave_v3'
and block_timestamp >= current_date - 180
group by all

Table Columns

Unique Key: unique_id

ColumnData TypeDescription
projectVARCHARName of the lending project (e.g., ‘aave’, ‘morpho’).
protocolVARCHARSpecific protocol version or variant (e.g., ‘aave_v3’, ‘morpho_blue’).
contract_addressVARCHARAddress of the main protocol contract.
market_addressVARCHARAddress of the specific lending market. This field is the ID of the market for Morpho Blue protocol.
token_addressVARCHARAddress of the loan token in the market.
token_nameVARCHARName of the loan token.
token_symbolVARCHARSymbol of the loan token.
token_decimalsINTEGERNumber of decimals of the loan token.
usd_exchange_rateFLOATUSD exchange rate of the loan token at the time of the rate update.
supply_apyFLOATAnnual Percentage Yield for suppliers/lenders, expressed as a percentage.
stable_borrow_apyFLOATAnnual Percentage Yield for stable-rate borrowers, expressed as a percentage. Only applicable for protocols with stable rates like Aave.
variable_borrow_apyFLOATAnnual Percentage Yield for variable-rate borrowers, expressed as a percentage.
cumulative_supply_interestFLOATCumulative index tracking interest earned by suppliers over time (liquidityIndex in Aave). Only applicable for certain protocols like Aave.
cumulative_borrow_interestFLOATCumulative index tracking interest accumulated for borrowers over time (variableBorrowIndex in Aave). Only applicable for certain protocols like Aave.
outstanding_loansFLOATTotal amount of tokens borrowed from the market, normalized by token decimals.
outstanding_loans_usdFLOATUSD value of the total borrowed tokens.
supplied_amountFLOATTotal amount of tokens supplied to the market, normalized by token decimals.
supplied_amount_usdFLOATUSD value of the total supplied tokens.
available_liquidityFLOATAmount of tokens available for borrowing, normalized by token decimals.
available_liquidity_usdFLOATUSD value of the tokens available for borrowing.
trace_paramsVARIANTRaw parameters from the trace call that provided the interest rate data.
logs_paramsVARIANTRaw parameters from the event logs that provided the interest rate data.
transaction_hashVARCHARTransaction hash where the interest rate update occurred.
transaction_indexINTEGERIndex of the transaction in the block.
block_timestampTIMESTAMPTimestamp of the block when the interest rate was updated.
block_numberINTEGERBlock number when the interest rate was updated.
block_hashVARCHARHash of the block when the interest rate was updated.
unique_idVARCHARUnique identifier for the interest rate update event.
_created_atTIMESTAMP_NTZ(9)Timestamp of when the record was created.
_updated_atTIMESTAMP_NTZ(9)Timestamp of when the record was last updated.