getUserSubAccounts
List a user’s subaccounts.
import { getUserSubAccounts } from "@symmio/trading-core";
const subs = await getUserSubAccounts(config, {
user: "0xabc...",
offset: 0n,
limit: 200n,
});Parameters
userAddressrequiredEOA whose subaccounts to list.
offsetbigintdefault 0nPagination offset.
limitbigintdefault 200nMax number of subaccounts to return.
chainIdnumberoptionalOptional chain override.
Returns
readonly SubAccountDetail[]accountAddressAddressThe subaccount’s proxy address on-chain.
ownerAddressThe EOA that created and owns the subaccount.
namestringUser-defined display name. Editable via the editAccountName write.
isExistsbooleanfalse for a subaccount that has been deleted on-chain.
singleVAModebooleantrue when the subaccount routes successive quotes for the same market into the existing active VA instead of
creating a fresh VA per sendQuote. Toggleable only while no VAs are active on the subaccount.
affiliateAddressAffiliate address attributed to the subaccount, or the zero address.
symmioCoreAddressThe SYMMIO core (diamond) address this subaccount trades against.
metadataHexFree-form contract metadata blob. May be 0x (empty) for most accounts.
isolationTypeSubAccountIsolationTypeStrategy the AccountLayer uses to create VAs for this subaccount’s trades.
Query options
import { getUserSubAccountsQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getUserSubAccountsQueryOptions(config, { user: "0xabc..." }));Raw ABI
For consumers that want to call viem directly:
import { accountLayerAbi } from "@symmio/trading-core";
await publicClient.readContract({
abi: accountLayerAbi,
address: accountLayerAddress,
functionName: "getUserSubAccounts",
args: ["0xabc...", 0n, 200n],
});