Margin
Margining on VDEX
VDEX uses a dynamic margining system to manage trading risk. Each market defines two key parameters that determine the collateral requirements for opening and maintaining positions:
Initial Margin Fraction (IMF): The minimum percentage of collateral required to open a new position. On VDEX, this value scales dynamically with open interest to reflect market activity and risk.
Maintenance Margin Fraction (MMF): The minimum percentage of collateral required to keep a position open. If your collateral falls below this threshold, the position becomes eligible for liquidation.
Open-Interest-Based IMF
On VDEX, the Initial Margin Fraction (IMF) increases as open interest grows, scaling between a defined lower and upper bound. This ensures that margin requirements increase during periods of high leverage and market activity, discouraging overexposure and protecting the system.
The IMF scales linearly between two parameters:
open_notional_lower_cap
open_notional_upper_cap
(both denominated in the market's base collateral, e.g., WETH,WBTC or USDC)
Margin Formula
open_notional = open_interest * oracle_price
scaling_factor = (open_notional - open_notional_lower_cap)
/ (open_notional_upper_cap - open_notional_lower_cap)
IMF_increase = scaling_factor * (1 - base_IMF)
effective_IMF = Min(base_IMF + Max(IMF_increase, 0), 100%)
The effective IMF begins at the base value and increases linearly with open interest. Once open interest reaches the upper cap, the IMF hits its maximum of 100%, meaning traders must post full collateral (1:1) to open new positions.
Note: The Maintenance Margin Fraction (MMF) remains fixed and does not scale with open interest.
Detailed Margin Calculation
VDEX calculates margin requirements based on position size, market price, and predefined risk parameters for each market. These calculations ensure that all positions remain properly collateralized under varying conditions.
Single Position Margin
For an individual position, the margin requirements are calculated as:
Initial Margin Requirement = abs(S × P × I)
Maintenance Margin Requirement = abs(S × P × M)
Where:
S
= Size of the position (positive if long, negative if short)P
= Oracle price of the assetI
= Initial margin fraction (per market)M
= Maintenance margin fraction (per market)
Account-Level Margin
For accounts holding multiple positions across different markets, total margin requirements are calculated by summing the margin for each market i
:
Total Initial Margin Requirement = ∑ abs(Sᵢ × Pᵢ × Iᵢ)
Total Maintenance Margin Requirement = ∑ abs(Sᵢ × Pᵢ × Mᵢ)
Total Account Value (Equity)
The total account value includes both quote assets (e.g., USDC or WETH) and the value of all open positions:
Total Account Value = Q + ∑ (Sᵢ × Pᵢ)
Where:
Q
= User’s quote balance in the collateral asset (e.g., USDC). This may fluctuate with deposits, withdrawals, PnL, funding, and liquidations.S
andP
as previously defined.
This value represents equity and is used to determine whether the account meets margin requirements.
Free Collateral
The amount of margin available for opening new positions or increasing current ones is called free collateral, calculated as:
Free
Collateral = Total Account
Value
- Total
Initial
Margin Requirement
If free collateral is insufficient to support new or expanded positions, the trade will be rejected. If the total account value drops below the maintenance margin requirement, the account is at risk of liquidation.
VDEX continuously updates these calculations using the latest oracle prices to ensure accurate margin tracking in real-time
Last updated