How Blockchain Lending Protocols Work
The technical mechanics of DeFi lending — collateralization, interest rate models, liquidations, and oracle design — as seen in Aave and Compound.
Lending protocols are DeFi's most technically complex and highest-stakes applications. Aave, Compound, and Euler have collectively managed billions in user deposits. Understanding how they work is essential for anyone building in the space.
The Core Model: Over-Collateralization
DeFi lending is over-collateralized — you must deposit more value than you borrow. This is the fundamental mechanism that makes trustless lending work. If you want to borrow $1,000 USDC, you might need to deposit $1,500 ETH as collateral (150% collateral ratio). The excess collateral protects lenders from borrower default.
Health Factor
Every borrowing position has a health factor: the ratio of the value of collateral (adjusted by collateral factor) to the value of the debt (adjusted by liquidation threshold). A health factor below 1.0 means the position is undercollateralized and eligible for liquidation. Protocols set these parameters per asset — ETH might have an 80% LTV and 85% liquidation threshold; more volatile assets get lower values.
Interest Rate Models
Interest rates in DeFi are set algorithmically based on utilization rate (borrowed / deposited). At low utilization, rates are low to attract borrowers. As utilization approaches 100%, rates increase sharply to incentivize repayment and additional deposits. This kink model (used by Aave and Compound) has been battle-tested for years.
The Liquidation Mechanism
When a position's health factor drops below 1.0, liquidators can repay part of the debt (up to the close factor, e.g., 50%) and receive the equivalent value in collateral plus a bonus (5–15%). This bonus incentivizes liquidators to monitor positions and act quickly. Effective liquidation is critical — if it's too slow or unprofitable, the protocol can accumulate bad debt.
Oracle Dependency
Lending protocols depend entirely on accurate price feeds. If the price of collateral is manipulated upward, attackers can borrow more than the collateral is worth. This is why every major lending protocol uses Chainlink or TWAP oracles, not AMM spot prices. Oracle design is probably the most security-critical decision in lending protocol architecture.
Aave v3 Innovations
Aave v3 introduced efficiency mode (e-mode) for correlated assets (allowing higher LTV for ETH/wstETH pairs), isolation mode (new assets start isolated with capped exposure), and portal (cross-chain liquidity). These innovations significantly improved capital efficiency while managing tail risks from new asset listings.
Building a Lending Protocol: Key Design Decisions
Asset listing policy (permissioned vs. permissionless), collateral factor settings per asset, interest rate model parameters, liquidation bonus, insurance/bad debt buffer, oracle selection, and governance structure. Each decision has direct security implications. Budget at minimum two full audits from firms with DeFi lending experience.
Related Guides
Ready to build your Web3 project?
Tell us about your project and get a precise quote.
Get a Project Quote