Skip to Content
VPerpAPI

Asset IDs & Conventions

How asset indices, prices, sizes, and client order IDs are represented across VPerp APIs.

Before placing orders, understand how VPerp identifies markets and formats numeric fields.

Asset IDs (a / asset)

Order and leverage actions identify markets by an integer asset ID rather than a ticker string.

  • Perpetual markets: The 0-based index of the market in the universe array returned by POST /info with {"type": "meta"}.
    • For example, if universe[0].name === "BTC", then BTC's asset ID is 0.
  • Spot markets: 10000 + index, where index is the 0-based index in universe returned by {"type": "spotMeta"}.

Always Resolve Dynamically

Fetch meta on startup and map coin -> index dynamically instead of hardcoding asset IDs across environments.

Prices & Sizes

  • Always send prices (p) and sizes (s) as decimal strings (never JSON floats) to avoid floating-point rounding discrepancies during EIP-712 / msgpack serialization.
  • Strip insignificant trailing zeros (send "100.5", not "100.50").
  • Size precision: Respect each market's szDecimals from meta.
  • Price precision: Prices must conform to the market's tick precision and maximum significant figures (up to 5 significant figures, with decimal places capped by 6 - szDecimals for perpetuals).

Client Order IDs (cloid)

Optional client-assigned order IDs (c in order requests) must be a 128-bit hex string prefixed with 0x (32 hex characters):

0x1234567890abcdef1234567890abcdef

You can query or cancel orders using either the exchange-assigned numeric oid or your cloid.

Addresses

All Ethereum addresses (user, destination, vaultAddress, builder) are 20-byte 0x-prefixed hex strings (42 characters).

On this page