Liquidation

Overview


Definition

A liquidation refers to a keeper initiating a transfer of an insufficiently collateralized vault’s collateral to itself in exchange for WETH which the protocol will use to pay off the unhealthy vault.

Use of Exchange Rate

One factor that is quite different about Ion liquidations from traditional liquidations is Ion liquidations are not done on the market price of an asset. Rather, they are done on the exchange rate provided by an LST provider. This means that the only events that would trigger liquidations on Ion are slashing events.

This is important to keep in mind since liquidators will still continue to operate on market price since they are looking for atomic profit. It is completely possible for a position to be liquidatable on Ion (because of a sufficiently large slashing event), but the liquidation to be unprofitable because the market price has fallen even further. This is something expected and something that is OK. This liquidation module serves as a nice-to-have where if liquidations are possible on market price, Ion will allow them.

Maintaining Solvency

Ion protocol can also seize unhealthy vaults manually, redeem the collateral into the beacon chain, and repay the unbacked debt themselves. This is possible because Ion operates on the assumption that liquidations are not time-sensitive the way they would be with price-based liquidations.

Once one slashing event has happened, it is unlikely that another will take place within a short time (other than the correlated slashing penalty 18 days later).

Smart Contract Specs


Parameters

All parameters in Liquidation.sol will be deployed immutably. This allows for significant savings in terms of gas through reductions of SLOAD operations.

For a liquidation contract to be able to liquidate positions on IonPool, it must have LIQUIDATOR_ROLE. Despite an immutable storage space, parameter upgradeability is enabled by redeployment. Following this, LIQUIDATOR_ROLE must be revoked from the old deployment and granted to the new deployment.

TARGET_HEALTH - For a successful liquidation, the vault collateral ratio must be brought back to this ratio. This is measured in RAY. (Ex: 1.25E27 means a 1.25 collateral-to-debt ratio)

BASE_DISCOUNT - Base discount percentage added to the discount to calculate the final discount at which the collateral is sold. If the calculated discount was 3% and the base discount was 0.5%, this would lead to the collateral being sold at a 3.5% discount. This is measured in RAY.

LIQUIDATION_THRESHOLD_X - debt-to-collateral ratio at which a vault of ilkIndex X can be liquidated

RESERVE_ORACLE_X - Address of the reserve oracle for ilkIndex X.

Security Considerations

IonPool has MAX approval for WETH (type(uint256).max). This means that a vulnerability in IonPool could lead to attacker control of funds approved to Liquidation.

Liquidation has LIQUIDATOR_ROLE on the IonPool which guards access to confiscateVault(), which is a very powerful function that can arbitrarily change vault positions without liquidity checks.

Smart Contract Variable Definitions

  • Collateral Amount - The amount of underlying collateral deposited.

  • Collateral Factor (Liquidation Threshold)

    • The ratio for permissible borrowing.

    • If the collateral factor is 0.75 and your deposit is worth 100 ETH, then you can borrow 75 allETH.

    • The collateral factor evolves with the riskiness of the underying collateral. As the underlying becomes riskier, the collateral factor decreases.

  • Collateral Value - The value of the deposited collateral in ETH.

    • Collateral Balance * Reserve Ratio * Collateral Factor

  • Liability Value - The amount of debt in a position.

  • Health Factor - The current health of the CDP position. Calculated as collateral/debt.

  • Exchange Rate - The LST provider provider conversion between ETH and the Liquid Staking token

  • Target Health Factor - The optimal health ratio to return a position to after it has become liquidatable. May not always be possible given the current health of the vault.

  • Discount - The benefit to the liquidator.

    • This represents price discrimination - in a way, it represents a pseudo dutch auction. As the health factor of the CDP decreases the discount increases.

Liquidation Methodology and Math


Methodology

There is one entry point into the Liquidation contractβ€” the liquidate() function.

In the context of liquidations, there are 4 relevant scenarios to consider:

  • The vault is not in a liquidatable state (healthy vault)

    • This would lead to the liquidation failing.

  • Then, there are 3 different types of liquidations depending on how unhealthy the vault is.

    1. Partial Liquidation - There is enough collateral within the vault when sold at the current discount rate to reach the target health ratio

    2. Dust Liquidation - While there is enough collateral within the vault when sold at the current discount rate to reach the target health ratio, the amount of debt being paid of would result in the total debt being below the dust. In this case, force a liquidation of the full position.

    3. Protocol Liquidation - There is not enough collateral within the vault when sold at the current discount rate to reach the target health ratio. Assuming MEV searchers only execute profitable transactions, we actually never expect this scenario to be executed.

Math

targetHealthβˆ’mat1βˆ’discount>0targetHealth-\frac{mat}{1-discount} > 0
targetHealth>mat1βˆ’discounttargetHealth> \frac{mat}{1-discount}
βˆ€β€…β€Šdiscount<maxDiscount\forall \;discount < maxDiscount
maxDiscount=1βˆ’1targetHealthmaxDiscount = 1 - \frac{1}{targetHealth}

We set targetHealth to 1.25

1.25βˆ’11βˆ’maxDiscount=01.25 - \frac{1}{1-maxDiscount} = 0
maxDiscount=0.2maxDiscount = 0.2

Last updated