Lending serves as the cornerstone of Ethereum-based blockchain applications. With billions in assets loaned, understanding lending mechanisms is critical for developers, architects, and researchers.
Like programming paradigms, DeFi lending protocols have evolved distinct architectural designs, reflecting shifting priorities from security to efficiency and user experience.
This analysis explores the architectures of MakerDAO, Compound, Aave, Euler, and Yield. We highlight key innovations and design patterns that offer valuable lessons for future lending applications.
Lending in DeFi
Most DeFi lending is overcollateralized: users borrow assets by providing collateral exceeding the loan value. Unlike traditional loans, these often lack fixed repayment schedules. However, collateral must always maintain a predefined margin above the loan value—otherwise, liquidation occurs, where repayors receive collateral in exchange for settling debt.
All lending protocols share core building blocks:
- Vaults for storing collateral/borrowed assets
- Accounting systems tracking user positions
- Interest rate mechanisms
- Collateral verification (via oracles)
- Liquidation pathways
- Risk management (global/user limits, minimum collateral ratios)
- User interfaces for deposits/withdrawals
DeFi lending can be modular or integrated. Protocols like Compound and Aave merge lending/borrowing rates, while MakerDAO and Yield originate assets independently.
This article focuses on on-chain borrowing, excluding lending services due to their complexity.
MakerDAO: Security-First Architecture
MakerDAO, launched in 2019, manages $4.95B in collateral with a modular design.
- Vaults: Managed via
Joincontracts (one per approved collateral token). - Accounting: Centralized in
vat.sol, handling debt balances, DAI minting/burning, and risk parameters. - Oracle Dependence: External price/spot rate feeds update
vat.sol—unlike most protocols. - Process: Users interact with multiple contracts to borrow, emphasizing security over gas efficiency.
Key Takeaways:
- Asset-specific vaults
- Centralized accounting + risk management
- External rate generation
- Multi-step borrowing
Yield Protocol: Gas Optimization
Yield v2 (2021) reduced costs while borrowing MakerDAO’s core concepts.
- Cauldron: Single contract for accounting/risk management.
- Joins: Asset-specific vaults.
- Oracles: Unified interface for prices/rates (reversed from MakerDAO).
- Ladle: User-facing intermediary for streamlined interactions.
Borrowing Flow: Single-request loans via Ladle.
Compound Finance: From Simplicity to Complexity
Compound v1 (2019)
- Single
MoneyMarket.solcontract for vaults/accounting. - Internal rates based on asset utilization.
Compound v2
- Introduced cTokens (ERC20 loan positions) for composability.
- Distributed accounting via cToken contracts.
- Auditor contract enforced risk rules.
Compound v3 (2022)
- Isolated pools per borrowable asset (security-focused).
- Single-contract design (lower gas costs).
- Collateral no longer earns yield.
Aave: Shared Liquidity Pools
Aave v1 (2019)
- Pool-based (vs. P2P).
LendingPoolCorecentralized vaults/accounting.
Aave v2 (2021)
- aTokens (collateral) and vTokens (debt).
- Simplified architecture with global accounting in
LendingPool.
Aave v3 (2023)
- Multi-chain support without architectural changes.
Euler: Minimalist Design
Euler’s 2022 launch prioritized gas efficiency via a diamond-pattern architecture:
- Single storage contract accessed via modular proxies.
- eTokens/dTokens as views (no separate vaults).
- RiskManager handles collateral checks.
Despite a 2023 hack (due to code updates), its unified design remains innovative.
Key Trends
- Tokenization: cTokens/aTokens enabled composability (Compound v2 → Aave v2).
- Gas Efficiency: Yield v2/Euler minimized contract calls.
- Security Shift: Compound v3’s isolated pools countered oracle attacks.
- User Experience: Single-interaction flows (Yield’s Ladle).
FAQs
1. Which protocol is best for developers?
- MakerDAO/Yield: For learning modular designs.
- Aave/Compound: For tokenized integration.
2. How do interest rates differ?
- Internal: Compound/Aave use asset utilization.
- External: MakerDAO/Yield derive rates independently.
3. What’s next for lending architectures?
L2 adoption may prioritize cross-chain liquidity over gas optimization.
Conclusion
From MakerDAO’s security-first approach to Euler’s gas-efficient minimalism, Ethereum lending architectures reflect evolving priorities. Future builders should balance:
- Asset storage (vaults vs. tokens)
- Risk management (oracle reliance)
- User experience (transaction costs).
For deeper dives, explore 👉 Ethereum lending analytics or 👉 DeFi protocol docs.
Disclaimer: This content is adapted from original research by alcueca.