DeFi lending datasets including supply, borrow, flash loans, and liquidations
DeFi lending datasets including supply, borrow, flash loans, and liquidations. Lending protocols are aggregated into a single schema across 15+ EVM chains, so you can compare protocols and chains in one query.
lending.supply: all supply-side transactions, meaning deposits, withdrawals, and supply-side liquidations. lending.borrow: all borrow-side transactions, meaning borrows, repayments, and borrow-side liquidations. lending.flashloans: all flash loan transactions across lending protocols.
Lending tables are maintained by Dune in the open-source Spellbook repository. They aggregate protocol-specific base models (lending_base_supply, lending_base_borrow, lending_base_flashloans) that decode onchain events from each protocol's smart contracts. Token amounts are decimal-adjusted and joined with Dune's price feeds (prices.minute, prices.hour, prices.day) for USD values.
The tables aggregate all integrated lending protocols, including Aave, Compound, and others. Run SELECT DISTINCT project FROM lending.supply for the current list.
Track supply and borrow volumes across DeFi lending protocols, analyze liquidation events and at-risk positions, monitor flash loan activity and fees, compare lending protocol market share across chains, and build lending analytics dashboards for protocol teams or investors.
lending.supply and lending.borrow are partitioned by blockchain, project, and block_month, and lending.flashloans by blockchain and project. Always include blockchain and block_month (or a block_time range) in your WHERE clause.
The typical latency between onchain activity and the curated lending tables is about 20 minutes.
Curated lending tables cover core supply and borrow activity. Most protocol-specific research, such as Aave v4, Morpho vaults, and Solana lending venues, draws from decoded contract events and protocol-uploaded datasets. Not sure which tables to use? Talk to the Data Solutions team and they will point you to the right starting point.
Query the lending tables in DuneSQL, or access lending data via API or Datashare.