Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tripolskypetr/wallet-manager/llms.txt
Use this file to discover all available pages before exploring further.
fetchBalance returns the total coin holding for a given symbol — both the freely available portion and any quantity currently locked in open orders — together with its current USDT equivalent. The function is useful for inspecting position size and valuation before making trading decisions, but note that the quantity includes locked funds: it is not the same as the free tradeable amount.
Signature
Parameters
Binance trading pair symbol, e.g.
"SOLUSDT". WalletPublicService internally extracts the coin name ("SOL") by stripping "USDT" from the end via getCoinName(symbol). The symbol must belong to the supported coin list.Return value
Promise<{ usdt: number; quantity: number }>
Total coin quantity held in the account. This is the sum of
available (free, tradeable) and onOrder (locked in open orders) from binance.balance(). It is not the free amount — if you have an open SELL order, the locked quantity is included here.Current USDT value of the total quantity, computed as
quantity × price where price is sourced from binance.prices() (a bulk price snapshot).Supported coin list
FETCH_BALANCE_FN queries a fixed hardcoded symbol list. If symbol does not map to one of these coins, WalletPublicService throws an error (fetchBalance failed coinName=<name>):
FETCH_BALANCE_FN returns a Record<string, { usdt: number; quantity: number }> keyed by coin name (e.g. "SOL", "BTC"). WalletPublicService.fetchBalance looks up the coin for the requested symbol and returns only that entry.
How quantity is computed
available field is the freely tradeable amount. The onOrder field is the portion locked by pending orders. Together they represent the total position size.
Usage example
quantity includes coins locked in open orders (onOrder). If you need the free tradeable amount for order sizing, use fetchFiat for USDT or check binance.balance() directly via walletPrivateService for the available field. The commitBuy guard uses binance.account() (not fetchBalance) to read the free USDT, which avoids this ambiguity.