Lending Protocols
Decentralized lending protocols enable permissionless borrowing and lending through algorithmic interest rate models and over-collateralization. They form the backbone of DeFi's credit market.
Protocol Comparison
| Feature | Aave v3 | Compound v3 | MakerDAO |
|---|---|---|---|
| Interest Model | Variable + Stable | Jump Rate | Stability Fee |
| Collateral Types | Multi-asset | Single market | ETH, LP tokens |
| Max LTV | 80% | 83% | 172% (with DSR) |
| Liquidation Threshold | 82.5% | 85% | 150% |
| Flash Loans | Native | Not native | Not native |
| Governance | AAVE veToken | COMP | MKR |
Interest Rate Models
Utilization-Based Rate
Most lending protocols use utilization-based interest rates:
Where:
- = Utilization rate
- = Total borrowed amount
- = Total supplied amount
- = Protocol reserves
Interest Rate Visualization
Aave Interest Rate Model
Borrow Rate Formula
Supply Rate
Where is the reserve factor (typically 10-30%).
Interest Rate Parameters
| Parameter | Aave USDC | Aave ETH | Compound USDC |
|---|---|---|---|
| Base Rate | 0% | 0% | 1.44% |
| Optimal Utilization | 90% | 80% | 80% |
| Slope1 | 3.5% | 3.3% | 3.94% |
| Slope2 | 60% | 80% | 100%+ |
| Reserve Factor | 10% | 15% | 25% |
Supply vs Borrow Rates
Collateral Factors
Collateral factors determine how much can be borrowed against deposited assets.
Loan-to-Value (LTV)
Liquidation Threshold
The liquidation threshold determines when a position becomes eligible for liquidation:
Where:
- = Liquidation threshold for collateral asset
- = Price of asset
Collateral Factor Comparison
| Asset | Aave LTV | Aave LT | Compound CF | Risk Rating |
|---|---|---|---|---|
| USDC | 85% | 90% | 83% | Low |
| ETH | 80% | 82.5% | 82% | Medium |
| WBTC | 70% | 75% | 70% | Medium |
| LINK | 65% | 70% | 65% | Medium |
| UNI | 55% | 60% | 55% | High |
| AAVE | 60% | 65% | N/A | High |
Liquidation Mechanics
Liquidation Process
When Health Factor drops below 1.0:
- Liquidators repay part of the borrow position
- Liquidators receive collateral at a discount
- The discount is the liquidation bonus
Liquidation Profit Formula
Liquidation Bonus by Asset
| Asset | Aave Bonus | Compound Bonus | Typical Gas Cost |
|---|---|---|---|
| USDC | 4% | 5% | ~500K gas |
| ETH | 5% | 5% | ~300K gas |
| WBTC | 5% | 5% | ~400K gas |
| LINK | 5% | 5% | ~350K gas |
| UNI | 10% | 5% | ~450K gas |
Flash Loans
Flash loans are uncollateralized loans that must be borrowed and repaid within a single transaction.
Flash Loan Mechanics
Flash Loan Fee
Where is typically 0.05-0.09%.
Flash Loan Use Cases
| Use Case | Description | Profitability |
|---|---|---|
| Arbitrage | Price difference exploitation | High |
| Liquidation | Under-collateralized position cleanup | Medium |
| Self-Liquidation | Repay and re-enter at better ratio | Medium |
| Collateral Swap | Switch collateral type without repayment | Low-Medium |
| Rate Optimization | Move between lending protocols | Low |
Flash Loan Providers
| Provider | Fee | Max Amount | Blockchain |
|---|---|---|---|
| Aave v3 | 0.05% | Pool dependent | Multi-chain |
| dYdX | 0% | $10M+ | Ethereum |
| Balancer | 0% | Pool dependent | Ethereum |
| PancakeSwap | 0.01% | Pool dependent | BSC |
Flash Loan Volume Trends
Credit Delegation
Credit delegation allows users to lend their creditworthiness to others:
Delegation Model
Where:
- = Delegation factor (typically 0.5-0.9)
- = Collateral factor of delegator's assets
Trust Model
- Delegator: Deposits collateral, sets credit limit
- Delegate: Borrows against delegator's collateral
- Risk: Delegate defaults β delegator's collateral is liquidated
- Mitigation: Delegators can revoke and set expiration
Real-World Example: Multi-Protocol Lending Strategy
An advanced borrowing strategy:
- Deposit 10 ETH ($20,000) into Aave as collateral
- Borrow 8,000 USDC at 3.5% APY
- Deposit 8,000 USDC into Compound earning 4.2% APY
- Net result: Earn 0.7% spread on $8,000 while maintaining ETH exposure
Risk Monitoring
const healthFactor = (collateral * price * liquidationThreshold) / (borrow * price);
if (healthFactor < 1.2) {
// Warning: approaching liquidation zone
// Add collateral or repayι¨ε debt
}
Lending Protocol Market Share
Trade-Offs
Lending Protocol Trade-Offs
| Trade-Off | Option A | Option B |
|---|---|---|
| Collateral Efficiency | Higher LTV = more capital efficient | Lower LTV = safer |
| Interest Rate | Variable (market-driven) | Stable (predictable) |
| Liquidation | Fast (protects protocol) | Slow (safer for borrowers) |
| Collateral Diversity | More assets = more flexibility | Fewer assets = lower risk |
| Flash Loans | Available = more attack surface | Unavailable = safer |
Key Decisions
- Variable vs Stable Rates: Variable rates track market; stable rates provide predictability
- Over-collateralization: Higher ratios are safer but less capital efficient
- Liquidation Speed: Faster liquidations protect lenders but harm borrowers
- Oracle Dependency: More oracle sources are safer but increase complexity
Lending Protocol Risk Assessment
Interview Questions
-
Explain how Aave's interest rate model works. What happens to interest rates when utilization exceeds the optimal point, and why is this design important?
-
A user deposits 10 ETH and borrows 5,000 USDC. If ETH drops 30%, what is the new health factor? Should the user add collateral or repay debt?
-
How do flash loans differ from traditional loans? Explain a use case where flash loans can be used for liquidation arbitrage.
Lending Protocol Due Diligence
When evaluating lending protocols, consider:
- Audit Status: Multiple audits from reputable firms
- Bug Bounty: Active rewards for vulnerability reports
- Time Locks: Delay on admin function changes
- Oracle Redundancy: Multiple price feed sources
- Insurance Coverage: Protocol or third-party insurance
- Governance: Decentralization and community involvement
- Track Record: History of security incidents
Lending Protocol Comparison Chart
| Feature | Aave | Compound | MakerDAO | Venus |
|---|---|---|---|---|
| TVL | 3B+ | 1B+ | ||
| Assets | 30+ | 20+ | 10+ | 15+ |
| Max LTV | 80% | 83% | 172% | 80% |
| Flash Loans | Yes | No | No | Yes |
| Multi-chain | Yes | Yes | No | Yes |
| Governance | AAVE | COMP | MKR | XVS |
Lending Protocol Selection Guide
| Use Case | Recommended | Reason |
|---|---|---|
| Maximum LTV | MakerDAO | Highest collateral ratio |
| Flash Loans | Aave v3 | Native flash loan support |
| Multi-chain | Aave/Compound | Cross-chain deployment |
| Simple Interface | Compound | User-friendly design |
| Stablecoins Only | MakerDAO | DAI focus |
Lending Protocol Security Checklist
- Smart contract audits completed
- Bug bounty program active
- Time-locked admin functions
- Multi-signature governance
- Oracle redundancy implemented
- Emergency pause functionality
- Insurance coverage available
- Regular security monitoring
Interest Rate Model Comparison
| Protocol | Model | Parameters | Flexibility |
|---|---|---|---|
| Aave v3 | Jump Rate | Configurable | High |
| Compound v3 | Jump Rate | Fixed | Low |
| MakerDAO | Stability Fee | Governance | Medium |
| Venus | Jump Rate | Configurable | Medium |
Quiz Questions
-
What is the primary purpose of the liquidation threshold in lending protocols?
- A) Determine interest rates
- B) Set maximum borrow limits
- C) Trigger liquidation when health factor drops below threshold
- D) Calculate collateral rewards
-
If a lending protocol has 80% utilization and 10% reserve factor, what percentage of interest goes to suppliers?
- A) 100%
- B) 90%
- C) 72%
- D) 80%
-
What risk do credit delegators face when delegating their credit?
- A) No risk, delegation is always safe
- B) Their collateral may be liquidated if the delegate defaults
- C) They lose their deposited assets immediately
- D) They must pay the delegate's interest