For the complete documentation index, see llms.txt. This page is also available as Markdown.

Liquidation

In decentralized lending protocols, liquidation is a critical process designed to maintain the stability of the protocol and protect against undercollateralised loans.

The Health Factor in lending protocols is a metric that measures the risk of collateral liquidation. It is closely tied to the Collateral Factor (CF), which represents the percentage of an asset's value that can be borrowed against.

Through oracles, we compute your current Health Factor as follows:

Health Factor=1−borrowBalance∑i(CFi×balancei×pricei)\text{Health Factor} = 1 - \frac{\text{borrowBalance}}{\sum_{i} (\text{CF}_{i} \times \text{balance}_{i} \times \text{price}_{i})}

If your account is in danger of being liquidated, our third-party liquidators may receive up to 50% of your collateral as a result of the liquidation.

If the account’s health has not become positive, it will be liquidated a second time. In doing so, these liquidators will earn a profit on the liquidated sum as a bounty to fortify our protocol.

The new Evaa version has already been deployed in October.

This update introduces several key improvements to the liquidation process:

1) One-Shot Liquidation of Bad Debt

  • In the new version, bad debt can be fully liquidated in a single transaction, removing the previous 50% liquidation cap.

  • A bad debt is defined as a borrow where the collateralization ratio follows:

∑i(Supply Amounti×Pricei)∑j(Borrow Amountj×Pricej)<Liquidation Bonus+1\frac{\sum_{i} (\text{Supply\ Amount}_{i} \times \text{Price}_{i})}{\sum_{j} (\text{Borrow\ Amount}_{j} \times \text{Price}_{j})} < \text{Liquidation\ Bonus} + 1

2) Introduction of the Liquidation Reserve Factor

  • A portion of the transferred liquidation token will be withheld into reserves to enhance protocol security.

  • This mechanism improves the protocol’s financial stability by gradually building reserves from liquidation events.

3) Custom Payloads for Third-Party Smart Contract Invocation

  • Evaa now allows custom payload execution when interacting with third-party smart contracts.

  • For example, liquidators will be able to swap earned collateral directly in DeDust within the same chain of messages, enhancing efficiency and automation.

Liquidator Profit Calculation

To determine the profit a liquidator earns from a specific liquidation event, the following formula is used:

Profit=receivedAssetUSDValue−transferredAssetUSDValue\text{Profit} = \text{receivedAssetUSDValue} - \text{transferredAssetUSDValue}

Both parameters can be retrieved from the transaction log. In the smart contract code, these correspond to:

  • collateral_reward: The amount of the collateral asset received by the liquidator.

  • transferred_amount: The amount of the debt asset repaid by the liquidator.

To calculate the USD value of the profit, token amounts need to be multiplied by their respective market prices.

Protocol Revenue Calculation

EVAA generates revenue from each liquidation event, calculated using the following formula:

Revenue=transferred_amount×10000−liquidation_reserve_factor_for_collateral_asset10000\text{Revenue} = \text{transferred\_amount} \times \frac{10000 - \text{liquidation\_reserve\_factor\_for\_collateral\_asset}}{10000}

Where:

  • transferred_amount: The amount of the debt asset the liquidator repays on behalf of the borrower.

  • liquidation_reserve_factor_for_collateral_asset: A protocol-defined reserve factor that determines the portion of the liquidation amount allocated to reserves.

  • 10000: A scaling factor to normalize percentages.

Revenue is derived from the asset transferred by the liquidator, meaning the USD value must be computed by multiplying by the token price.

The liquidation_reserve_factor_for_collateral_asset is stored in assetConfig under the asset ID of the collateral (the asset the liquidator receives in return). This value can be retrieved for further calculations.

Liquidation Example

Suppose Bob supplied $10,000 in USDC and borrowed TON, equivalent to $6,500. If the value of TON increases by 10%, its worth becomes approximately $7,150, rendering Bob's account susceptible to liquidation.

A liquidator then repays 20% of the TON loan, which is $1,430. They take $1,430 from Bob's USDC collateral to cover the TON and earn an additional bonus of 12% (or $171.6) for executing the liquidation.

As a result:

  • Bob now possesses $8,398.4 in USDC, calculated as $10,000 - $1,430 - $171.6.

  • His TON borrow balance is now $5,720, computed as $7,150 - $1,430.

  • The liquidator spent $1,430 in TON but gained $1,630.6 in USDC.

Subsequently, Health Factor increases from -2,1% to 2.2%.

One-Shot Liquidation Example

With the new one-shot bad debt liquidation feature, if Bob's collateralization ratio falls below the liquidation threshold, a liquidator can fully liquidate the loan in one transaction instead of the previous 50% limit.

Additionally, a portion of the liquidated amount will be allocated to reserves, ensuring protocol sustainability. The liquidator can instantly swap collateralized assets in DeDust via custom payload execution.

For information on becoming a liquidator, please check this github and join community.

Last updated