Decentralized Finance (DeFi) has revolutionized the way users interact with financial systems—offering permissionless lending, borrowing, and yield generation. At the heart of these protocols lies a critical risk management mechanism: liquidations. This article dives deep into how DeFi lending platforms protect themselves and their users from undercollateralized positions, ensuring system-wide solvency.
Whether you're a developer, investor, or simply curious about blockchain finance, understanding liquidations is key to navigating DeFi safely and profitably.
👉 Discover how top traders manage risk in volatile markets with advanced tools.
Why Over-Collateralization Matters
In traditional finance, banks often require collateral—like real estate or luxury vehicles—to back loans. However, unlike volatile cryptocurrencies, these assets typically hold value over time. In contrast, digital assets such as ERC-20 tokens and NFTs can experience extreme price swings within minutes.
To mitigate this risk, DeFi lending protocols enforce over-collateralization, meaning borrowers must deposit more in value than they wish to borrow. For example, if you want to borrow $1,000 worth of stablecoins, you might need to lock up $1,500 in ETH.
This buffer protects the protocol. If a borrower fails to repay, the system can seize and sell part of their collateral to cover the debt. Without this safeguard, loans could become bad debt—unrecoverable obligations that erode trust and destabilize the entire platform.
Imagine a scenario where a borrower’s collateral plummets in value overnight. They may choose not to repay, especially if the amount owed exceeds what they’d get back. This creates a shortfall, leaving lenders exposed and reducing confidence in the protocol.
Protocols cannot afford large-scale bad debt. In extreme cases, it could trigger a "bank run," where users rush to withdraw funds—only to find insufficient liquidity.
How Liquidations Work and Why Thresholds Are Crucial
When a borrower’s collateral value drops too close to their debt level, their position becomes undercollateralized—a danger zone for the protocol. To prevent this, most DeFi platforms allow third parties known as liquidators to step in and repay part of the debt in exchange for discounted collateral.
This process is called liquidation, and it serves two purposes:
- It restores the health of the lending pool.
- It rewards liquidators with a profit margin for taking on execution risk.
But why rely on external actors instead of automating everything?
The Gas Cost Problem
Liquidation transactions consume significant gas. If protocols were to initiate every liquidation themselves, operational costs would skyrocket—eating into revenue and potentially destabilizing governance treasuries.
Complexity of Timing
Automatically deciding when to liquidate isn’t trivial. Markets move fast. A fully autonomous system would need real-time price feeds, dynamic thresholds, and intelligent timing logic—all while avoiding front-running by bots.
Instead, protocols incentivize specialized actors—often bots or professional traders—who monitor positions 24/7 and act swiftly when thresholds are breached.
👉 Learn how high-performance trading bots detect liquidation opportunities in milliseconds.
What Triggers a Liquidation?
Each asset has a liquidation threshold, set by protocol governance based on its volatility. For instance:
- Stablecoins may have thresholds near 90% (low risk).
- Highly volatile tokens like MANA or SHIB might be capped at 50–60%.
If a user’s effective collateral falls below this threshold, their position becomes eligible for liquidation.
Time is critical. Protocols design thresholds to give liquidators enough breathing room to act before the position goes underwater—ensuring profitability and system safety.
Case Study: Compound’s Account Liquidity Model
Compound calculates risk using a metric called account liquidity, managed by its Comptroller contract.
The core function, getAccountLiquidity(), evaluates all assets a user has supplied as collateral and all debts they’ve taken across different markets. It uses several key variables:
cTokenBalance: The amount of cTokens (receipts representing deposited assets).borrowBalance: Total borrowed amount including accrued interest.exchangeRate: Converts cTokens back to underlying asset value.collateralFactor: The maximum percentage of an asset’s value that can be borrowed (e.g., 80%).
For each asset, the protocol computes:
Collateral Value = cTokenBalance × exchangeRate × collateralFactor × oraclePriceThen sums all collateral and debt values across assets.
If total collateral exceeds total debt, the account is healthy. Otherwise, it's at risk of liquidation.
Governance caps the collateralFactor at 0.9 (90%), meaning no asset can support borrowing more than 90% of its value—providing a built-in safety margin.
Oracle integration ensures prices reflect real-world conditions in USD terms.
MakerDAO: Precision in Risk Management
MakerDAO uses a dual-contract system for liquidations:
- Cat (v1.2): Handles
bite()calls. - Dog (v2): Manages
bark()after migrating to Liquidation 2.0.
Both contracts use the same safety condition:
ink × spot < art × rateWhere:
ink: Collateral amount (e.g., ETH locked).spot: Oracle-reported price adjusted by liquidation ratio.art: Debt units issued.rate: Accumulated stability fee (interest).
If this inequality holds, the vault is unsafe and subject to liquidation.
Unlike other platforms, Maker expresses all values in DAI, its native stablecoin. This simplifies internal accounting and avoids reliance on external stablecoins.
Aave V2: Health Factor Explained
Aave introduces a powerful metric: the Health Factor (HF). When HF < 1, a position can be liquidated.
It’s calculated as:
Health Factor = (Total Collateral in ETH × Avg Liquidation Threshold) / Total Debt in ETHKey points:
- Denominated in ETH.
- Uses a weighted average of liquidation thresholds across all collateral types.
- Governed by Gauntlet Network, which provides data-driven risk parameters.
An HF above 1 means the user is safe; below 1 means imminent liquidation risk.
Real-World Example: A Deep Underwater Position
Let’s examine a real case from Aave V2: address 0x227cAa7eF6D955A92F483dB2BD01172997A1a623.
At block 13514857, the user borrowed 700,000 MANA when its price was ~0.000328 ETH per token—adding ~229.86 ETH to their debt.
Hours later, MANA surged to ~0.000336 ETH—a small change that increased debt by ~5.5 ETH (~$24,000 at the time).
Shortly after, liquidations began.
Why Were Liquidations Fragmented?
Instead of one large liquidation, 87 separate events occurred between blocks 13520838 and 13522070. Why?
- Protocol Limits: Aave caps each liquidation at 50% of outstanding debt via
LIQUIDATION_CLOSE_FACTOR_PERCENT. - Market Impact: Large-scale sales could crash prices.
- Liquidity Constraints: Liquidators need access to both debt and collateral assets.
- Gas Optimization: Smaller transactions reduce slippage and execution cost.
Eventually, ~50 ETH and ~387,663 DAI were seized—but not enough.
Post-liquidation data showed:
- Remaining collateral: ~0.6 ETH
- Outstanding debt: ~45.27 ETH
- MANA price: ~0.00086 ETH (a 2.6x increase)
The borrower had effectively shorted a rocketing asset—and lost badly.
Without timely intervention, this became bad debt—a loss absorbed by the protocol or insurance mechanisms.
Key Takeaways Across Protocols
Despite differences in implementation, major DeFi platforms share common principles:
- All use functions of collateral-to-debt ratios to assess risk.
- Governance adjusts risk parameters per asset based on volatility.
- Oracles provide pricing in standardized units (ETH, USD, DAI).
Maker and Aave converge on similar mathematical models for safety—highlighting industry best practices.
Frequently Asked Questions
What is a liquidation in DeFi?
A liquidation occurs when a borrower's collateral value drops below a protocol-defined threshold. A third party repays part of the debt and receives collateral at a discount as a reward.
Who can perform liquidations?
Anyone—individuals or bots—with sufficient capital can act as liquidators. No special permissions are required in most protocols.
Can I avoid being liquidated?
Yes. Monitor your health factor or account liquidity closely. You can repay debt early or deposit more collateral to stay safe during market drops.
Why do liquidators get discounts?
Discounts (typically 5–15%) incentivize quick action and cover gas costs and execution risk. Without profit potential, no one would perform liquidations.
What happens if no one liquidates?
Unliquidated undercollateralized positions create bad debt. Protocols may cover losses through reserves or insurance funds—but systemic risk increases.
Is over-collateralization necessary?
Currently yes. While new models like undercollateralized lending with credit scoring are emerging, over-collateralization remains the standard for ensuring trustless security.
👉 Start managing your DeFi portfolio with real-time alerts for liquidation risks.
Final Thoughts
Liquidations are not just punitive measures—they’re essential safeguards that keep DeFi ecosystems solvent and trustworthy. By aligning incentives between borrowers, lenders, and liquidators, protocols maintain balance even in turbulent markets.
Understanding these mechanics empowers users to borrow wisely and capitalize on opportunities without falling into avoidable traps.
As DeFi evolves, expect innovations in risk modeling, oracle accuracy, and automated defense systems—but the core principle will remain: protect the protocol first.
Core Keywords: DeFi lending, liquidation threshold, health factor, over-collateralization, bad debt, account liquidity, decentralized finance