Skip to content

Lending Events

The optimism.lending_events table provides indexed views for lending events based on 5 categories: deposit, borrow, repay, withdraw, and liquidation.


Name Type Description
account_address text The address that owns the lending position.
block_number integer The block number of the lending event.
category text The category of the lending event (deposit, withdraw, borrow, repay and liquidate).
contract_version text The version of the protocol market address.
liquidated_token_address text The borrowed token address that was repaid in a liquidation event.
liquidator_address text The address that liquidates the loan if the event is a liquidation.
log_index integer The log index of the lending event.
market_address text The address of the lending market contract.
metadata jsonb The metadata of the lending event.
protocol_name text The name of the protocol that facilitated the lending event.
quantity numeric The quantity of the token in the event (i.e. borrow events -> quantity borrowed, liquidation events -> collateral quantity liquidated).
quantity_liquidated numeric The quantity of the borrowed token repaid in a liquidation event.
sender_address text The address that sent the transaction.
timestamp timestamp without time zone The timestamp of the lending event.
token_address text The address of the token used in the lending event.
token_id bigint The NFT token id if the token_address in the lending event is an NFT.
transaction_hash text The transaction hash of the lending event.
__block_number integer The block number at which the event took place in.
__confirmed boolean Flag indicating whether the transfer has been confirmed.
__last_modified timestamp The date at which this row was last updated (in ISO-8601 format).

Supported Protocols

VMEX-v1 aave-v3 abracadabra-v1


protocol_name, contract_version, timestamp, log_index
protocol_name, timestamp, log_index
account_address, market_address, token_address, timestamp, log_index
market_address, token_address, timestamp, log_index
__indexer_id WHERE __confirmed = false
__indexer_id, __block_number
market_address, token_address, block_number, log_index
timestamp, log_index
transaction_hash, log_index

Got questions? Join our Discord

Discord is the primary home of the Transpose developer community. Join us to ask questions, share your work, and get help.