Skip to Content
Symmio Trading-SDK — the SDK surface for builders on Arbitrum
CoreAccountLayergetVirtualAccount

getVirtualAccount

Read one Virtual Account’s (VA) detail struct: its market, parent and isolation type. The mapping is fixed when the VA is created, so the result is safe to cache indefinitely.

import { getVirtualAccount } from "@symmio/trading-core"; const detail = await getVirtualAccount(config, { account: vaAddress });

Parameters

accountAddressrequired

The VA address.

chainIdnumberoptional

Optional chain override.

Returns

VirtualAccountDetail
accountAddressAddress

The VA’s own address — the on-chain partyA of the positions it holds.

parentAccountAddress

The subaccount that created the VA.

symbolIdbigint

Market the VA trades.

isExistsboolean

true once the VA exists on-chain.

metadataHex

Opaque per-VA metadata blob, or 0x.

isolationTypeVirtualAccountIsolationType

VIRTUAL_ACCOUNT_ISOLATION_TYPE: 0 POSITION, 1 MARKET, 2 MARKET_LONG, 3 MARKET_SHORT. MARKET_LONG and MARKET_SHORT pin the side. Note that 2 means MARKET_DIRECTION on a subaccount’s SubAccountIsolationType.

Query options

import { getVirtualAccountQueryOptions } from "@symmio/trading-core"; import { useQuery } from "@tanstack/react-query"; useQuery(getVirtualAccountQueryOptions(config, { account: vaAddress }));

Raw ABI

For consumers that want to call viem directly:

import { accountLayerAbi } from "@symmio/trading-core"; await publicClient.readContract({ abi: accountLayerAbi, address: accountLayerAddress, functionName: "getVirtualAccount", args: [vaAddress], });
Last updated on