Lending and Borrowing
Aave Lending and Borrowing
Overview
Aave's lending and borrowing system enables users to earn interest by providing liquidity or borrow assets by posting collateral. The protocol automatically manages interest rates based on market supply and demand.
Lending (Supplying)
How Lending Works
- Users deposit supported assets into Aave liquidity pools
- Upon deposit, users receive corresponding aTokens (e.g., aUSDC for USDC deposits)
- aTokens accrue interest in real-time, automatically increasing in quantity
- Users can withdraw their original assets plus earned interest at any time by redeeming aTokens
aTokens
- Represent the user's deposit plus accrued interest
- Maintain a 1:1 ratio with the underlying asset
- Can be transferred, traded, or used as collateral
- Interest accrues directly in the user's wallet
Lending Interest Rates
- Interest rates adjust automatically based on pool utilization
- Higher utilization leads to higher interest rates to attract more deposits
- Lower utilization leads to lower rates to encourage borrowing
- Rates update with each Ethereum block
Borrowing
How Borrowing Works
- Users deposit collateral assets into Aave
- Based on the collateral value, users can borrow other assets
- Borrowers must maintain a healthy collateral ratio to avoid liquidation
- Loans can be repaid at any time, with interest accruing until repayment
Borrowing Types
-
Overcollateralized Borrowing
- Requires collateral value greater than the borrowed amount
- Perpetual duration (no fixed repayment date)
- Multiple assets can be used as collateral
-
Flash Loans
- Uncollateralized borrowing
- Must be repaid within the same transaction block
- Typically used for arbitrage or collateral swaps
Interest Rate Types
Variable Rate
- Adjusts based on market conditions
- Generally lower than stable rates during normal market conditions
- Can change significantly based on utilization
- Optimal for short-term loans or when market rates are high
Stable Rate
- More predictable borrowing costs
- Similar to a fixed rate but can be rebalanced
- Generally higher than variable rates
- Better for long-term borrowing and budget planning
Risk Parameters
Health Factor
- Key metric for loan safety
- Calculated as: (Collateral Value × Liquidation Threshold) ÷ Borrowed Amount
- Must stay above 1 to avoid liquidation
- Higher values indicate safer positions LINK TO HEALTH FACTOR AS A PAGE
Liquidation
- Threshold: The point at which a loan becomes eligible for liquidation (Health Factor < 1)
- Process: Liquidators repay part of the loan and receive discounted collateral
- Penalty: Borrowers lose a portion of their collateral as a liquidation penalty
- Prevention: Users can avoid liquidation by:
- Adding more collateral
- Repaying part of the loan
- Monitoring their Health Factor
Managing Positions
Best Practices
- Monitor your Health Factor regularly
- Maintain a safety buffer above minimum requirements
- Understand the risks of the assets you're using
- Consider the impact of market volatility on your position
Risk Mitigation
- Use multiple collateral types to diversify risk
- Choose appropriate interest rate types for your strategy
- Set up monitoring and alerts for your positions
- Have a plan for market volatility
Technical Details
Supply Process
function supply(
address asset,
uint256 amount,
address onBehalfOf,
uint16 referralCode
) external;
Borrow Process
function borrow(
address asset,
uint256 amount,
uint256 interestRateMode,
uint16 referralCode,
address onBehalfOf
) external;
Repay Process
function repay(
address asset,
uint256 amount,
uint256 interestRateMode,
address onBehalfOf
) external returns (uint256);
Usage Examples
Example 1: Basic Lending
- Deposit 1000 USDC
- Receive 1000 aUSDC
- aUSDC balance grows automatically with interest
- After one year at 5% APY, balance would be approximately 1050 aUSDC
Example 2: Overcollateralized Borrowing
- Deposit 1 ETH worth $2000 as collateral
- With 75% loan-to-value ratio, can borrow up to $1500 in other assets
- Monitor Health Factor to stay above 1
- Repay loan plus interest to withdraw collateral

