Liquidations

As part of VDEX’s risk management process, accounts that fall below their maintenance margin requirement may be subject to liquidation. The liquidation engine issues a calculated liquidation order using a “fillable price” designed to match available liquidity on the order book.

If a position is liquidated, it may be closed partially or fully, depending on system parameters. Any resulting impact on system balance is covered by the Virtual Insurance Pool (VIP).

Liquidation parameters, including how much of a position can be liquidated in a single event, are set by the Virtual DAO.

How Liquidation Works:

When liquidation is triggered, the protocol generates a liquidation order using a calculated fillable price designed to match available liquidity on the order book. Positions may be partially or fully closed, depending on the account’s remaining margin and risk exposure. This mechanism ensures that liquidations are handled efficiently while aiming to minimize market impact.

Liquidation Penalty

As part of the default VDEX protocol settings, when an account is liquidated, a portion of the remaining account balance may be collected as a liquidation penalty and transferred to the Virtual Insurance Pool (VIP). The liquidation process, executed by the Virtual Market Maker (VMM), is designed to preserve any positive residual value in user accounts after applying the penalty. This penalty strengthens the VIP, which serves as a backstop for covering bad debt and mitigating insolvencies across the system. The liquidation penalty rate on VDEX is protocol-defined and subject to adjustment through Virtual DAO governance.

Isolated Liquidation Price

This is the price at which a specific position reaches the point of liquidation.

  1. Formula Explanation:

    • The liquidation price p' is calculated using: ​p' = (e - s * p) / (|s| * MMF - s)

    • Here:

      • e Is the current equity in the account?

      • s Is the size of the position.

      • p Is the original price of the position.

      • MMF The maintenance margin fraction, a percentage that indicates the minimum equity required to keep the position open. 2. Example:

      • Suppose a trader deposits $1,000 (e = 1000).

      • The trader shorts 3 ETH contracts (s = -3) at $3,000 per contract, with a maintenance margin fraction of 5% (MMF = 0.05).

      • The formula becomes: p' = (1000 - (-3 * 3000)) / (3 * 0.05 - (-3)) This simplifies to: p' = (1000 + 9000) / (0.15 + 3) = 10000 / 3.15 ≈ 3174.60

      • This means if the price of ETH rises to $3,174.60The position will reach the liquidation threshold.

      • At this price, the trader's remaining equity would be 5% of the notional value of the position or $476.2 based on the calculation (3 * 3174.6 * 0.05 ≈ 476.2).

Cross Liquidation Price

For cross-margining (multiple positions sharing the same margin), the calculation is adjusted to account for the margin used by other positions.

Key Terms:

  • Total Maintenance Margin Requirement (MMR_t): Calculate the maintenance margin needed for all positions at current prices: ​MMR_t = |s| · p · MMF

  • Other Positions' Margin Requirement (MMR_o): Subtract the margin requirement of the position in question from MMR_t: ​MMR_o = MMR_t - |s| * p * MMF

  • New Margin Requirement at Price p': Add MMR_o to the margin requirement of the position at the new price: ​MMR_o + |s| * p' * MMF

  • Liquidation Price Formula: Substitute into the equation to find the liquidation price for the position: ​p' = (e - s * p - MMR_o) / (|s| * MMF - s) Example :

    1. Example:

      • Suppose a trader deposits $1,000 (e = 1000).

      • The trader shorts 1.5 ETH (s = -1.5) at $3,000 and buys 1,000 MSTR at $1.75 (MMF = 10% for MSTR).

      • Calculate Other Positions' Margin Requirement: MMR_o = 1000 * 1.75 * 0.10 = 175

      • Compute the Liquidation Price for ETH: p' = (1000 - (-1.5 * 3000) - 175) / (1.5 * 0.05 + 1.5)

      • This simplifies to: p' = (1000 + 4500 - 175) / 1.575 ≈ 3380.95.

      • If the ETH price reaches $3,380.95, The equity would fall to the required margin level.

Fillable Price for Liquidations

As part of the default settings of VDEX, the “fillable price” (or the limit price of a liquidation order) for a position being liquidated is calculated as follows. For both short and long positions:

Fillable Price (Short or Long) = P × (1 - ((SMMR × MMF) × (BA × (1 - Q))))

Where (provided as genesis parameters):

  • “P” is the oracle price for the market

  • “SMMR” is the spread to maintenance margin ratio SMMR = Config.FillablePriceConfig.SpreadToMaintenanceMarginRatioPpm

  • “MMF” is the maintenance margin fraction for the position

  • “BA” is the bankruptcy adjustment BA = Config.FillablePriceConfig.BankruptcyAdjustmentPpm. Is ≥ 1.

  • Q = V / TMMR where V is the total account value, and TMMR is the total maintenance margin requirement

On the other hand, the “Close Price” will correspond to the price levels of the maker order(s) that the liquidation order matches against on the order book.

Last updated