Liquidation Mechanisms in DeFi

In the space of DeFi, lending protocols have emerged as game-changers, as they bring incredible features for the users. One of the fundamental structures they operate on is providing loans. The high demand for loans highlights the need for effective liquidation mechanisms as undercollateralized loans lead to bad debts for these protocols. In this blog, we’ll explore the liquidation mechanisms of leading platforms—Aave, Morpho, and Euler—by examining their approach, making comparisons, and analyzing their workings.

Let’s dive right into the topic. đŸ«Ą

What is Liquidation ?

Liquidation is the process that occurs when a borrower's loan becomes undercollateralized—meaning the value of the collateral no longer adequately covers the debt. This can happen when the collateral asset's value drops significantly, or the debt's value rises relative to it. To mitigate risk and prevent losses, the protocol liquidates, or sells off, a portion of the collateral to cover the “bad debt.”

When Does the Loan Become Unhealthy ?

A loan can become unhealthy for several reasons :

  • The value of the collateral asset may decrease.

  • The amount of borrowed debt may increase relative to the collateral provided.

  • The user may struggle to keep up with interest payments.

Note: The two important metrics that help keep track of unhealthy loans are Loan-To-Value (LTV) and the liquidation threshold. As, LTV measures the ratio between the loan amount and the collateral's value. A higher LTV indicates a riskier loan. And liquidation threshold is the point at which a loan becomes eligible for liquidation if the collateral value drops too low relative to the debt.

Aave’s Liquidation Mechanism

  • Launched in 2017, Aave is a decentralized non-custodial liquidity protocol where users can participate as suppliers or borrowers. Suppliers provide liquidity to the market while earning interest, and borrowers can access liquidity by providing collateral that exceeds the borrowed amount.

  • In Aave, each borrower’s loan is tracked using a metric called Health Factor (HF), which shows the relationship between the borrower’s collateral and the amount they owe. In simple terms, HF is nothing but a ratio of collateral to the amount borrowed.

  • A Health Factor of 1 or higher indicates that the loan is safely collateralized, while an HF below 1 signals a risky position, opening the loan to potential liquidation.

HF Formula

The Health Factor is calculated based on the above protocol formula given by Aave.

  • When a borrower’s Health Factor drops below 1, up to 50% of the loan can be liquidated to safeguard the protocol’s funds. With the introduction of Aave v3, a more responsive mechanism comes into play, allowing full liquidation (100%) if the Health Factor decreases past a specific lower threshold.

  • When Hf < 1 the position may be liquidated as described in the diagram below : 👇

    AAVE 02

  • In AAVE, liquidation occurs automatically when a borrower's collateral falls below the liquidation threshold. The system uses liquidators (or bots) to trigger the liquidation and ensure the protocol remains solvent by maintaining an appropriate collateral-to-debt ratio.

How Does AAVE Liquidation Work?

The AAVE liquidation process unfolds in a series of steps, each playing a crucial role in maintaining the platform's stability and protecting lenders' interests:

  1. Health Factor drops below threshold: The first phase in the liquidation process occurs when a borrower's Health Factor (HF) falls below a specified level. This shows that the value of their collateral is no longer adequate to satisfy their existing debt, putting the loan in danger for lenders.

  2. Liquidators Identify unhealthy loans: Once a loan is qualified for liquidation, it is exposed to all AAVE platform users. These users, known as liquidators, are constantly monitoring the marketplace for such chances.

  3. Liquidators initiate liquidation: A liquidator may start the liquidation process by repaying a part of the borrower's debt. In AAVE V2, liquidators may refund up to 50% of the debt; however, in AAVE V3, the Variable Liquidation Close Factor allows them to repay the whole loan (100%) if the HF falls below a certain level.

  4. Liquidators receive collateral at a discount: In return for repaying the debt, the liquidator gets a percentage of the borrower's collateral. However, this collateral is available at a discount known as the liquidation bonus. This payment encourages liquidators to engage in the process, ensuring that unhealthy debts are quickly handled.

Liquidators and Liquidation Penalties

💡 Liquidators : Individuals who buy the assets of borrowers who can't cover their loans because their collateral isn't worth enough, usually for a lower price than its market value.

  • Liquidation Penalty depends on the asset used as collateral. You can find every asset’s liquidation bonus on each protocol version of Aave at https://www.config.fyi/.

  • Let’s consider Example 1 to explain the above statement. ‘A’ deposits 10 ETH as collateral and borrows 5 ETH worth of DAI. If his health factor drops below 1, his loan becomes eligible for liquidation. A liquidator can repay up to 50% of A's debt, which is 2.5 ETH in DAI. In return, they claim A's ETH collateral. With a liquidation bonus of 5%, the liquidator receives 2.5 ETH plus an additional 0.125 ETH, totaling 2.625 ETH.

  • Example 2 where ‘B’ deposits 5 ETH and UNI worth 4 ETH while borrowing 5 ETH in DAI. If his health factor falls below 1, this loan can also be liquidated. Here, a liquidator can repay 50% of the borrowed amount, which is 2.5 ETH in DAI, and claim UNI as collateral. With a higher liquidation bonus of 9%, they earn 2.5 ETH plus a bonus of 0.225 ETH, totaling 2.725 ETH.

💡Liquidation Penalty : Also called the liquidation bonus, is a fee applied to the amount of debt that is redeemed. This fee is deducted from the borrower's collateral, reducing the amount they get back. It also incentivizes liquidators to participate by increasing their potential profit.

Morpho’s Liquidation Mechanism

  • Morpho is a decentralized finance (DeFi) lending protocol founded in 2021, that builds on top of existing lending platforms like Aave and Compound. Its main goal is to optimize how lending and borrowing work by directly matching borrowers and lenders in a peer-to-peer (P2P) way whenever possible.

  • This approach helps users get better interest rates than the regular lending pools because it minimizes the spread between borrowing and lending rates. Morpho ( formerly known as Morpho Blue ) has a liquidation mechanism to mitigate the risk of default and protect lenders’ capital.

How Does Morpho Liquidation Work?

  • In Morpho’s Liquidation Mechanism, Liquidators can liquidate up to 100% of the account’s debt and receive the corresponding collateral value, plus the relative incentive.

  • No fee is taken by the Morpho protocol at this level. The entire Liquidation Incentive Factor (LIF) goes to the liquidator.

LLTV( Liquidation Loan-to-Value )

  • In Morpho, the Liquidation Loan-to-Value (LLTV) is a critical factor for determining when a borrower’s position becomes eligible for liquidation. The LLTV represents the maximum loan-to-value ratio an account can reach before it faces liquidation, depending on the risk level of the asset market (Market A, in this example).

  • When a borrower’s Loan-to-Value (LTV) exceeds the set LLTV for the market, their position is considered “at risk” and eligible for liquidation. This means if the borrower’s debt exceeds the safe borrowing limit defined by the LLTV, liquidators can step in to pay off the debt and receive the borrower’s collateral in return.

  • To incentivize liquidators, Morpho offers a Liquidation Incentive Factor (LIF), which represents a reward for the collateral that liquidators can seize. The LIF varies based on the LLTV of each market, with higher-risk assets potentially offering higher LIFs to attract liquidators.

  • Liquidators can liquidate up to 100% of a borrower’s debt, with no fees taken by Morpho itself. The full Liquidation Incentive Factor (LIF) goes to the liquidator as compensation.

  • The LIF depends on the LLTV( Liquidation Loan-to-Value ) of the market, according to the following formula:

    LIF Formula

  • Here’s a graph of Liquidation Incentive in the function of the Liquidation Loan-To-Value:

Liquidation Mechanisms in DeFi

Liquidation Calculus Example:

  • A borrower provided $100 of collateral in market A, which has an LLTV of 80%.

  • The Liquidation Incentive Factor (LIF) is approximately 1.06 (as per the calculation or the picture above). If the borrower’s debt reaches just above $80 (like $80.00001), the position is liquidatable as the Loan-To-Value (LTV) is just above 80%.

  • A liquidator can repay the borrower’s debt of approximately $80 and: SeizableAssets = debtAmount∗LIF = 80∗1.06 = 84.8

  • The Liquidator will thus seize up to $84.8 of collateral, leaving the borrower with $15.2 of collateral.

The Externalized Risk Management Approach

  • Unlike Aave, Morpho removes the limitations that allow only token holders to participate in risk management on behalf of the users. This approach restricts the number of listed assets, confines users to a single risk profile, and is not scalable.

  • Morpho allows anyone to create markets with any loan asset, collateral asset, risk parameters, or oracle and for users to interact with any deployed market. Morpho’s design offers users the freedom to independently assess and manage their risk and return, without the typical governance restrictions. This flexibility accommodates a wide range of risk preferences and enables diverse applications.

  • Experienced lenders gain more control over their investments, although for users used to having risk management handled by the platform, interacting directly with Morpho might feel complex. To bridge this gap, additional risk management layers can be built on top of Morpho, making it more user-friendly while still offering the benefits of a flexible, self-directed protocol.

  • Morpho Vaults: Morpho Vaults provide a permissionless risk management layer for creating lending vaults on Morpho markets, allowing curators to allocate assets across multiple markets. This enables passive lenders to deposit assets like WETH into a vault, which then manages market choices and risk assessments on their behalf.

  • Risk management is performed externally from Morpho. So any adverse outcomes, like fund losses from technical issues or poor management, do not affect Morpho itself.

Comparison between aave and Morpho

Euler’s Liquidation Mechanism

Euler is a decentralized, permissionless money market protocol founded in 2020 to enable the borrowing and lending of a wide range of assets, including niche tokens. Any token with an ETH liquidity pair on Uniswap V3 can be listed on Euler, allowing it to support more “exotic” assets than traditional platforms like Aave and Compound.

Euler Dutch Auction

Euler’s liquidation mechanism utilizes a Dutch auction framework designed to balance the interests of both borrowers and lenders while minimizing the risk of bad debt.

Foundations of Euler’s Approach to Liquidation:

  1. Health Score Dynamics
  • The health score h(t) is a crucial metric for determining the liquidation status of a position in Euler's protocol. It quantifies the relationship between a borrower’s collateral and debt, thus serving as a vital indicator of financial health. The health score is defined as :

    Form A

Here:

  • c(t): It’s the current value of the collateral. This value fluctuates based on market prices and is crucial for determining the overall health of the position.

  • d(t): It’s the current value of the debt. This value also changes with interest accrual and repayments.

  • A health score greater than 1 indicates that a position is solvent (the collateral value exceeds the debt), while a score less than 1 signifies potential liquidation eligibility. The goal of the mechanism is to maintain the health score above this critical threshold, thereby protecting both the lender’s interests and the borrower’s equity.

  1. Liquidation Incentives
  • Euler's liquidation mechanism effectively ties liquidation incentives to the health score of a position, encouraging timely action by liquidators. The liquidation incentive or bonus b(t) is calculated using :

Form B

Additionally, this can be expressed in relation to the loan-to-value (LTV) ratio v :

Form C

Here:

  • v: Loan-to-value ratio, representing the ratio of the loan amount to the value of the collateral.

  • As the health score decreases, indicating that the position is becoming riskier, the liquidation bonus increases, providing greater motivation for liquidators to act quickly. This approach is particularly effective in discouraging sandwich attacks—malicious strategies where attackers exploit transaction ordering—by ensuring that the price jump needed for an attack increases significantly with the distance from the health score of 1.

  1. Pricing Mechanisms for Liquidation
  • Euler adopts a conservative approach to pricing during different phases of the loan lifecycle, especially regarding liquidation events. This involves stipulating distinct LTV parameters based on the nature of the transaction. For instance, if the LTV threshold for liquidation is set at 0.8, it creates a critical health score required to avoid liquidation.

  • Consider the scenario where v = 0.8 :

Form D

  • This indicates that liquidators would receive a 25% bonus when liquidating a position that is on the brink of insolvency. This significant incentive not only encourages prompt liquidations but also helps maintain liquidity in the protocol by ensuring that unhealthy positions are addressed swiftly.
  1. Risk Mitigation for Flash Loan Attacks
  • To combat potential vulnerabilities from flash loan attacks—where attackers exploit the immediate availability of liquidity—Euler uses specific mechanisms, such as collateral management and liquidation protocols, to minimize the risk of loan defaults..

  • One such measure is the introduction of a cooldown period that restricts immediate liquidations following loan origination or modifications. This cooldown reduces the likelihood of exploitative liquidations occurring shortly after a loan adjustment, thereby enhancing the protocol's resilience against rapid market manipulation.

5. Omniscia's Proposed Variant

  • Omniscia proposes an interesting variant of the Dutch liquidation mechanism that is designed to prevent the liquidation bonus from being able to generate bad debt for a position that is solvent (i.e. over-collateralized).

  • The Omniscia variant of Euler's liquidation mechanism presents a different approach to liquidation incentives. It posits that liquidation bonuses should start at a high value but decrease as the position’s health deteriorates.

The rationale is that when a position becomes unhealthy (h(t)<1), the initial bonus incentivizes quick liquidations, but this bonus gradually decreases as the health score approaches a toxicity threshold. The formula for the Omniscia bonus is :

Form E

  • In this model, if the collateral value exceeds the debt value, the liquidation bonus caps at the surplus collateral. For example, with v = 0.95  a health score of approximately h(t)≈0.0526 or 5.26%, this incentive structure aims to encourage swift liquidation of unhealthy positions. However, partial liquidations can complicate this model, as they may lower the incentives for subsequent liquidators and increase insolvency risks.