♻️Liquidations

Liquidations are a core mechanism that ensure the stability and safety of the protocol, especially in leveraged or borrowed positions. When users borrow against their collateral or leverage their positions, they must maintain a healthy ratio between the value of their collateral and the amount they’ve borrowed. This ratio is managed through what is known as the Health Factor, as firstly mentioned in AAVE Protocol.

Health Factor

The Health Factor is a numerical representation of how secure a borrower’s position is within the YieldX protocol. It is calculated based on the value of the collateral versus the amount borrowed. A Health Factor greater than 1 means the position is safe, while a Health Factor less than 1 means the position is at risk of liquidation.

For example, if you have $1,000 worth of assets as collateral and you borrow $500, your Health Factor might be around 2. But as the value of your collateral decreases or the amount you owe increases (due to interest or market fluctuations), the Health Factor can drop closer to 1.

Triggers For Liquidation

When the Health Factor falls below 1, the position becomes under-collateralized, meaning the borrower may not have enough assets to cover the borrowed amount. This is when a liquidation event is triggered.

In this scenario, the YieldX protocol allows a liquidator (someone who is incentivized to monitor these events) to step in and pay off part of the borrower’s debt. In exchange, the liquidator receives a portion of the borrower’s collateral. This process helps to ensure that the protocol remains solvent and that bad debts are minimized.

Uniswap V3 Liquidations

When it comes to liquidity provision in Uniswap V3, positions are represented as NFTs (ERC721 tokens). YieldX handles these positions by wrapping them into ERC1155 tokens, which allow for fractional ownership of the liquidity position. This process ensures smooth liquidations without disrupting the entire position.

If a user becomes eligible for liquidation, part of their LP tokens are distributed to the liquidator in ERC1155 format. For example:

Imagine John provides liquidity in a Uniswap pool by supplying $1,000 worth of assets, equally split between ETH and USDC. He then borrows $400 USDC against his position through YieldX. Over time, the price of Ethereum drops significantly, reducing the value of John’s collateral. As a result, his Health Factor falls below 1, meaning his position is now under-collateralized and at risk of liquidation.

At this point, Sarah, a liquidator in the protocol, can step in and repay $200 of John’s debt. In return, Sarah receives 50% of John’s Uniswap liquidity position (in ERC1155 tokens), representing an equivalent value of $500 in the liquidity pool. John retains the remaining 50% of his position, valued at $500, which he can still use once his debt is fully repaid.

After this liquidation event, John can either repay his remaining $200 debt and regain full control of his remaining collateral or continue to manage the smaller position. Meanwhile, Sarah benefits from acquiring part of John’s liquidity position, which she can either hold or sell for a profit, depending on the market conditions.

This process ensures that John is not entirely wiped out, while also maintaining the protocol's solvency by redistributing risk to Sarah, the liquidator.

Preventing Liquidations

To avoid liquidation, users are encouraged to:

  • Monitor their Health Factor: Regularly check the health of their positions, especially in volatile markets.

  • Repay part of their loan: Reducing the borrowed amount can increase the Health Factor.

  • Add more collateral: Increasing the value of the collateral will also help maintain a safer Health Factor.

Role of Liquidators

Liquidators play an essential role in the ecosystem by ensuring that under-collateralized positions are promptly resolved. They are incentivized with rewards (a portion of the collateral) to cover part of the borrower’s debt, ensuring that the system remains stable and liquid.

In summary, liquidations are a safety mechanism to protect both the borrower and the protocol from becoming insolvent. By closely monitoring their positions, YieldX users can avoid liquidations and maintain their leveraged or borrowed assets. Meanwhile, liquidators help ensure that the protocol remains healthy by stepping in to settle at-risk positions. This system balances risk between the protocol, the borrower, and liquidators, maintaining trust and stability in the YieldX ecosystem.

Last updated