Vertex Docs
  • Getting Started
    • 📋Overview
    • 📜Table of Contents
    • 🚀Mission
    • ⚔️Vertex Edge
      • 1️⃣Vertex on Arbitrum
      • 2️⃣Blitz on Blast
        • Blitz Documentation
      • 3️⃣Vertex on Mantle
        • 🎆Trading Rewards
        • 📊Perpetual & Spot Market Specifications
        • 🖥️Open-Source Contracts
        • 🔌API
      • 4️⃣Vertex on Sei
        • 💰Trading Rewards
        • 📊Perpetual & Spot Market Specifications
        • 🖥️On-Chain Contracts
        • 🔌API
      • 5️⃣Vertex on Base
        • 💰Trading Rewards
        • 📊Perpetual & Spot Market Specifications
        • 💻Onchain Contracts
        • 🔌API
        • ✍️Create a Coinbase Smart Wallet
      • 6️⃣Vertex on Sonic
        • 💰Trading Rewards
        • 📊Perpetual & Spot Market Specifications
        • ⛓️On-Chain Contracts
        • 🔌API
      • 7️⃣Vertex on Abstract
        • 📊Market Specifications
        • ⛓️On-Chain Contracts
        • 🔌API
      • 8️⃣Bro.Trade on Berachain
        • ⛓️On-Chain Contracts
        • 🔌API
      • 9️⃣Vertex on Avalanche
        • 💰Trading Rewards
        • 📊Market Specifications
        • ⛓️On-Chain Contracts
        • 🔌API
  • Basics
    • 📽️Products
    • ⚡Technical Architecture
    • 🧵Universal Cross Margin
    • ✂️Isolated Margin
    • ℹ️Subaccounts & Health
    • ⏰Liquidations & Insurance Fund
    • 💵PnL Settlements
    • 📊Pricing (Oracles)
    • 💰Fees
    • 📈Funding Rates
    • 📅Market Specifications
    • ⚡One-Click Trading
    • 🔫Trigger Orders
    • 🗂️GMCI 30 & MEME Indices
    • 💰Trade & Earn
      • 🤝Maker Program
      • 🔁Cross-Chain VRTX Rewards
      • ❓Trading Rewards - FAQs
    • 🧑‍🤝‍🧑Referral Program
    • ⚒️Resources & Links
    • ❔FAQs
  • VRTX Token
    • 🎓VRTX Tokenomics
    • 📊Token Supply Distribution
  • More
    • 🌐Glossary
    • 🔬Contracts & Code Audits
    • 🦋Bug Bounties
    • 💽Data & Research
    • 🪟Maintenance Windows
    • 🏁Terms of Use
    • ✍️Statement of Risk
    • 🌍Restricted Territories
    • 📸Brand Assets
  • Tutorials
    • 🏁Quick Start
    • 🖱️One-Click Trading
    • ⚙️Trading Basics
    • ♾️Perpetuals
    • 🔮Spot
    • 🧑‍🤝‍🧑Multiple Accounts
    • 🔫TP/SL & Stop-Market
    • 💰Withdrawals
    • ⚡Fast Withdrawals
    • 🌉Cross-Chain Deposits
    • 🔄Lend, Borrow & Repay
    • ❤️Margin Health
    • 💧Pools
    • 💫VRTX Staking
    • ↔️Switching Chains
    • 🪙Trading Rewards
    • ✂️Shortcuts
  • Developer Resources
    • API
      • 🔌Endpoints
      • Gateway
        • Executes
          • Place Order
          • Place Isolated Order
          • Cancel Orders
          • Cancel Product Orders
          • Cancel And Place
          • Withdraw Collateral
          • Transfer Quote
          • Liquidate Subaccount
          • Mint LP
          • Burn LP
          • Link Signer
        • Queries
          • Status
          • Contracts
          • Nonces
          • Order
          • Orders
          • Subaccount Info
          • Isolated Positions
          • Market Liquidity
          • Symbols
          • All Products
          • Edge All Products
          • Market Prices
          • Max Order Size
          • Max Withdrawable
          • Max LP Mintable
          • Fee Rates
          • Health Groups
          • Linked Signer
          • Insurance
          • Min Deposit Rates
        • Signing
          • Examples
          • Q&A
      • Subscriptions
        • Authentication
        • Streams
        • Events
        • Rate limits
      • Archive (indexer)
        • Orders
        • Matches
        • Events
        • Summary
        • Candlesticks
        • Edge Candlesticks
        • Funding Rate
        • Interest & funding payments
        • Oracle Price
        • Perp Prices
        • Product Snapshots
        • Market Snapshots
        • Edge Market Snapshots
        • Maker Statistics
        • Merkle Proofs
        • Rewards
        • Referral Code
        • Liquidation Feed
        • Linked Signer Rate Limit
        • Subaccounts
        • Signatures
        • USDC Price
      • Trigger
        • Executes
          • Place Order
          • Cancel Orders
          • Cancel Product Orders
        • Queries
          • List Trigger Orders
      • V2
        • Assets
        • Pairs
        • APR
        • Orderbook
        • Tickers
        • Contracts
        • Trades
        • VRTX Token
      • Rate limits
      • Errors
      • Symbols
      • Depositing
      • Withdrawing (on-chain)
      • Integrate via Smart Contracts
      • Definitions / Formulas
    • Vertex Typescript SDK
      • Getting Started
      • How To
        • Create a Vertex client
        • Useful Common Functions
        • Query Markets & Products
        • Deposit Funds
        • Withdraw Funds
        • Manage Orders
      • User Guide
        • Client
          • Market
            • Place Order
            • Cancel Orders
            • Cancel Product Orders
            • Mint LP
            • Burn LP
            • Get All Markets
            • Get Latest Market Price
            • Get Market Liquidity
            • Get Open Subaccount orders
            • Get Historical Orders
            • Get Max Order Size
            • Get Max Mint LP
            • Get Candlesticks
            • Get Funding Rate
            • Get Product Snapshots
          • Spot
            • Approve Allowance
            • Deposit
            • Withdraw
            • Get Max Withdrawable
            • Get Token Contract for Product
            • Get Token Wallet Balance
            • Get Token Allowance
          • Perp
            • Get prices
          • Subaccount
            • Link Signer
            • Get Subaccount Linked Signer with Rate limits
            • Get Subaccount Summary
            • Get Subaccount Fee Rates
            • Get Subaccount Token Rewards
        • Engine Client
          • Executes
          • Queries
        • Indexer Client
          • Base Queries
          • Paginated Queries
        • Websocket
          • Executes
          • Queries
          • Subscriptions
        • Utilities
          • Contracts
          • Utils
      • API Reference
    • Vertex Python SDK
    • Vertex Rust SDK
    • Contracts
    • API/SDK Terms of Use
Powered by GitBook
On this page
  • Subaccounts – Cross Margin by Default
  • Isolated Margin
  • Health
  • Health Types
  • Assets
  • Weight Parameters
  • Spot Health
  • Perpetual Health
  • Special Cases: Spreads, LPs, and Large Positions
  • Spreads
  • LPs
Export as PDF
  1. Basics

Subaccounts & Health

Defining Vertex's subaccount design and weighted margin calculations.

PreviousIsolated MarginNextLiquidations & Insurance Fund

Last updated 3 months ago

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 .

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 .

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} Spot Health=weight×amount×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

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} Perp Health=weight×amount×current price−amount×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 Leverage=1−AssetInitial Weight​1​i.e., BTC Leverage=1−0.91​=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}) Spread Value=basis size×(spot price+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} Existing Penalty=2long spot weight+long perp weight​
  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 Penalty=1−51−spread weight​

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}) Spread Health Increase=spread value×(spread penalty−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} LP Health=base health+quote health−LP penalty

  1. Base Health:

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

  1. Quote Health:

Quote Health=amount quote\text{Quote Health} = \text{amount quote} Quote Health=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 Penalty=(1−long weight)×(amount base×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).

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
here
here
ℹ️
Page cover image