Skip to main content
In progress. This table is not served yet. The page documents it as it lands.
facts.lending_market_repayments combines the repayment events of every lending protocol we decode into one table: one row per repayment of a loan. lending_market_id keys each row to its market in the Registry.

Columns

ColumnTypeDescription
block_timestampTIMESTAMPTime of the block containing the repayment. Partition column.
block_numberINT64Number of the block containing the repayment.
transaction_hashSTRINGHash of the transaction that emitted the repayment event.
log_indexINT64Position of the repayment event in the block.
unique_idINT64Row key: fingerprint of chain_id, block_number, transaction_hash, log_index.
chain_idSTRINGChain the repayment happened on.
lending_market_idSTRINGMarket the repayment entered; joins dimensions.lending_markets.
project_idSTRINGProtocol operating the market, such as aave.
token_idSTRINGToken repaid: {token_address}-{chain_id}.
token_addressSTRINGContract address of the token repaid.
borrower_addressSTRINGAccount whose debt was repaid.
repayer_addressSTRINGAccount that paid, when repaid for another account.
amount_rawSTRINGRaw amount as text; a uint256 exceeds every BigQuery number type.

Sample queries

The table is partitioned on block_timestamp. Bound that column in every query; without a bound the query reads the whole table.
Read one market’s repayments on a single day. Cast amount_raw to BIGNUMERIC and divide by 10^decimals from dimensions.tokens to get the token amount.