Loan events are when a borrower requests a loan from a lending protocol.The <chain>.lending.loans table contains borrow 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 borrowing activities across major lending protocols, providing comprehensive information about loan amounts, tokens, borrowers, and transaction details.
borrower_address reflects the address emitted by the specific event Allium decodes for a protocol. For most protocols that’s the borrowing wallet, but for protocols that route borrows through a vault, router, or liquidity layer below the user-facing entry point, it can instead be that intermediate contract. When you need reliable end-user attribution, filter on transaction_from_address instead — it’s the transaction originator, though it won’t capture borrows routed through a smart contract wallet, batcher, or aggregator.
Sample Query
Total borrowers of UDSC (by contract address) on Ethereum blockchain in the past 90 days.
select date(block_timestamp) as date, project, count(distinct borrower_address) as borrowers, sum(usd_amount) as usd from ethereum.lending.loanswhere token_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'and block_timestamp >= current_date - 90group by allorder by date desc
Most commonly borrowed tokens on Ethereum blockchain by borrowers count.
select token_address, token_name, count(distinct borrower_address) as borrowers, count(1) as borrow_count, sum(usd_amount) as usd from ethereum.lending.loansgroup by all order by borrowers desc
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 ‘borrows’ for this table)
event_name
VARCHAR
Name of the event
market_address
VARCHAR
Address of the lending market
borrower_address
VARCHAR
Address of the borrower
target_address
VARCHAR
Address of the target recipient of the borrow
token_address
VARCHAR
Address of the token borrowed
token_name
VARCHAR
Name of the token borrowed
token_symbol
VARCHAR
Symbol of the token borrowed
token_decimals
INTEGER
Number of decimals of the token borrowed
raw_amount_str
VARCHAR
Raw amount of the token borrowed, in string to retain precision
raw_amount
FLOAT
Raw amount of the token borrowed
amount_str
VARCHAR
Normalised amount of the token borrowed, in string to retain precision
amount
FLOAT
Normalised amount of the token borrowed
usd_amount
FLOAT
USD amount of the token borrowed at the time of the transaction
usd_exchange_rate
FLOAT
Hourly USD exchange rate of the token borrowed
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
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.