Nadcab logo
Blogs/Defi

How DeFi Liquidation Engines Work Under the Hood?

Published on: 27 Feb 2026

Author: Manya

Defi

Key Takeaways

1
DeFi liquidation is an automated process that sells a borrower’s collateral when its value drops below a safe threshold, protecting lenders from losses.
2
Every DeFi lending protocol uses a health factor or collateral ratio to monitor borrower positions in real time and trigger liquidations when needed.
3
Liquidation bots and keeper networks are specialized software programs that compete to execute liquidations and earn a reward called the liquidation bonus.
4
Price oracles are the critical data layer that feed real-world asset prices into smart contracts, making accurate and timely liquidations possible.
5
Partial liquidations close only a portion of a risky position, while full liquidations close the entire position depending on the severity of the shortfall.
6
Liquidation penalties are fees charged to borrowers whose positions are liquidated, designed to incentivize healthy collateral management.
7
DeFi bad debt occurs when collateral value collapses faster than liquidation bots can act, leaving the protocol with uncovered losses.
8
Flash crashes, oracle manipulation, and network congestion are the three biggest risks to any DeFi liquidation engine.
9
Overcollateralized lending is the foundation of safe DeFi borrowing, requiring borrowers to deposit more value than they borrow as a safety cushion.
10
Well-designed liquidation systems use a combination of tiered penalties, partial closures, and circuit breakers to maintain protocol solvency under all market conditions.

Introduction to DeFi Liquidation

Imagine borrowing money from a bank by leaving your car as collateral. If the value of your car suddenly drops and you can no longer cover the loan, the bank sells the car to recover its funds. This same principle, at lightning speed and without any human intervention, is exactly what happens every single day inside decentralized finance protocols. This automated process is known as crypto DeFi liquidation, and it is the invisible safety net that keeps the entire lending ecosystem from collapsing.

In the world of DeFi, liquidation in crypto refers to the automatic closure of an undercollateralized borrowing position. When a borrower’s collateral value falls below a certain threshold relative to their outstanding debt, the protocol triggers a forced sale of that collateral to repay lenders and restore the system’s financial health. These events, simply called liquidations, happen thousands of times per day across platforms like Aave, Compound, and MakerDAO.

What makes DeFi liquidation so fascinating from a system design perspective is how it combines smart contracts, real time price oracles, economic incentives, and competitive bots into one self sustaining engine. For builders, investors, and learners stepping into the Web3 space, understanding how this architecture works is not just academic. It is essential for protecting capital, designing safe protocols, and making informed decisions in volatile markets.

This guide breaks down the complete architecture of DeFi liquidation systems in plain language, covering everything from the basic concept to the advanced engineering decisions that keep lending protocols solvent even during extreme market crashes.

$8B+
DeFi liquidations (2022)
150%
Typical collateral ratio
5%
Avg liquidation bonus
24/7
Bot monitoring

What Is Liquidation in Crypto?

At its core, liquidation in crypto is a risk management mechanism built directly into DeFi lending protocols. It answers one fundamental question: what happens when a borrower’s collateral is no longer worth enough to cover their loan?

In traditional finance, this scenario leads to a margin call, a legal process, or a negotiation. In DeFi, there are no phone calls and no human judgment. A smart contract monitors every single borrowing position around the clock and the moment a position crosses a predefined risk boundary, the contract automatically opens that position up for liquidation by any party willing to step in.

Simple Definition:
Liquidation in crypto is the forced sale of a borrower’s collateral assets by a DeFi protocol to repay an outstanding loan when the collateral’s value drops too close to or below the loan value.

To understand why this matters, consider how DeFi lending works at a fundamental level. A user wants to borrow USDC. They do not have a credit score or a bank relationship. Instead, they lock up ETH as collateral. The protocol lends them USDC based on that ETH value. But ETH prices move constantly. If ETH drops sharply, the collateral might no longer adequately secure the loan. Liquidation is the protocol’s automatic response to that situation.

This system is what allows DeFi lending to function without trusted intermediaries. The math replaces the middleman. The code enforces the rules. And the financial incentives ensure that liquidators show up to do the work, even at 3am on a Sunday.

Why Liquidations Are Critical in DeFi Lending Architecture?

To appreciate why DeFi liquidation mechanics are so important, you need to understand the risk structure of a lending protocol. Every single dollar lent out on a DeFi platform is ultimately backed by the collateral that borrowers have deposited. If that collateral ever becomes worth less than the outstanding loans, the protocol becomes insolvent and depositors (lenders) start losing money.

Liquidation is the insurance mechanism that prevents this. By forcefully closing risky positions before they become losses, the protocol ensures that lenders are always paid back in full. This is the engine that gives depositors the confidence to provide liquidity in the first place.

1

Solvency Protection

Liquidations ensure the protocol always holds more collateral value than it has outstanding debt, maintaining full solvency at all times.

2

Lender Confidence

When depositors know that unsafe positions are automatically closed, they trust the platform with their funds and provide deeper liquidity.

3

Market Efficiency

Liquidated collateral re-enters the market quickly, preventing price distortions and keeping the broader DeFi ecosystem healthy.

4

Trustless Operation

Because liquidations are automated and code-enforced, no single party can block or delay them, making the system genuinely permissionless.

Without a reliable liquidation system, a DeFi lending protocol would be nothing more than a promise backed by hope. With it, the protocol becomes a self enforcing financial infrastructure that can operate indefinitely without a central authority watching over it.

How Crypto DeFi Liquidation Works Step by Step?

Understanding how DeFi liquidation works step by step reveals why it is considered one of the most elegant pieces of financial engineering in the blockchain space. The process involves multiple actors, multiple contracts, and multiple economic incentives all working together in a matter of seconds.

Complete DeFi Liquidation Flow
Step 1: Borrower Deposits Collateral
Step 2: Protocol Issues Loan (Overcollateralized)
Step 3: Oracle Feeds Real Time Price Data
Step 4: Smart Contract Calculates Health Factor
Step 5: Health Factor Below 1.0?
NO
Position Remains Open
Monitored Continuously
YES
Step 6: Position
Marked Liquidatable
Step 7: Liquidation Bots Detect the Opportunity
Step 8: Bot Repays Debt on Behalf of Borrower
Step 9: Bot Receives Collateral Plus Liquidation Bonus
Step 10: Protocol Solvency Restored
Let us walk through this in simple terms using a concrete example. A user deposits 2 ETH worth $4,000 and borrows $2,000 worth of USDC. This gives them a 200% collateral ratio. The liquidation threshold is 150%. ETH price then drops sharply to $1,400 per ETH, making their collateral worth $2,800. That is now only 140% of their debt, which is below the 150% threshold. The smart contract marks the position as liquidatable. A bot sweeps in, repays the $2,000 USDC debt, and claims the $2,800 of ETH collateral plus a 5% liquidation bonus worth $140. The borrower loses their ETH but the protocol is protected.

Key Metrics: Health Factor, LTV, and Collateral Ratio Explained

Three core numbers define the liquidation risk in DeFi for any given position. Understanding these metrics is essential whether you are a borrower trying to stay safe or a developer building a lending protocol.

Health Factor

> 1.0

A number calculated by dividing the weighted collateral value by the total debt. Any position with a health factor below 1.0 is immediately eligible for liquidation. Aave popularized this metric.

Loan to Value (LTV)

75% Max

The ratio of your loan to your collateral value. A 75% LTV means you borrowed $75 for every $100 of collateral. Higher LTV means higher risk and closer to the liquidation boundary.

Collateral Ratio

150%+

The inverse of LTV. A 150% collateral ratio means you posted $150 of collateral for every $100 borrowed. Most DeFi platforms require a minimum collateral ratio above this level.

Liquidation Threshold

80% LTV

The specific LTV level at which liquidation is triggered. On Aave, ETH has an 82.5% liquidation threshold. Reaching this point means your position can be liquidated by anyone.

Quick Formula: Health Factor = $$(\text{Collateral Value} \times \text{Liquidation Threshold}) / \text{Total Debt}$$ When Health Factor falls below 1.0, the position is liquidatable. The closer your health factor is to 1.0, the more danger you are in.

The DeFi liquidation threshold is not the same as the maximum LTV. There is always a gap between the two. For example, a protocol might let you borrow up to 75% LTV but only liquidate you at 82.5% LTV. That gap is a safety buffer. It means a small price drop will not instantly liquidate you. But a larger or faster drop will breach the threshold and trigger the process.

Liquidation Trigger Logic Inside DeFi Protocols

Understanding how DeFi liquidation works step by step reveals why it is considered one of the most elegant pieces of financial engineering in the blockchain space. The process involves multiple actors, multiple contracts, and multiple economic incentives all working together in a matter of seconds.

Liquidation Trigger Logic Inside a DeFi Protocol
PRICE UPDATE RECEIVED
Oracle pushes new asset price to the lending contract every block or on deviation threshold
POSITION SCAN RUNS
Protocol recalculates health factor for every affected position using the new price data
THRESHOLD COMPARISON
Each position’s health factor is compared against the liquidation threshold defined in the contract
HEALTH FACTOR < 1.0
LIQUIDATABLE FLAG SET
Bot Calls liquidationCall()
on the Contract
HEALTH FACTOR > 1.0
Position Remains Active
Monitoring Continues

On platforms like Aave V3, the trigger logic is implemented through a function called liquidationCall(). Any external address, whether it belongs to a human or a bot, can call this function on an eligible position. The contract verifies the health factor, processes the repayment, releases the collateral, and credits the liquidation bonus, all in a single atomic transaction that either fully succeeds or fully reverts.

The atomicity of this process is crucial. It means a liquidator can borrow funds from a flash loan provider, use those funds to repay the debt, receive the collateral, sell part of it, repay the flash loan, and pocket the profit, all within a single Ethereum block. This is the architecture that makes liquidation bots economically viable even for parties without large amounts of capital.

Role of Oracles in DeFi Liquidations

If the liquidation engine is the heart of a DeFi lending protocol, then price oracles are its eyes. Without accurate and timely price data, the entire system is blind. A protocol cannot calculate a health factor without knowing what its collateral assets are worth right now.

What is a Price Oracle? An oracle is a system that brings off-chain data, like the current price of ETH from Coinbase or Binance, onto the blockchain where smart contracts can read it. Chainlink is the most widely used oracle network in DeFi.

How Oracle Price Feeds Power DeFi Liquidations

Real World Data
CEX prices, DEX prices, market aggregators
Oracle Network
Chainlink nodes aggregate and validate price feeds
On Chain Price Feed
Price data is written on chain per block or deviation
Lending Contract
Reads price, calculates HF, triggers liquidation

Oracle design is one of the most critical architectural decisions in a DeFi protocol. A poorly designed oracle feed can be manipulated by attackers who flash loan large amounts of an asset, distort its spot price on a single DEX, trigger false liquidations, and drain the protocol in one transaction. This is why leading protocols use time weighted average price (TWAP) feeds or aggregate prices across multiple sources through decentralized oracle networks.

The trade-off between oracle speed and oracle security is one of the deepest challenges in DeFi system design. Faster price updates mean faster and more accurate liquidations but also a larger attack surface for price manipulation. Slower feeds are harder to manipulate but may lag behind market reality during flash crashes, leading to bad debt accumulation.

According to Ethereum’s developer documentation, oracles represent one of the most significant trust assumptions in smart contract systems, making their design and selection a top priority for any protocol building on-chain lending.

Keeper Networks and Liquidation Bots Explained

One of the most common questions beginners ask is: who actually executes liquidations? The answer is liquidation bots in DeFi, also known as keepers, and understanding how they work reveals the beautiful incentive design at the heart of decentralized finance.

A keeper is any software program, run by an individual, a team, or a company, that monitors blockchain state and triggers actions when predefined conditions are met. In the context of DeFi lending, keepers scan every open borrowing position across major protocols, calculate current health factors using the same price data as the contracts, and submit liquidation transactions the moment a position becomes eligible.

1

Monitoring Layer

Bots subscribe to on-chain events and price feed updates. They maintain a local database of all open positions and recalculate health factors every few seconds or every block.

2

Profitability Check

Before submitting a transaction, the bot calculates expected profit: liquidation bonus minus gas costs minus slippage. Only profitable liquidations get executed.

3

Flash Loan Integration

Many bots use flash loans to avoid needing upfront capital. They borrow the repayment amount, liquidate, sell the collateral, and repay the flash loan all in one transaction.

4

MEV Competition

Multiple bots compete for the same liquidation. Sophisticated bots use MEV (Maximal Extractable Value) strategies and priority gas auctions to ensure their transaction lands first.

Keeper networks: like Gelato Network and the Keep3r Network have created infrastructure that allows anyone to run a keeper bot without building the underlying infrastructure from scratch. These networks coordinate keeper jobs, handle gas management, and provide tooling that makes it easier to deploy reliable liquidation automation.

The competitive nature of keeper networks is actually a feature, not a bug. Because multiple parties are racing to liquidate eligible positions, liquidations tend to happen very quickly after a threshold is crossed. This speed is critical during rapid market downturns when delays of even a few seconds can mean the difference between clean liquidation and bad debt.

Partial vs Full Liquidations in DeFi Systems

Not all liquidations close an entire position. Modern DeFi protocols have developed a nuanced approach to liquidation that distinguishes between partial and full closures. This distinction is important both for understanding DeFi liquidation mechanics and for designing user friendly systems.

Comparison of Partial vs Full Liquidations

Aspect Partial Liquidation Full Liquidation
Definition Only a portion of the debt is repaid and a corresponding portion of collateral is seized The entire debt position is closed and all collateral is seized
When Used When the health factor is slightly below 1.0 and partial repayment can restore safety When the position is severely undercollateralized or the partial close is insufficient
Impact on Borrower Less severe. Borrower retains partial position and remaining collateral More severe. Borrower loses all deposited collateral
Protocol Safety Sufficient for mildly risky positions. Restores health factor above threshold Required for deeply undercollateralized positions to prevent bad debt
Liquidation Bonus Applied only to the seized portion of collateral Applied to the total seized collateral amount
Gas Efficiency Slightly lower gas cost due to smaller transaction size Higher gas cost but simpler accounting for the protocol
Examples Aave V3 allows up to 50% of debt to be repaid in a single partial liquidation MakerDAO historically processed full closures via Dutch auctions
Borrower Recovery Possible if market recovers after partial liquidation restores health Not possible. Position is permanently closed

The choice between partial and full liquidation is a governance decision baked into the protocol’s parameters. Aave uses a close factor (currently 50%) that limits any single liquidation to repaying at most half the outstanding debt. This reduces the penalty on borrowers who are only slightly under water while still restoring the position’s health. MakerDAO historically used full collateral auctions for its vault liquidations, though its newer liquidation system introduced Dutch auction mechanics for more efficient price discovery.

Liquidation Penalties and Fee Structures

When a position is liquidated, the borrower does not simply break even. They pay a liquidation penalty, also called a liquidation bonus or liquidation incentive depending on whose perspective you take. This penalty serves two purposes: it compensates the liquidator for their capital risk and gas costs, and it discourages borrowers from letting their positions get dangerously close to the threshold in the first place.

Liquidation Bonus (Liquidator’s Reward)
Typically between 4% and 15% of the collateral value. The liquidator receives collateral worth more than the debt they repaid. For example, repaying $1,000 of debt earns them $1,050 to $1,150 worth of collateral at a 5% to 15% bonus.

Protocol Fee Cut
Many protocols take a portion of the liquidation bonus as revenue. Aave’s treasury receives a share of the liquidation bonus, creating a sustainable revenue stream for the protocol.

Net Penalty for Borrower
The borrower loses both the repaid debt value and the liquidation bonus amount from their collateral. A borrower who deposited $1,500 to borrow $1,000 might receive back only $350 to $450 after a full liquidation at a 10% penalty rate.

Variable Rates by Asset
Riskier or less liquid assets carry higher liquidation penalties because they are harder to sell quickly without price impact. Stable assets like USDC collateral typically carry lower penalties.

Fee structures are one of the most politically debated aspects of DeFi protocol governance. Setting penalties too low means liquidators may not find it profitable to liquidate during high gas fee periods, creating a systemic risk. Setting them too high punishes borrowers excessively and discourages participation. Finding the right balance is an ongoing process of data analysis, simulation, and community governance.

Risks and Failure Scenarios in DeFi Liquidation Engines

No system is perfect, and the DeFi liquidation engine has several documented failure modes that every protocol designer must account for. These scenarios represent some of the most costly events in the history of decentralized finance.

Flash Crash Scenario

  • Asset price drops 30% to 50% in seconds
  • Thousands of positions become liquidatable simultaneously
  • Network congestion causes gas prices to spike
  • Many liquidations fail or are delayed
  • Protocol accumulates bad debt before prices stabilize

Oracle Failure or Manipulation

  • Attacker manipulates DEX spot price via flash loan
  • Oracle reports incorrect price to lending contract
  • False liquidations trigger on healthy positions
  • Or: attacker prevents liquidation of their own bad position
  • Protocol loses funds before oracle recovers

Keeper Network Failure

  • All liquidation bots go offline simultaneously
  • Gas fees spike beyond profitable liquidation thresholds
  • Risky positions remain open and accumulate losses
  • Protocol relies on altruistic actors who may not appear
  • Bad debt accumulates in the lending pool

Cascading Liquidations

  • One large liquidation drives down asset prices further
  • Price drop triggers more liquidations in a feedback loop
  • Protocol enters a death spiral of selling pressure
  • Total bad debt exceeds protocol safety reserves
  • Lenders may lose a portion of deposited funds

DeFi Bad Debt: This occurs when the protocol has outstanding loans that exceed the value of recoverable collateral. It is the worst outcome in a liquidation system failure. The March 2020 MakerDAO crisis generated approximately $4 million in bad debt because ETH prices crashed so fast that auction liquidations received zero bids. MakerDAO covered the debt through MKR token issuance, essentially diluting existing holders.

Real World Example of a Crypto DeFi Liquidation Event

Abstract descriptions only go so far. Let us look at a concrete real world case study that illustrates the full complexity of crypto DeFi liquidation under stress conditions.

The May 2021 ETH Price Crash and Aave Liquidations

In May 2021, the cryptocurrency market experienced one of its sharpest corrections of the year, with ETH dropping from approximately $4,200 to under $1,900 within a 48 hour period. This triggered a massive wave of liquidations across every major DeFi lending protocol.

Pre Crash Conditions

Thousands of users had borrowed USDC, DAI, and USDT against their ETH collateral at health factors between 1.1 and 1.3. Many had borrowed aggressively to buy more assets during the bull run.

Price Drop Begins

As ETH price fell, Chainlink oracles updated price feeds. Health factors across the network began declining in real time. Borrowers rushed to either add collateral or repay loans, causing network congestion.

Liquidation Wave Begins

Over $300 million in positions were liquidated on Aave in a 24 hour period. Liquidation bots competed aggressively, with gas prices spiking to hundreds of gwei. Despite the chaos, Aave’s smart contracts processed every valid liquidation without failure.

System Response

Aave’s architecture held because of its partial liquidation design and well-calibrated liquidation thresholds. No bad debt was generated. Every lender received their funds. The protocol emerged with its solvency fully intact.

Lessons Learned

The event demonstrated that well designed liquidation thresholds and deep keeper competition can absorb even extreme market stress. It also showed that network congestion is a real systemic risk that protocol designers must plan for.

This contrasts with earlier failures. As noted in research by the World Economic Forum, DeFi platforms that lack robust liquidation infrastructure are among the most vulnerable to systemic risk during market stress events, underscoring the critical importance of getting this architecture right from the start.

How to Avoid Liquidation in Crypto Lending

For borrowers navigating DeFi markets, understanding liquidation risk in DeFi translates directly into actionable risk management habits. Avoiding liquidation is largely a discipline of monitoring, preparation, and conservative borrowing.

1
Maintain a Safe Health Factor
Never let your health factor drop below 1.5. A buffer of 1.8 or higher gives you significant room to absorb price drops before reaching the liquidation threshold.

2
Set Up Liquidation Alerts
Use tools like DeFiSaver, DeBank, or Zerion to set automated alerts when your health factor drops below a custom threshold so you can react before liquidation occurs.

3
Use Stable Collateral When Possible
Volatile assets amplify liquidation risk. Using stablecoins as collateral eliminates price liquidation risk entirely, though it also limits yield opportunities.

4
Have Emergency Capital Ready
Keep funds available that you can quickly use to repay a portion of your loan or add collateral if the market moves against you during volatile periods.

5
Use Automated Protection Tools
Platforms like DeFiSaver offer automated leveraging and deleveraging. They can automatically repay part of your loan or add collateral to keep your position safe.

6
Understand the Collateral Ratio of Each Asset
Different assets have different liquidation thresholds on the same protocol. ETH and WBTC typically have more favorable thresholds than smaller-cap tokens.

Best Practices for Designing Robust Liquidation Systems

For developers and founders building DeFi protocols, the design of the DeFi liquidation engine is not just a technical challenge. It is a responsibility to every user who deposits funds into the system. Here are the principles that leading protocols use to build liquidation systems that hold up under extreme conditions.

  • Tiered Collateral Parameters: Different assets deserve different LTV ratios, liquidation thresholds, and liquidation bonuses based on their volatility, liquidity, and market capitalization. One size does not fit all.
  • Oracle Redundancy: Never rely on a single oracle source. Use aggregated feeds from multiple providers with circuit breakers that halt liquidations if prices deviate too far from historical norms in too short a time.
  • Liquidation Pause Mechanisms: Implement emergency pause functionality that governance can activate if the oracle system is clearly being manipulated or if a systemic failure is detected.
  • Keeper Incentive Optimization: Ensure liquidation bonuses remain profitable even during high gas periods. Some protocols adjust bonuses dynamically based on current gas prices to maintain keeper participation.
  • Simulation and Stress Testing: Before deploying any change to liquidation parameters, run simulations against historical price data to verify system behavior during past crash scenarios.
  • Bad Debt Insurance: Maintain a protocol safety fund or insurance module (like Aave’s Safety Module) that can cover bad debt in the event that a liquidation fails to recover the full loan value.
  • Partial Liquidation Defaults: Prefer partial liquidation over full liquidation by default. This reduces the penalty on borrowers and makes the economics more forgiving while still protecting the protocol.
  • Gas Optimization in Liquidation Contracts: Poorly optimized liquidation functions cost more gas, making small positions unprofitable to liquidate. This leaves bad debt on the books. Gas efficiency in liquidation code is a direct safety feature.

Building teams and DeFi startups working on lending protocols benefit enormously from partnering with blockchain development firms that have deep experience implementing these systems across multiple deployments. Firms like Nadcab Labs specialize in designing and auditing DeFi risk engines, helping founders avoid the costly mistakes that have plagued earlier generation protocols.

The DeFi liquidation mechanics of today are already remarkably sophisticated compared to the first generation systems deployed in 2019 and 2020. But the pace of innovation in this space continues to accelerate, driven by the painful lessons of past market stress events and by genuinely novel cryptoeconomic research.

1
AI-Powered Risk Engines
Machine learning models that predict liquidation cascades before they happen, allowing protocols to dynamically adjust thresholds and keeper incentives in anticipation of market stress.

2
Cross-Chain Liquidations
As DeFi expands across multiple blockchains, liquidation systems will need to execute collateral and debt positions that span Ethereum, Arbitrum, Solana, and other networks simultaneously.

3
Dutch Auction 2.0 Mechanics
More sophisticated auction systems where collateral is sold at a continuously declining price until a liquidator steps in, allowing for more efficient price discovery and better outcomes for borrowers.

4
Undercollateralized Lending
Protocols using on-chain reputation, credit scoring, or institutional verification to allow borrowing below 100% collateral requirements, requiring new liquidation architectures based on social and legal mechanisms.

5
ZK Proof Integration
Zero-knowledge proofs will allow users to prove their total net worth or collateral position across multiple protocols without revealing exact balances, enabling better risk assessment without privacy loss.

6
Automated Risk Parameter Governance
On-chain algorithms that automatically propose and implement changes to collateral ratios and liquidation thresholds based on real-time market data without requiring a full governance vote every time.

Why DeFi Liquidation Architecture Defines Protocol Survival

DeFi liquidations are not a side feature or an edge case. They are the core safety mechanism that makes decentralized lending possible in the first place. Without a functioning liquidation engine, no DeFi protocol can offer competitive rates to depositors, because no rational person would deposit funds into a system that could not protect them from borrower defaults.

The architecture of a liquidation system reflects the maturity of the team behind it. The best protocols in DeFi today, Aave, Compound, and MakerDAO, have invested years of research, millions in audits, and countless governance iterations into getting their liquidation systems right. Their survival through multiple market crashes is the proof of concept.

For anyone entering the DeFi space, whether as a borrower, a liquidity provider, a keeper bot operator, or a protocol builder, understanding crypto DeFi liquidation is fundamental literacy. It determines how you manage risk, how you design systems, and ultimately how you survive in one of the most dynamic and unforgiving financial environments in the world.

The technology continues to evolve rapidly, with better oracles, smarter auction mechanisms, cross chain capability, and AI assisted risk management on the near term horizon. But the fundamental logic will remain the same: protect the lenders, incentivize the liquidators, penalize reckless borrowers, and keep the protocol solvent through all market conditions. That is the timeless promise of a well engineered DeFi liquidation architecture.

Frequently Asked Questions

Q: Can a liquidated borrower get their remaining collateral back after a DeFi liquidation?
A:

Yes, in most cases. When only a partial liquidation occurs, the remaining collateral stays in the borrower’s position on the protocol. Even after a full liquidation, if the collateral value significantly exceeded the debt plus the liquidation bonus, any surplus is returned to the borrower’s account. However, the exact mechanics vary by protocol, and some older auction based systems have historically distributed surplus less transparently than newer designs.

Q: Is it possible to become a liquidation bot operator and earn income from DeFi liquidations?
A:

Yes, running a liquidation bot is a legitimate and sometimes profitable activity in DeFi. However, it is highly competitive and technically demanding. Operators need programming expertise to build monitoring infrastructure, capital or flash loan access for executing liquidations, and sophisticated gas bidding strategies to win transactions against other bots. For most individuals, the barrier to entry makes it more practical to use established keeper networks than to build a proprietary bot from scratch.

Q: What happens to DeFi bad debt if no one liquidates an underwater position?
A:

If an undercollateralized position remains open without liquidation, the protocol accumulates bad debt. This means the lending pool has more liabilities than assets. Protocols address this through insurance modules, safety reserves funded by protocol fees, or in extreme cases through governance votes that authorize the issuance of native tokens to cover losses. Aave’s Safety Module and MakerDAO’s Surplus Buffer are examples of mechanisms designed to absorb bad debt without harming depositors.

Q: Are liquidations taxable events in most jurisdictions?
A:

In most countries, a DeFi liquidation is treated as a disposal of a crypto asset, which is a taxable event subject to capital gains tax. The collateral that is seized and sold by the protocol is considered to have been sold at its fair market value at the time of liquidation. Additionally, any remaining debt forgiven by the protocol after collateral liquidation may be treated as taxable income in some jurisdictions. Tax treatment varies significantly by country and individual circumstances, so consulting a qualified crypto tax professional is strongly recommended.

Q: Can DeFi protocols liquidate positions on Layer 2 networks the same way they do on Ethereum mainnet?
A:

Yes, DeFi protocols deployed on Layer 2 networks like Arbitrum, Optimism, and Base use the same fundamental liquidation architecture as mainnet deployments. The key difference is that gas costs are much lower on Layer 2, which means smaller positions that would have been uneconomical to liquidate on mainnet become profitable to close on Layer 2. This actually improves systemic safety by ensuring even small risky positions get liquidated promptly. Oracle and keeper infrastructure on Layer 2 has matured significantly since 2022 and now supports fast and reliable liquidations.

Q: What is the difference between a soft liquidation and a hard liquidation in newer DeFi protocols?
A:

Soft liquidation is a newer concept introduced by protocols like Curve’s crvUSD lending system. In a soft liquidation, the protocol automatically converts a portion of the borrower’s collateral into the borrowed stablecoin as prices fall, effectively reducing the position’s risk without an external liquidator. This happens continuously and reversibly as prices fluctuate. A hard liquidation is the traditional forceful closure of a position when the collateral is insufficient even after soft liquidation adjustments. Soft liquidation represents a significant advancement in user protection compared to traditional binary threshold systems.

Q: How do DeFi protocols decide what liquidation threshold to set for each asset?
A:

Liquidation threshold decisions are typically made through governance processes informed by quantitative risk analysis. Key factors include the asset’s historical price volatility, its market capitalization and liquidity depth on major exchanges, the available oracle infrastructure for accurate pricing, and comparisons with how other protocols treat the same asset. Risk teams at protocols like Gauntlet and Chaos Labs specialize in running simulations across thousands of historical and synthetic market scenarios to recommend threshold values that minimize both bad debt risk and unnecessary borrower liquidations.

Q: What role does MEV (Maximal Extractable Value) play in the DeFi liquidation ecosystem?
A:

MEV plays a central role in how liquidations are actually executed in practice. Liquidation transactions are highly profitable and attract MEV searchers who use sophisticated tools to front run or sandwich liquidation calls. Builders and validators can also reorder transactions within a block to capture liquidation opportunities for themselves. While MEV increases competition among liquidators and keeps positions closed quickly, it also means that ordinary users and smaller bot operators face disadvantages against well capitalized MEV firms. Some protocols have explored native MEV capture mechanisms that redirect extracted value back to the protocol treasury.

Q: How do DeFi liquidation systems handle assets with very low liquidity or trading volume?
A:

Low liquidity assets pose a special challenge for liquidation systems because selling large amounts of them quickly can crash their own price, reducing the value recovered and potentially creating bad debt. Protocols address this by setting much more conservative LTV ratios and higher liquidation bonuses for illiquid assets to attract liquidators despite the difficulty of selling. Some protocols refuse to accept certain assets as collateral at all if their liquidity does not meet minimum thresholds. Others implement liquidation caps that limit how much of an asset can be liquidated in a single transaction to reduce market impact.

Q: Is there a way for borrowers to insure themselves against unexpected liquidations in DeFi?
A:

Yes, several options exist. DeFi insurance protocols like Nexus Mutual and InsurAce offer coverage products for liquidation events on specific platforms, though coverage terms and premiums vary. Users can also use automated position management tools like DeFiSaver’s Automation feature, which monitors health factors and triggers protective actions like repaying debt or adding collateral before a liquidation threshold is reached. Some sophisticated users create structured positions across multiple protocols to hedge against liquidation in any single system. While no approach eliminates liquidation risk entirely, combining insurance with automated position management provides meaningful protection against unexpected market moves.

Reviewed & Edited By

Reviewer Image

Aman Vaths

Founder of Nadcab Labs

Aman Vaths is the Founder & CTO of Nadcab Labs, a global digital engineering company delivering enterprise-grade solutions across AI, Web3, Blockchain, Big Data, Cloud, Cybersecurity, and Modern Application Development. With deep technical leadership and product innovation experience, Aman has positioned Nadcab Labs as one of the most advanced engineering companies driving the next era of intelligent, secure, and scalable software systems. Under his leadership, Nadcab Labs has built 2,000+ global projects across sectors including fintech, banking, healthcare, real estate, logistics, gaming, manufacturing, and next-generation DePIN networks. Aman’s strength lies in architecting high-performance systems, end-to-end platform engineering, and designing enterprise solutions that operate at global scale.

Author : Manya

Newsletter
Subscribe our newsletter

Expert blockchain insights delivered twice a month