Liquidations
As part of the default settings of the VDEX protocol, accounts whose total value falls below their maintenance margin requirement may have their positions automatically closed by the liquidation engine. Positions are closed via protocol-generated liquidation matches, where a protocol-generated liquidation order uses a calculated “Fillable Price” as the limit price to match against liquidity resting on the order book.
Profits or losses from liquidations are absorbed by the Virtual Insurance Pool (VIP). A liquidated user may have their position partially or fully closed. VDEX includes a liquidation configuration which — as determined by the Virtual DAO — will control how much of the position is liquidated.
How Liquidation Works:
When liquidation is triggered, the Virtual Market Maker (VMM) absorbs the position to maintain market stability.
Positions may be partially or fully closed, depending on the account’s balance and risk exposure.
Liquidations are executed at the best available price on the order book, minimizing slippage.
Liquidation Penalty
As part of the default settings of the VDEX protocol, when an account is liquidated, a portion of the remaining account balance may be taken as a penalty and transferred to the Virtual Insurance Pool (VIP).
The VDEX liquidation mechanism, executed by the Virtual Market Maker (VMM), will always attempt to preserve any positive remaining value in user accounts after satisfying the required liquidation penalty. This penalty is used to strengthen the VIP, which acts as the system’s backstop for managing bad debt and insolvencies.
The liquidation penalty fraction in VDEX is defined by the protocol and is subject to adjustment through Virtual DAO governance.
Isolated Liquidation Price
This is the price at which a specific position reaches the point of liquidation.
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
is the maintenance margin fraction, a percentage that indicates the minimum equity required to keep the position open. 2. Example:
Suppose a trader deposits
$2,000
(so,
e = 2000
)
. The trader shorts6 ETH
contracts(
s = -6
) at
$3,000
(
p = 3000
)
, with a maintenance margin fraction of5%
(
MMF = 0.05
).
The formula becomes:
p' = (2000 - (-6 * 3000)) / (6 * 0.05 - (-6))
Simplifies to:
p' = (2000 + 18000) / (0.3 + 6) = 20000 / 6.3 ≈ 3174.60
This means if the price of ETH rises to
$3,174.60
, the 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:
6 * 3174.60 * 0.05 ≈ $952.38
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 : Suppose a trader deposits$2,000
into their account (e = 2000). Theyshort 3 ETH
(
s = -3
) at an entry price of$3,000
buys 100 Strategy (MSTR)
contracts at$5.00
5% for ETH
and10% for MSTR
.Question: At what ETH price will the short ETH position be liquidated, taking into account the margin requirement from the MSTR position?
SOLUTION
$2,000 deposit
Short 3 ETH at $3,000
Long 100 Strategy (MSTR) contracts at $5 each, with 10% MMF
ETH MMF is 5%
Step-by-step Breakdown:
Inputs:
e=2000e = 2000e=2000
ETH position: s=−3s = -3s=−3, p=3000p = 3000p=3000, MMF=0.05MMF = 0.05MMF=0.05
MSTR position: 100 contracts @ $5, MMF=0.10MMF = 0.10MMF=0.10
Calculate Total Maintenance Margin Requirement (MMRₜ):
MMRₜ = (|s_ETH| · p_ETH · MMF_ETH) + (|s_MSTR| · p_MSTR · MMF_MSTR)
= (3 · 3000 · 0.05) + (100 · 5 · 0.10)
= 450 + 50 = 500
Calculate Other Positions' Margin Requirement (MMRₒ):
MMRₒ = MMRₜ - (|s_ETH| · p_ETH · MMF_ETH)
= 500 - 450 = 50
Plug Into Liquidation Price Formula:
p' = (e - s · p - MMRₒ) / (|s| · MMF - s)
p' = (2000 - (-3 · 3000) - 50) / (3 · 0.05 + 3)
= (2000 + 9000 - 50) / (0.15 + 3)
= 10950 / 3.15 ≈ 3476.19
Conclusion:
If ETH rises to $3,476.19, the short ETH position will be liquidated, because your equity will fall to just enough to cover the total maintenance margin requirement, including the MSTR position.
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 be the sub-ticks of whatever maker order(s) the liquidation order matches against.
Last updated