Subaccounts, Isolated Margin, and Health
Defining Vertex's subaccount design and weighted margin calculations.
Subaccounts â Cross Margin by Default
Each address on Vertex can open up to 4 subaccounts on the Vertex front-end. Vertex treats each subaccount as an independent account with its own margin, balances, positions, and trades. If liquidated, the only assets at risk are those in a subaccount. Traders with assets in multiple subaccounts do not carry risk between those subaccounts.
By default, all subaccounts on Vertex are cross-margined. The benefits include:
Capital efficiency.
Lower risk of liquidation on positions.
Ability to easily compound profits.
To learn more about Vertexâs Cross Margin accounts, click here.
Isolated Margin
On many exchanges, users can trade with Isolated Margin. Isolated Margin is an unshareable margin assigned to a single leveraged position, enabling users to isolate the capital at risk to a single position.
Traders on Vertex can isolate risk associated with individual positions by opening new subaccounts. For example, to create an isolated margin position on Vertex, a trader could create a new subaccount, deposit collateral, and open a new position.
Health
Vertex uses a concept of weighted margin, which we refer to as Health, to enable efficient cross-margining across products. Health is used to determine if an account can open new positions or can be liquidated in the event of adverse price movements.
Healthâs purpose is to allow ALL positions in a userâs account to contribute to their margin and trading activity. The result is:
Better capital efficiency.
Improved risk management.
Boosted portfolio flexibility.
Increased utility for tokens.
As a result, several factors need to be considered.
Health Types
There are two types of health:
Maintenance Health: If Maintenance Health < 0, accounts can be liquidated.
Initial Health: If Initial Health < 0, accounts cannot open new positions.
In the parlance of other exchanges:
Maintenance Health â USDC to Liquidation
Initial Health â Free Collateral
Assets
Given the inclusion of all assets in a portfolio, it is necessary to account for the following:
Collateral Quality
Volatility
Liquidity
This is achieved by assigning a âweightâ to all products.
Weight Parameters
Each product has four parameters:
maintenance_asset_weight
maintenance_liability_weight
initial_asset_weight
initial_liability_weight
Maintenance health is computed using maintenance weights, and initial health is calculated using initial weights.
Spot Health
Spot assets are the core collateral assets for Vertex. For example, tokens deposited into Vertexâs smart contracts can be used to trade other assets
The formula to calculate Spot Health is:
Example:
A user has 5 BTC in their account, and BTC spot is trading at $10,000. Letâs calculate the initial and maintenance health:
maintenance_asset_weight = 0.9
maintenace_liability_weight = 1.1
initial_asset_weight = 0.8
initial_liability_weight = 1.2
Therefore:
Initial Health = 5 * 10,000 * 0.8 = $40,000
Maintenance Health = 5 * 10,000 * 0.9 = $45,000
Given the lack of other positions in our account, our user has $40,000 of collateral value available for new positions.
Perpetual Health
Perpetuals are the other primary product type on Vertex. Perpetuals on Vertex are also subject to variable funding rates that tether the price to the underlying spot asset. For details on funding rate calculations for perpetuals, skip to the section covering the topic here.
Given their embedded leverage, perpetuals have a similar but slightly different calculation for health:
Example:
A user decides to short 5 BTC-Perps, and the price is $10,000. Letâs calculate the initial and maintenance health:
maintenance_asset_weight = 0.95
maintenace_liability_weight = 1.05
initial_asset_weight = 0.9
initial_liability_weight = 1.1
Therefore:
Initial Health = -5 * 10,000 * 1.1 - (-5 * 10,000) = -$5000
Maintenance Health = -5 * 10,000 * 1.05 - (-5 * 10,000)= -$2,500
On other exchanges, one may see:
Initial Margin = $5,000
Maintenance Margin = $2,500
As a result, Vertexâs perpetuals weightings function similarly to leverage calculations on other platforms:
Special Cases: Spreads, LPs, and Large Positions
Spreads
Spreads can be thought of as positions with offsetting positions on the same underlying asset.
Spreads can increase your health. Here's how spread-related calculations are defined:
Spread Basis Amount: Define the spread basis amount as the size of the spread:
Example: With +2 wBTC and -3 BTC-PERP, your basis amount is +2, and your basis size is 2.
Spread Value:
Existing Penalty: The existing weight penalty resulting from holding the individual spot / perp positions is:
Spread Penalty: The spread penalty applied to a spread "position" is:
Spread Weight: This is the long perp weight for positive basis amounts and the long spot weight for negative basis amounts.
Spread Health Increase: The increase in health due to spreads is calculated as:
LPs
Automated market makers (LPs) follow an XY=K market-making formula. Orders match against liquidity in the LP and orderbook â takers get whichever is the best available price.
LP Health is decomposed assuming the LP is at equilibrium at the oracle price. The calculation is structured as follows:
Base Health:
Quote Health:
LP Penalty:
LP components are not included in spread balances. For example, if a user owns BTC LP and is short BTC-PERP, there wouldnât be any spread balance benefit. However, the risk can be thought of similarly, and the risk during liquidation would be treated relatively closely (see below).
Last updated