Skip to main content

Liquidation

Liquidation protects the protocol from bad debt when a position no longer has enough equity to cover its risk. If your equity falls below a safety threshold, the engine will close your position to restore solvency. It is important to note that all collateral is lost in liquidation, therefore it is vital to regularly check your PnL in order to keep your position healthy in the case of market volatility (increasing collateral if necessary).

Liquidation threshold

Within Zenex, the health of a position is evaluated through a so-called 'maintenance margin'. A position becomes eligible for liquidation when:

Equity<maintenanceMarginEquity < maintenanceMargin

Where:

Equity=Collateral+PnLFeesEquity = Collateral + PnL - Fees maintenanceMargin=notionalSize×maintenanceMarginRatemaintenanceMargin = notionalSize \times maintenanceMarginRate

Liquidation price

The liquidation price is calculated slightly differently for shorts and longs, as is shown below:

liquidationPriceLong<openPrice+openPrice×maintenanceMargin+feeBuffercollateralnotionalSizeliquidationPriceLong < openPrice + openPrice \times \frac{maintenanceMargin + feeBuffer - collateral}{notionalSize} liquidationPriceShort>openPriceopenPrice×maintenanceMargin+feeBuffercollateralnotionalSizeliquidationPriceShort > openPrice - openPrice \times \frac{maintenanceMargin + feeBuffer - collateral}{notionalSize}