# Liquidation Process

Liquidation is a crucial aspect of trading platforms offering leverage, ensuring no trader's loss exceeds the margin (or collateral) posted to their position. This document provides an overview of the liquidation process on Bluefin, including the liquidation price and liquidation premium calculations.

### Overview

When a trader's margin posted is insufficient for their Margin Ratio (MR) to be above the Maintenance Margin Ratio (MMR), their position becomes eligible for liquidation. Liquidation workers, who are third parties running Bluefin's open-source liquidation worker script, can then proceed to liquidate the position. The liquidation price is displayed in the positions tab, and traders are advised to add margin or lower their leverage to avoid liquidation.

**Liquidation Price**

**Liquidation Price**

The liquidation price is the price at which the MR equals the MMR. It can be calculated using the following formulas:

**Bankruptcy Price**

**Bankruptcy Price**

The bankruptcy price is the price at which the MR becomes zero, and the unrealized loss equals the position margin. It can be calculated using the Liquidation Price formula with the MMR set to 0. If a user is liquidated beyond the bankruptcy price, the exchange incurs a capital drawdown, which is compensated for by the insurance fund.

### Liquidation Premium

The liquidation premium is the equity leftover at liquidation, used to compensate the liquidator and replenish the insurance fund. It is calculated differently for Long and Short positions:

$\text{Liquidation Premium}=\begin{cases} Q_{pos} \{P_{\text{oracle}} - P_{\text{bankruptcy}}\} \quad &\text{if Long}, \\ Q_{pos}\{P_{\text{bankruptcy}} - P_{\text{oracle}} \}\quad &\text{if Short}.\end{cases}$

where,

$Q_{pos}$ is the position size,

and $P_{oracle}$ is the oracle price at the time of the liquidation.

**If** **Liquidation Premium > 0, **it means that the liquidatee’s position is not bankrupt, with MR > 0.

Then, 30% of the Liquidation Premium flows to the Insurance Fund, and 70% flows to the liquidator:

$Flow_{IF} = c_{IF} \times \text{Liquidation Premium}$

$Flow_{L} = c_{L} \times \text{Liquidation Premium}$

where,

$c_{IF} = 0.3$

$c_{L} =1-c_{IF}= 0.7$

**If Liquidation Premium ≤ 0, **it means the liquidatee’s position is underwater (bankrupt) with MR ≤ 0.

Then, to keep the exchange capitalized and solvent, the insurance fund provides for the negative equity of the liquidation:

$Flow_{IF} = \text{Liquidation Premium}$

$Flow_{L} = 0$

### Summary

The liquidation process on Bluefin is designed to protect the platform and its users from the risk of systemic bankruptcy. By calculating liquidation prices, and premiums, and utilizing the insurance fund, Bluefin ensures that no trader's loss exceeds the margin posted to their position. Traders are advised to monitor their positions and take appropriate actions to avoid liquidation.

If Liquidation Premium > 0 (MR > 0): 30% goes to the Insurance Fund, and 70% goes back to the liquidator. Hence, all positive-value liquidations partly capitalize the Insurance Fund.

If Liquidation Premium ≤ 0 (MR ≤ 0): The entire negative Liquidation Premium is compensated by the insurance fund.

Last updated