Analysing Blockchain Data

Similar to all Ethereum based smart contract protocols, all of Aave's data, transactions, and events are extractable directly from the blockchain. This section will describe the most common data that you may want to extract from Aave Protocol.

Ensure you are working with the latest smart contract addresses as detailed on the Deployed Contracts page.

Deposit

When users deposit tokens or ETH into Aave, they are given the aToken equivalent which:

  • is 1:1 pegged with the original asset (e.g. 1 aDAI === 1 DAI), and

  • immediately earns interest.

Deposit made

Converting ETH or a supported token into an aToken.

Type

Details

Contract

Documentation

Function

deposit()

LendingPool

More details

Event

Deposit()

LendingPool

More details

Example transaction

Deposit withdrawn / redeemed

Converting an aToken into the underlying asset (either ETH or the supported token).

Type

Details

Contract

Documentation

Function

redeem()

aToken

More details

Event

RedeemUnderlying()

aToken

More details

Example transaction

Collateral

When a user has deposited funds, they must enable the funds to be used as collateral to be able to borrow.

Enable / Disable collateral

Type

Details

Contract

Documentation

Function

setUserUseReserveAsCollateral()

LendingPool

More details

Event

ReserveUsedAsCollateralEnabled()

LendingPool

More details

Event

ReserveUsedAsCollateralDisabled()

LendingPool

More details

Example transaction: Enabling

Example transaction: Disabling

Borrow

When a user has deposited collateral (therefore holds aTokens), they are able to borrow a certain amount of assets based on the amount of collateral.

Borrow made

Type

Details

Contract

Documentation

Function

borrow()

LendingPool

More details

Event

Borrow()

LendingPool

More details

Example transaction

Borrow repaid

Type

Details

Contract

Documentation

Function

repay()

LendingPool

More details

Event

Repay()

LendingPool

More details

Example transaction

Swap rate

A user is able to swap their borrow rates between stable and variable rates.

Type

Details

Contract

Documentation

Function

swapBorrowRateMode()

LendingPool

More details

Event

Swap()

LendingPool

More details

Example transaction

Liquidation

When a loan position has a health factor below 1, it can be liquidated by anyone.

Type

Details

Contract

Documentation

Function

liquidationCall()

LendingPool

More details

Event

LiquidationCall()

LendingPool

More details

Example transaction

Flash Loan

An uncollateralised loan that is available in one transaction, as long as it is repaid before the end of the transaction.

Type

Details

Contract

Documentation

Function

flashLoan()

LendingPool

More details

Event

FlashLoan()

LendingPool

More details

Example transaction

Reserve / Asset / Interest Rate updates

Reserve information is updated (e.g. interest rates) whenever certain actions are taken on the reserve (deposits, borrows, etc).

Type

Details

Contract

Function

updateReserveInterestRatesAndTimestampInternal()

LendingPoolCore

Event

ReserveUpdated()

LendingPoolCore

Example: Occurs on all deposit(), redeem(), flashloan(), borrow(), repay(), swap rates, liquidations, and rebalances calls.