Liquidations
As described on in the Margin and Shorts section, when a user's Total Collateral Value goes below their Aggregate Maintenance Margin Requirement, that user's portfolio becomes liquidatable. That means that a liquidator can pay off the liquidatee's liabilities in return for their assets at a discounted price. The liquidator retains 80% of the discount fee, while 20% of that fee goes to Evo Exchange.
Liquidation Example
Let's say a user starts off with $20,000 USDC. He would like to 5x long wETH, so he buys 33.33333 wETH at a price of $3,000. That would mean that he has bought $100,000 worth of wETH and needed to borrow $80,000 USDC to do so. The "Initial Margin Fee" for USDC is 0.05%, so he paid $400.00 for that as well, bringing his total liabilities to $80,400 USDC.
The Collateral Multiplier of wETH is 0.9, meaning that his $100,000 worth of wETH is counted as $90,000 in collateral.
The Total Collateral Value of this user's portfolio is currently $90,000 - $80,400 = $9,600, although his actual Total Portfolio Value would be $100,000 - $80,400 = $19,600.
The Maintenance Margin Requirement of USDC is 0.06, meaning that for the $80,400 the user has in liabilities he must maintain a Total Collateral Value above $80,400 * 0.06 = $4,824
Assuming the user has no other assets or liabilities, then this user's Aggregate Maintenance Margin Requirement is also $4,824. If his Total Collateral Value falls below this number, the user may then be liquidated.
The market has suddenly dipped and the price of wETH has gone down to $2,840. The collateral value of the wETH that user holds has now become 33.33333 * $2,840 * 0.9 = $85,200, however his liabilities in USDC have remained the same. The user's new Total Collateral Value is $85,200 - $80,400 = $4,800. Now the Total Collateral Value < Aggregate Maintenance Margin Requirement, this user can be liquidated.
In order to liquidate, a liquidator may provide up to the full amount of any single liability that a liquidatee might have and may choose to receive any asset that the liquidatee has at market price minus the liquidation discount. Market price is currently determined by Stork Network oracles, which also provide the price feeds that determine values for the Total Collateral Value and Margin Requirements.
A liquidator may provide up to $80,400 USDC to completely eliminate this user's USDC liabilities. The current price of wETH is $2,840, however after the liquidation discount, the liquidator receives wETH at a price of $2,840 * (1 - 0.05) = $2,698. The total wETH liquidated in this transaction is $80,400 / $2,698 = 29.8 wETH leaving the liquidatee with 3.53333 wETH in his assets.
The calculation for the fee split between the liquidator and Evo Exchange is also very simple:
In the example above, the discount fee can be calculated as the difference between the market value of the asset and the discounted value. Market value = $80,400 / $2,840 = 28.31 wETH. However, at the discounted value, 29.8 was liquidated. The discount fee charged amounts to 29.8 - 28.31 = 1.49 wETH. When a liquidator calls the liquidation function in the smart contracts, this amount is automatically split 80% to the liquidator and 20% to Evo Exchange, therefore 1.192 wETH go to the liquidator and .298 wETH goes to Evo Exchange. In total, the liquidator in the transaction will receive 28.31 wETH (the market value of the liquidation) + 1.192 wETH (the discount fee) = 29.502 wETH.
Last updated