Overview of AAVE V3 Protocol
AAVE is a decentralized lending platform where users can:
- Deposit assets to earn interest and use them as collateral to borrow other assets
- Receive interest-bearing aTokens as deposit certificates
- Borrow assets by paying interest and receiving non-transferable debtTokens
Key Concepts
- Loan-to-Value (LTV): Determines borrowing limits (typically 60%-80% of collateral value)
- Liquidation: Occurs when LTV exceeds thresholds, allowing anyone to liquidate for rewards
- Protocol Revenue: Generated from interest rate spreads and reserve factors
- EMode: Increases capital efficiency for similar asset types (e.g., using DAI to borrow USDT)
Protocol Architecture
Core Components
Libraries
ReserveConfiguration.sol: Manages reserve indices and ratesUserConfiguration.sol: Tracks user borrowing and collateral status
Logic Modules
BorrowLogic.solEModeLogic.solLiquidationLogic.solPoolLogic.solReserveLogic.solSupplyLogic.solValidationLogic.sol
Data Structures
DataTypes.sol: Defines protocol data structures
Deep Dive: Key Functionalities
1. ReserveLogic
Manages reserve states including:
- Interest rate calculations
- Treasury accruals
- Index updates
function updateState(
DataTypes.ReserveData storage reserve,
DataTypes.ReserveCache memory reserveCache
) internal {
_updateIndexes(reserve, reserveCache);
_accrueToTreasury(reserve, reserveCache);
}2. PoolLogic
Handles reserve management:
- Initialization
- Treasury minting
- Reserve dropping
3. Liquidation Logic
Processes liquidations with:
- Health factor validation
- Collateral/debt calculations
- Debt token burning
function executeLiquidationCall(
// Parameters
) external {
// Validation checks
// Debt calculations
// Collateral processing
}Tokenization System
AToken Mechanics
- Minting/burning scaled by liquidity index
- Implements ERC20 with additional scaling factor
function _mintScaled(
address caller,
address onBehalfOf,
uint256 amount,
uint256 index
) internal returns (bool) {
uint256 amountScaled = amount.rayDiv(index);
_mint(onBehalfOf, amountScaled.toUint128());
}Debt Tokens
- Track variable/stable debt balances
- Non-transferable by design
Advanced Features
EMode System
- Higher LTV for similar assets
- Category-based price oracles
Isolation Mode
- Limits collateral to high-risk assets
- Enforces debt ceilings
Flash Loans
- Borrow assets temporarily for arbitrage
- Must repay in same transaction
FAQ: AAVE V3 Protocol
What determines borrowing limits in AAVE?
Loan-to-Value (LTV) ratios set borrowing limits, typically 60%-80% of collateral value.
How does liquidation work in AAVE?
When LTV exceeds thresholds, anyone can liquidate positions to receive collateral at a discount.
What's the purpose of EMode?
๐ EMode optimizes capital efficiency for similar asset types like stablecoins.
How are interest rates calculated?
A two-phase linear model adjusts rates based on utilization, with steeper slopes above optimal thresholds.
What's the difference between aTokens and debtTokens?
aTokens represent deposited assets earning interest, while debtTokens represent borrowed amounts accruing interest.
Key Takeaways
- AAVE V3 implements sophisticated risk management through LTV ratios and liquidation mechanisms
- The protocol generates revenue from interest rate spreads and reserve factors
- Advanced features like EMode and isolation mode provide flexibility while managing risk
- ๐ Flash loans enable innovative DeFi strategies without capital requirements