getAccountBalanceOf
Read the account’s available balance — deposited collateral idle on the account. For the instant (lowcap) flow this is the trading balance: deposits credit it, instant opens spend it, and withdrawals draw from it. Read via balanceOf(account) on the SYMMIO diamond. See Balance Model.
Pair with getAccountBalanceInfo for the full picture: balanceOf is the free-to-move pot; balanceInfoOfPartyA is the classic pool (allocated and locked) — which instant opens do not spend.
import { getAccountBalanceOf } from "@symmio/trading-core";
const balance = await getAccountBalanceOf(config, {
account: "0xaccount...",
});Parameters
accountAddressrequiredAccount address passed to balanceOf.
chainIdnumberoptionalOptional chain override.
Returns
bigintThe protocol’s 18-decimal internal units (not the collateral token’s decimals). Use formatUnits(value, 18) /
formatEther(value) or the utils package when displaying decimal values.
Query options
import { getAccountBalanceOfQueryOptions } from "@symmio/trading-core";
import { useQuery } from "@tanstack/react-query";
useQuery(getAccountBalanceOfQueryOptions(config, { account: "0xaccount..." }));Raw ABI
For consumers that want to call viem directly:
import { symmioAbi } from "@symmio/trading-core";
await publicClient.readContract({
abi: symmioAbi,
address: symmioAddress,
functionName: "balanceOf",
args: ["0xaccount..."],
});