🚫Liquidation Bot

Liquidation happens when the debt-to-value ratio ("Debt Ratio") of the position exceeds certain threshold ("Liquidation Threshold"), such that the position would be closed by our liquidation bot in order to guarantee the debt repayment. It is critical to keep our lending pools safe for the long-term development of the Eternal Finance ecosystem, as our Market-Neutral Strategy Vault relies heavily on borrowing assets to minimize price effect on the farming position. Both strategy and leveraged yield farming positions have liquidation risks. But in most cases, the strategy position will be stop-loss first instead of being liquidated. You can also reference to position opening form or your portfolio/position section for the safety buffer ("Safety Factor") of each position. The closer the safety factor to zero, the higher the risk of liquidation.

Formula

Let's learn more about our liquidation mechanism with the following example.

Example

Alice decides to farm in APT-USDC liquidity pool, when the price of APT is US$8 and that of USDC is US$1:

  1. Alice opens a APT-USDC leveraged yield farming position, supplying 125 APT (US$1,000) & 3,000 USDC (US$3,000) and borrowing 1,000 APT (US$8,000) with initial leverage at 3X.

  2. Her supplied assets and borrowed assets are then converted to 50:50 portion for creating the LP tokens, such that there are total 750 APT (US$6,000) and 6,000 USDC (US$6,000) in her initial position. Total position value remains unchanged at US$12,000.

  3. Current debt ratio of her position is US$8,000 / US$12,000 = 66.67%.

After a certain day, assume simply that there are no trading fee and yield farming reward reinvested, the price of APT rises to US$12.5 and the price of USDC remains unchanged:

  1. Alice's position now has roughly 600 APT and 7,500 USDC, according to Constant Product Formula (x*y = k). Total position value now becomes US$15,000 (i.e. 600 APT * US$12.5 + 7,500 USDC * US$1).

  2. Total debt value now becomes US$12,500 (i.e. 1,000 APT * US$12.5).

  3. Now the debt ratio of this position would be US$12,500/ US$15,000= 83.33%.

  4. Since the liquidation threshold of this pair hit 83.33%, it will trigger the liquidation bot to close the position (i.e. remove 600 APT & 7,500 USDC from the liquidity pool, swap .

  5. The net equity value before paying liquidation fee will be US$2,500. After paying 5% liquidation fee, Alice will receive 2,375 USDC (US$2,375) in her wallet.​

The liquidation bot will adopt "minimize trading" principal to remove the liquidity and repay outstanding loans, there is a chance that the farmers may get back non-stable tokens or both farming pair tokens subject to the position status at that time.

Liquidation Parameters

Work Factor: The maximum Debt Ratio when opening a position on a pair

Max. Leverage: The maximum Leverage Level when opening a new position on a pair

Liquidation Threshold: The maximum Debt Ratio when the liquidation will be executed

Last updated