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
  • Rate limits
  • Request
  • Request Parameters
  • Supported txs for an estimated subaccount info
  • Response
Export as PDF
  1. Developer Resources
  2. API
  3. Gateway
  4. Queries

Subaccount Info

Get balances associated with a specific subaccount and all products.

PreviousOrdersNextIsolated Positions

Last updated 6 months ago

Rate limits

  • 240 requests/min or 40 requests every 10 seconds per IP address. (weight = 10)

See more details in

Request

Connect

WEBSOCKET [GATEWAY_WEBSOCKET_ENDPOINT]

Message

{
    "type": "subaccount_info",
    "subaccount": "0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000",
    "txns": "[{\"apply_delta\":{\"product_id\":4,\"subaccount\":\"0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000\",\"amount_delta\":\"10790000000000000000\",\"v_quote_delta\":\"-35380410000000000000000\"}}]"
}

GET [GATEWAY_REST_ENDPOINT]/query?type=subaccount_info&subaccount={subaccount}&txns=[{"apply_delta":{"product_id":2,"subaccount":"0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000","amount_delta":"100000000000000000","v_quote_delta":"3033500000000000000000"}}]

POST [GATEWAY_REST_ENDPOINT]/query

Message

{
    "type": "subaccount_info",
    "subaccount": "0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000",
    "txns": "[{\"apply_delta\":{\"product_id\":4,\"subaccount\":\"0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000\",\"amount_delta\":\"10790000000000000000\",\"v_quote_delta\":\"-35380410000000000000000\"}}]"
}

Request Parameters

Parameter
Type
Required
Description

subaccount

string

Yes

txns

string

no

A list of transactions to get an estimated/simulated view. see more info below.

Supported txs for an estimated subaccount info

The following are the supported txns you can provide to get an estimated view of your subaccount.

Note: these txns are only used to simulate what your subaccount would look like if they were executed.

ApplyDelta

Updates internal balances for the product_id and amount deltas provided.

{
  "apply_delta": {
    "product_id": 2,
    "subaccount": "0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000",
    "amount_delta": "100000000000000000",
    "v_quote_delta": "3033500000000000000000"
  }
}

MintLp

{
  "mint_lp": {
    "product_id": 2,
    "subaccount": "0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000",
    "amount_base": "100000000000000000",
    "quote_amount_low": "100000000000000000",
    "quote_amount_high": "100000000000000000"
  }
}

BurnLp

{
  "burn_lp": {
    "product_id": 2,
    "subaccount": "0xeae27ae6412147ed6d5692fd91709dad6dbfc34264656661756c740000000000",
    "amount_lp": "100000000000000000"
  }
}

Response

Note:

  • healths:

    • healths[0]: info about your initial health, which is weighted by long_weight_initial_x18 and short_weight_initial_x18.

    • healths[1]: info about your maintenance health, which is weighted by long_weight_maintenance_x18 and short_weight_maintenance_x18.

    • healths[2]: info about your unweighted health.

  • health_contributions is indexed by product_id and represents the contribution of the corresponding product to the final health.

    • health_contributions[product_id][0]: contribution to healths[0]

    • health_contributions[product_id][1]: contribution to healths[1]

    • health_contributions[product_id][2]: contribution to healths[2]

{
  "status": "success",
  "data": {
    "subaccount": "0x265167ddfac55365d6ff07fc5943276319aa6b9f64656661756c740000000000",
    "exists": true,
    "healths": [
      {
        "assets": "75323297691833342306",
        "liabilities": "46329556869051092241",
        "health": "28993740822782250065"
      },
      {
        "assets": "75323297691833342306",
        "liabilities": "35968911700887320741",
        "health": "39354385990946021565"
      },
      {
        "assets": "80796966663601107565",
        "liabilities": "0",
        "health": "80796966663601107565"
      }
    ],
    "health_contributions": [
      [
        "75323297691833340000",
        "75323297691833340000",
        "75323297691833340000"
      ],
      [
        "0",
        "0",
        "0"
      ],
      [
        "0",
        "0",
        "0"
      ],
      [
        "0",
        "0",
        "0"
      ],
      [
        "-46329556869051090000",
        "-35968911700887323000",
        "5473668971767765000"
      ]
    ],
    "spot_count": 3,
    "perp_count": 2,
    "spot_balances": [
      {
        "product_id": 1,
        "lp_balance": {
          "amount": "0"
        },
        "balance": {
          "amount": "0",
          "last_cumulative_multiplier_x18": "1003419811982007193"
        }
      },
      {
        "product_id": 3,
        "lp_balance": {
          "amount": "0"
        },
        "balance": {
          "amount": "0",
          "last_cumulative_multiplier_x18": "1007584195035969404"
        }
      },
      {
        "product_id": 0,
        "lp_balance": {
          "amount": "0"
        },
        "balance": {
          "amount": "75323297691833342306",
          "last_cumulative_multiplier_x18": "1000000002391497578"
        }
      }
    ],
    "perp_balances": [
      {
        "product_id": 2,
        "lp_balance": {
          "amount": "0",
          "last_cumulative_funding_x18": "-284321955122859921"
        },
        "balance": {
          "amount": "0",
          "v_quote_balance": "0",
          "last_cumulative_funding_x18": "6363466629611946777168"
        }
      },
      {
        "product_id": 4,
        "lp_balance": {
          "amount": "0",
          "last_cumulative_funding_x18": "-90979748449893411"
        },
        "balance": {
          "amount": "-200000000000000000",
          "v_quote_balance": "419899475698318625259",
          "last_cumulative_funding_x18": "141182516563970577208"
        }
      }
    ],
    "spot_products": [
      {
        "product_id": 1,
        "oracle_price_x18": "30217830336443750750000",
        "risk": {
          "long_weight_initial_x18": "750000000000000000",
          "short_weight_initial_x18": "1250000000000000000",
          "long_weight_maintenance_x18": "800000000000000000",
          "short_weight_maintenance_x18": "1200000000000000000",
          "large_position_penalty_x18": "0"
        },
        "config": {
          "token": "0x5cc7c91690b2cbaee19a513473d73403e13fb431",
          "interest_inflection_util_x18": "800000000000000000",
          "interest_floor_x18": "10000000000000000",
          "interest_small_cap_x18": "40000000000000000",
          "interest_large_cap_x18": "1000000000000000000"
        },
        "state": {
          "cumulative_deposits_multiplier_x18": "1001304691727847318",
          "cumulative_borrows_multiplier_x18": "1003419811982007193",
          "total_deposits_normalized": "213107447159798397806318",
          "total_borrows_normalized": "4907820740150097483532"
        },
        "lp_state": {
          "supply": "1304981417419495030893348",
          "quote": {
            "amount": "2048495687410669565222259",
            "last_cumulative_multiplier_x18": "1000000002391497578"
          },
          "base": {
            "amount": "67623029247538886515",
            "last_cumulative_multiplier_x18": "1001304691727847318"
          }
        },
        "book_info": {
          "size_increment": "1000000000000000",
          "price_increment_x18": "1000000000000000000",
          "min_size": "10000000000000000",
          "collected_fees": "8865582805773573662738183",
          "lp_spread_x18": "3000000000000000"
        }
      },
      {
        "product_id": 3,
        "oracle_price_x18": "2075217009708333333333",
        "risk": {
          "long_weight_initial_x18": "750000000000000000",
          "short_weight_initial_x18": "1250000000000000000",
          "long_weight_maintenance_x18": "800000000000000000",
          "short_weight_maintenance_x18": "1200000000000000000",
          "large_position_penalty_x18": "0"
        },
        "config": {
          "token": "0xcc59686e3a32fb104c8ff84dd895676265efb8a6",
          "interest_inflection_util_x18": "800000000000000000",
          "interest_floor_x18": "10000000000000000",
          "interest_small_cap_x18": "40000000000000000",
          "interest_large_cap_x18": "1000000000000000000"
        },
        "state": {
          "cumulative_deposits_multiplier_x18": "1003722507760089346",
          "cumulative_borrows_multiplier_x18": "1007584195035969404",
          "total_deposits_normalized": "232750303205807326418622",
          "total_borrows_normalized": "110730726549469855171025"
        },
        "lp_state": {
          "supply": "902924999999999999774268",
          "quote": {
            "amount": "1165328092090344104989049",
            "last_cumulative_multiplier_x18": "1000000002391497578"
          },
          "base": {
            "amount": "563265647183403990588",
            "last_cumulative_multiplier_x18": "1003722507760089346"
          }
        },
        "book_info": {
          "size_increment": "10000000000000000",
          "price_increment_x18": "100000000000000000",
          "min_size": "100000000000000000",
          "collected_fees": "1801521329724633001446457",
          "lp_spread_x18": "3000000000000000"
        }
      },
      {
        "product_id": 0,
        "oracle_price_x18": "1000000000000000000",
        "risk": {
          "long_weight_initial_x18": "1000000000000000000",
          "short_weight_initial_x18": "1000000000000000000",
          "long_weight_maintenance_x18": "1000000000000000000",
          "short_weight_maintenance_x18": "1000000000000000000",
          "large_position_penalty_x18": "0"
        },
        "config": {
          "token": "0x179522635726710dd7d2035a81d856de4aa7836c",
          "interest_inflection_util_x18": "800000000000000000",
          "interest_floor_x18": "10000000000000000",
          "interest_small_cap_x18": "40000000000000000",
          "interest_large_cap_x18": "1000000000000000000"
        },
        "state": {
          "cumulative_deposits_multiplier_x18": "1000000002391497578",
          "cumulative_borrows_multiplier_x18": "1001593395547514024",
          "total_deposits_normalized": "60000256267437588885818752247843",
          "total_borrows_normalized": "391445043137305055810336885"
        },
        "lp_state": {
          "supply": "0",
          "quote": {
            "amount": "0",
            "last_cumulative_multiplier_x18": "0"
          },
          "base": {
            "amount": "0",
            "last_cumulative_multiplier_x18": "0"
          }
        },
        "book_info": {
          "size_increment": "0",
          "price_increment_x18": "0",
          "min_size": "0",
          "collected_fees": "0",
          "lp_spread_x18": "0"
        }
      }
    ],
    "perp_products": [
      {
        "product_id": 2,
        "oracle_price_x18": "30219079716463070000000",
        "risk": {
          "long_weight_initial_x18": "875000000000000000",
          "short_weight_initial_x18": "1125000000000000000",
          "long_weight_maintenance_x18": "900000000000000000",
          "short_weight_maintenance_x18": "1100000000000000000",
          "large_position_penalty_x18": "0"
        },
        "state": {
          "cumulative_funding_long_x18": "6363466629611946777168",
          "cumulative_funding_short_x18": "6363466629611946777168",
          "available_settle": "100612314098927536086702448",
          "open_interest": "57975708279961875623240"
        },
        "lp_state": {
          "supply": "783207415944433511804197",
          "last_cumulative_funding_x18": "6363466629611946777168",
          "cumulative_funding_per_lp_x18": "-284321955122859921",
          "base": "37321000000000000000",
          "quote": "1150991638943862165224593"
        },
        "book_info": {
          "size_increment": "1000000000000000",
          "price_increment_x18": "1000000000000000000",
          "min_size": "10000000000000000",
          "collected_fees": "7738341933653651206856235",
          "lp_spread_x18": "3000000000000000"
        }
      },
      {
        "product_id": 4,
        "oracle_price_x18": "2072129033632754300000",
        "risk": {
          "long_weight_initial_x18": "875000000000000000",
          "short_weight_initial_x18": "1125000000000000000",
          "long_weight_maintenance_x18": "900000000000000000",
          "short_weight_maintenance_x18": "1100000000000000000",
          "large_position_penalty_x18": "0"
        },
        "state": {
          "cumulative_funding_long_x18": "141182516563970577208",
          "cumulative_funding_short_x18": "141182516563970577208",
          "available_settle": "33807443862986950288685582",
          "open_interest": "316343836992291503987611"
        },
        "lp_state": {
          "supply": "541756546038144467864559",
          "last_cumulative_funding_x18": "141182516563970577208",
          "cumulative_funding_per_lp_x18": "-90979748449893411",
          "base": "362320000000000000000",
          "quote": "750080187685127907834038"
        },
        "book_info": {
          "size_increment": "10000000000000000",
          "price_increment_x18": "100000000000000000",
          "min_size": "100000000000000000",
          "collected_fees": "1893278317732551619694831",
          "lp_spread_x18": "3000000000000000"
        }
      }
    ]
  },
  "request_type": "query_subaccount_info"
}

A bytes32 sent as a hex string; includes the address and the subaccount identifier. See for details.

API Rate limits
sender field structure