Liquidations

Introduction

The Liquidations mechanism is the fundamental component that guarantees (or intends to) the solvency of the system. As such, its importance cannot be overstated.

When and if an asset passes the whitelisting process, it will be assigned a Liquidation LTV. A liquidation is a process that occurs when a borrower's health factor goes below 1 due to their collateral value not properly covering their loan/debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value against each other. This collateral vs loan value ratio is shown in the health factor (HF). In a liquidation, up to 50% of a borrower's debt is repaid and that value + liquidation fee is taken from the collateral available, so after a liquidation that amount liquidated from your debt is repaid.

Liquidations occur inside the liquidator’s credit account. Any liquidated assets are sent directly to the liquidator’s credit accounts rather than the user’s wallet. Because liquidators must use the credit manager to initiate a liquidation, they can borrow the funds required to pay down Bank debt. This is possible because the transactions can be completed in a single transaction. Specifically, a liquidator can borrow the debt asset, swap the collateral asset back to the debt asset and repay the Bank all at once. In this way, credit accounts enable a flash-loan like mechanism to facilitate liquidations.

Liquidations follow a multi-step process:

  1. A third-party liquidator uses on-chain data to identify an account that has a health factor -1.

  2. This liquidator identifies a debt asset they wish to pay back on behalf of an account.

  3. This liquidator also identifies the collateral asset they wish to receive.

  4. The liquidator pays back an arbitrary amount of the user’s debt, up to the close factor (i.e. if the close factor is 50%, the liquidator can only repay up to 50% of the user’s debt in a single liquidation transaction).

  5. The liquidator receives a portion of the user’s collateral equal to the debt repaid and a liquidation bonus (i.e. if the liquidation bonus of the given collateral asset is 10% and the liquidator repaid an equivalent of $100 USD of the user’s debt, the liquidator would receive $110 USD worth of the user’s collateral)

Consider the following liquidation example.

  1. First, a user deposits and borrows from the Bank. Over time, the value of their deposit falls. This pushes their health factor below 1 and makes the account eligible for liquidation.

  2. A liquidator then identifies the account, pays off a portion of the debt, and receives a 5% liquidation bonus. The user retains a portion of their debt plus their original deposit(s) minus the liquidation bonus.

Credit Account Health Calculation in the UI

In the UI, Credit Account Health is calculated using a logarithmic function with a base of 3.5. This logarithmic HF calculation offers a more intuitive and responsive representation of account health. Here's how the Health Factor (HF) is interpreted in this system:

Health Status Thresholds

  • Healthy Accounts: An account is considered "Healthy" when its HF reaches 1.5 or higher, signifying a relatively stable and secure state.

  • 100% Health: An account achieves 100% health at an HF of 3.5, indicating optimal health and safety.

  • Liquidate-able Accounts: The health of a liquidate-able Credit Account is 0%, underscoring the need for timely action when an account reaches this state.

This logarithmic approach ensures that users can more easily understand and monitor the health of their credit accounts without the need for linear conversion. If your credit account is approaching 0, you know you are at risk of liquidation.

Liquidation Mechanism

In the liquidations mechanism, the LB isn’t static but rather changes with the HF of the position. All else equal, the lower the HF of a position, the higher the LB offered to liquidators will be. This mechanism, pioneered by Euler, intends to recreate a Dutch Auction where, instead of time determining how the LB increases, the HF does. Let’s explore a simplified example of how this model could work*:

  • Assume we have a position with some collateral and some debt.

  • Assume we have parameterized the liquidations system such that the LB increases linearly as the HF decreases (i.e. for every 1pp the HF drops, the LB increases by 1pp).

  • Now, imagine the price of the collateral drops and the HF decreases to 0.99. At that moment the LB would be 1% (1-0.99).

  • 1% doesn’t seem to be enough incentive for liquidators as no liquidations happen at that time.

  • After some time, however, the HF drops to 0.97. At that moment, the LB offered would be 3%.

  • As 3% is enough for a liquidator, a liquidation happens at that level.

Note that this example follows a specific parametrization of the system. If parametrized differently, the results might be different. What will tend to be the same across all parametrizations though, is the inverse relationship between the HF and the LB.

The exact formula for calculating the LB under the new mechanism is as follows:

Liquidation Bonus = min(intercept + (slope * (1 - HF)), maxLB*)

maxLB* = max(min(CR - 1, maxLB), minLB)

Where:

  • CR is the Collateralization Ratio of the position, defined as the value of the assets divided by the value of the debt.

  • HF is the Health Factor of the position.

  • Intercept and slope are governance defined parameters that determine how the LB increases as the HF decreases.

  • maxLB and minLB are governance defined parameters that determine the maximum and minimum values the LB can have.

Now let’s explore how the CF is determined under this model. Within this new system, the CF will be determined dynamically using a parameter known as the Target Health Factor (THF). The THF is a governance defined parameter that determines the ideal HF a position should be left at immediately after the position has been liquidated. The CF, in turn, is a result of this parameter: the maximum amount of debt that can be repaid to take the position to the THF. For example, if the THF is 1.05 and a position gets liquidated at HF = 0.98, then the maximum amount of debt a liquidator can repay (in other words, the CF) will be an amount such that the HF after the liquidation is at maximum 1.05. Notice that, in a similar vein to the LB, all else equal, the lower the HF of a position, the higher the CF will be. This makes sense since the HF is the best proxy we have for the riskiness of a position. As such, the riskier a position, the higher the CF allowed when liquidating it.

So, how does this system improve upon the points described above?:

Capital efficiency:

  • The LB is determined dynamically as a function of the HF. If we assume that the HF of a position will tend to drop gradually, then this mechanism will tend to gradually increase the LB offered to liquidators as the HF decreases. If this happens, then we generally expect liquidations to happen at the lowest possible LB that generates a profitable liquidation. Thus, this system will likely lead to lower LBs (and better conditions for borrowers) and less value leakage for the protocol.

  • The CF methodology also has the potential to lead to better capital efficiency. In particular, the lower the THF chosen, the lower the CF will be and the more capital efficient the system will be. The lower the THF, however, the less margin of safety the liquidation gives the position after liquidation. Thus, there’s a balance to strike here between capital efficiency and margin of safety when determining the THF.

Systemic Robustness:

  • Liquidations cascades: As covered above, this system is likely to lead to lower LBs and CFs. All else equal, this means lower values of liquidated collateral and thus, a lower risk of liquidation cascades. Furthermore, this system is likely to lead to fewer liquidations overall. Under this system, for instance, a position that hovers around HF = 1 might not offer a sufficient LB for immediate liquidation. In time, such positions could become healthy again, meaning that fewer liquidations were even needed. This property also leads to a decreased risk of liquidation cascades.

  • MEV: As mentioned above, if the LB increases gradually, the most efficient liquidator will tend to liquidate first. If that’s the case, this has the potential to lead to no congestion issues at all, since the most efficient liquidator will tend to liquidate alone, without any competition from more inefficient liquidators.

Flexibility: Under this model, the right LB doesn’t need to be determined a priori. Rather, it will be set by a market-driven mechanism where the final LB will depend on market conditions at that specific point in time. This solves for the arbitrariness of having to define a fixed LB a priori for any and all future market scenarios.

As with most decisions in DeFi, the implementation of this new mechanism comes with tradeoffs. The most important one is that it’s a more complex mechanism. This additional complexity might translate into unforeseen issues at both the economic (incentives) and smart contract levels. Furthermore, this migration implies moving from a relatively battle-tested mechanism to a completely new implementation. These risks mean that there is increased potential for hacks, exploits, economic manipulations, and smart contract bugs, which could result in loss of funds for both current and future depositors, with no remedy, recovery or refund mechanism to the adversely affected users.

More examples

Example 1

Bob deposits 10 ETH and borrows 5 ETH worth of USDT. If Bob’s Health Factor drops below 1 his loan will be eligible for liquidation. A liquidator can repay up to 50% of a single borrowed amount = 2.5 ETH worth of USDT. In return, the liquidator can claim a single collateral which is ETH (5% bonus). The liquidator claims 2.5 + 0.125 ETH for repaying 2.5 ETH worth of USDT.

Example 2

Bob deposits 5 ETH and 4 ETH worth of INJ, and borrows 5 ETH worth of USDT If Bob’s Health Factor drops below 1 his loan will be eligible for liquidation. A liquidator can repay up to 50% of a single borrowed amount = 2.5 ETH worth of USDT. In return, the liquidator can claim a single collateral, as the liquidation bonus is higher for INJ(15%) than ETH (5%) the liquidator chooses to claim INK. The liquidator claims 2.5 + 0.375 ETH worth of INKfor repaying 2.5 ETH worth of USDT.

Liquidation Fee

The total liquidation fee (TLF) charged to a liquidated user will be equal to the liquidation bonus:

Total Liquidation Fee = Liquidation Bonus

Protocol Liquidation Fee

The Protocol Liquidation Fee (PLF) is a fee charged whenever a liquidation happens that flows to the protocol. The PLF is defined as a % taken from the Liquidation Bonus. For example, if the PLF is 20% and the liquidation bonus of a given liquidation transaction is 100 USD, the PLF would be equal to 20 USD and would flow to the protocol (the remaining 80 USD would flow to the liquidator). Some additional details:

  • Fee Flow: Initially, 100% of the fee will flow to the Safety Fund.

    • ^ The swapping of these fees could be handled in a similar way to protocol fees received from interest payments; they get accumulated somewhere until swapping them makes sense.

  • How it’s determined: Governance determined and updatable on a global basis.

Liquidation Bonus (LB)

The LB flows to liquidators (and a part to the protocol) and is designed to incentivize liquidators to liquidate unhealthy positions. Specifically, the LB defines the additional reward liquidators will receive when liquidating a user. For example, if the LB is 5% and the PLF is 20%, a liquidator that repays 100 USD worth of debt will receive 104 USD (= 100 * (1 + ((1 - PLF) * LB)) = 100 * (1 + (0.8 * 5%)) = 100 * 1.04 = 104) worth of collateral as a reward for liquidating the unhealthy position.

The LB will depend on the Health Factor and a couple other parameters as follows:

Liquidation Bonus = min(B + (slope * (1 - HF)), maxLB*)

maxLB* = max(min(CR - 1, maxLB), minLB),

Where:

  • B marks the level at which the LB starts when HF drops marginally below 1.

    • If set at 1%, at HF = 0.999 the LB will be 1%. If set at 0%, the LB starts increasing from 0% as the HF drops below 1.

    • How it’s determined: Governance determined and updatable on a per collateral basis.

    • Values it can take: [0%, 10%]

  • slope defines the slope at which the LB increases as the HF decreases. The higher the slope, the faster the LB increases as the HF decreases.

    • If set at 1, for every percentage point the HF decreases, the LB increases by a percentage point.

    • How it’s determined: Governance determined and updatable on a per collateral basis.

    • Values it can take: [1, 5]

  • maxLB* determines the maximum liquidation bonus that can be granted to the liquidator, taking into account the Collateralization Ratio (CR) of the position and a governance defined minLB parameter.

  • CR is the Collateralization Ratio of the position.

    • Calculated as CR = Total Assets / Total Debt.

    • Notice that, all else equal, the lower the CR, the lower the LB that can be granted to the liquidator. The rationale here is to avoid granting large liquidation bonuses when the position has a low collateralization level or is undercollateralized.

  • maxLB is the maximum LB that can be granted to a liquidator; in other words, the maxLB establishes a ceiling to the LB. This is a precautionary parameter to mitigate liquidated users being over-punished.

    • How it’s determined: Governance determined and updatable on a global basis.

    • Values it can take: [5%, 30%]

  • minLB is the minimum LB that will be granted to liquidators even when the position is undercollateralized.

    • This is the minimum incentive we want to offer liquidators to close a position even when it is undercollateralized.

    • How it’s determined: Governance determined and updatable on a global basis.

    • Values it can take: [0%, 10%]

Close Factor

The Close Factor (CF) determines the maximum amount of debt that can be repaid in a single liquidation transaction. For example, if the CF is 50%, a liquidator can repay up to 50% of the user’s debt in one single transaction.

*How it works

Within this new system, the CF will be determined dynamically using a parameter known as the Target Health Factor (THF). The THF is a governance defined (and updatable) parameter that determines the ideal HF a position should be left at immediately after the position has been liquidated. The CF, in turn, is a result of this parameter: the maximum amount of debt that can be repaid to take the position to the THF. For example, if the THF is 1.10 and a position gets liquidated at HF = 0.98, then the maximum amount of debt a liquidator can repay (in other words, the CF) will be an amount such that the HF after the liquidation is at maximum 1.10.

Code Safeguards

Values THF can take: [1, 2]

Formula

The formula to calculate the maximum debt that can be repaid by a liquidator is as follows:

Where:

  • MDR: Maximum Debt Repayable

  • THF: Target Health Factor

  • $Debt_0$: Value of debt before the liquidation happens

  • $Collateral_0$: Value of collateral before the liquidation happens

  • LTV: LTV of the collateral

  • TLF: Total Liquidation Fee

Edge cases

All debt is liquidatable: When MDR is less than 0, it means even repaying the whole debt is not going to be enough to bring the account back to the THF, so the liquidator should be able to repay all the available debt. Given the numerator in the MDR formula above is always greater than 0, MDR less than 0 happens when the denominator is less than 0.

Last updated