getVirtualAccountsAddressesOfSubAccount
List a subaccount’s Virtual Account (VA) addresses. In lowcap trading the VA, not the subaccount, is the on-chain partyA of each isolated position, so these are the accounts to pass to the position and quote reads. Prefer getVirtualAccountsOfSubAccount when you also need each VA’s market or side.
import { getVirtualAccountsAddressesOfSubAccount } from "@symmio/trading-core";
const vas = await getVirtualAccountsAddressesOfSubAccount(config, { subAccount });Parameters
subAccountAddressrequiredThe subaccount whose VA addresses to list.
offsetbigintdefault 0nPagination offset.
limitbigintdefault 200nMaximum number of entries to return; clamped on-chain to the number remaining.
chainIdnumberoptionalOptional chain override.
Returns
readonly Address[]The VA addresses in range. The list is backed by an EnumerableSet, so its order is insertion order only until a
removal occurs.
Query options
import { getVirtualAccountsAddressesOfSubAccountQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getVirtualAccountsAddressesOfSubAccountQueryOptions(config, { subAccount }));Raw ABI
For consumers that want to call viem directly:
import { accountLayerAbi } from "@symmio/trading-core";
await publicClient.readContract({
abi: accountLayerAbi,
address: accountLayerAddress,
functionName: "getVirtualAccountsAddressesOfSubAccount",
args: [subAccount, 0n, 200n],
});Last updated on