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
universearray returned byPOST /infowith{"type": "meta"}.- For example, if
universe[0].name === "BTC", then BTC's asset ID is0.
- For example, if
- Spot markets:
10000 + index, whereindexis the 0-based index inuniversereturned 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
szDecimalsfrommeta. - 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 - szDecimalsfor 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):
0x1234567890abcdef1234567890abcdefYou 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).