Page cover image

ℹ️Subaccounts & 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

Vertex offers isolated margin trading to complement its native cross-margin. Isolated margin is a more intuitive way to trade perpetuals alongside Vertex’s signature cross-margin accounts.

Isolated margin lets you assign a specific amount of margin to an individual perpetual position, isolating it from the rest of your account. As a result, Vertex supports two margin styles for perpetuals:

  • Unified Cross-Margin (Default): All positions and balances share margin, so changes in one affect the entire account.

  • Isolated Margin: Each position stands alone with its own margin, capping losses at the allocated amount.

Isolated margin integrates seamlessly into Vertex’s fluid trading experience – no disruptions, just added control. Manage both cross-margin and isolated margin positions from a single account.

Learn more about isolated margin trading here.

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:

Spot Health=weight×amount×price\text{Spot Health} = \text{weight} \times \text{amount} \times \text{price}

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:

Perp Health=weight×amount×current price−amount×entry price\text{Perp Health} = \text{weight} \times \text{amount} \times \text{current price} - \text{amount} \times \text{entry price}

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:

Leverage=11−AssetInitial Weighti.e., BTC Leverage=11−0.9=10x\text{Leverage} = \frac{1}{1 - \text{Asset}_{\text{Initial Weight}}} \\[1em] \text{i.e., BTC Leverage} = \frac{1}{1 - 0.9} = 10x

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:

  1. 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.

  1. Spread Value:

Spread Value=basis size×(spot price+perp price)\text{Spread Value} = \text{basis size} \times (\text{spot price} + \text{perp price})
  1. Existing Penalty: The existing weight penalty resulting from holding the individual spot / perp positions is:

Existing Penalty=long spot weight+long perp weight2\text{Existing Penalty} = \frac{\text{long spot weight} + \text{long perp weight}}{2}
  1. Spread Penalty: The spread penalty applied to a spread "position" is:

Spread Penalty=1−1−spread weight5\text{Spread Penalty} = 1 - \frac{1 - \text{spread weight}}{5}

Spread Weight: This is the long perp weight for positive basis amounts and the long spot weight for negative basis amounts.

  1. Spread Health Increase: The increase in health due to spreads is calculated as:

Spread Health Increase=spread value×(spread penalty−existing penalty)\text{Spread Health Increase} = \text{spread value} \times (\text{spread penalty} - \text{existing penalty})

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:

LP Health=base health+quote health−LP penalty\text{LP Health} = \text{base health} + \text{quote health} - \text{LP penalty}

  1. Base Health:

Base Health=weight×amount base×price\text{Base Health} = \text{weight} \times \text{amount base} \times \text{price}

  1. Quote Health:

Quote Health=amount quote\text{Quote Health} = \text{amount quote}
  1. LP Penalty:

LP Penalty=(1−long weight)×(amount base×price)\text{LP Penalty} = (1 - \text{long weight}) \times (\text{amount base} \times \text{price})

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