@somnia-chain/markets-sdk / index / UnifiedBalance
Interface: UnifiedBalance
Defined in: packages/sdk/src/unified/structs.ts:320
One currency's balance, human units (ccxt shape). For spot/binary, funds
escrowed in resting orders live in the pools — not the wallet — so used
is 0 and free === total. NOTE: this "used is 0" property is a fact about
wallet-held tokens, not a law of the venue — perp collateral IS locked
(MarginBank margin against open positions), and a margin-aware
fetchBalance arm must report it through used rather than pretending
the invariant generalizes.
Properties
free
free:
number
Defined in: packages/sdk/src/unified/structs.ts:322
Spendable balance.
used
used:
number
Defined in: packages/sdk/src/unified/structs.ts:324
Locked balance (0 for wallet-held spot/binary tokens; perp margin when reported).
total
total:
number
Defined in: packages/sdk/src/unified/structs.ts:326
free + used, human units.
byChain
byChain:
Record<number,UnifiedChainBalance>
Defined in: packages/sdk/src/unified/structs.ts:334
The same figures per chain, keyed by numeric chain id. The top-level numbers are the sum across every configured chain; this is where they came from. A single-chain exchange reports one entry. The native coin is one asset across chains (post-bridge SOMI on Hideki is the same SOMI), so it aggregates under one code and breaks down here.