Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/backtest-kit/wallet-manager/llms.txt

Use this file to discover all available pages before exploring further.

fetchBalance returns the current coin balance for the asset associated with a trading pair symbol. The balance includes both the free (tradeable) portion and any quantity currently locked in open orders (onOrder), giving a complete picture of how much of the coin the account holds regardless of pending activity. The returned USDT value is computed at the current spot price.

Signature

fetchBalance(symbol: string): Promise<{ usdt: number; quantity: number }>

Parameters

symbol
string
required
Binance trading pair symbol, e.g. "SOLUSDT". The coin name is extracted by stripping "USDT" from the symbol string. The coin must be in the supported symbol list (see below) or the call will throw.

Returns

quantity
number
Total coin quantity held on the account: free + onOrder. This includes amounts locked in any open limit orders, OCO brackets, or stop-loss orders on the symbol.
usdt
number
The USDT value of the total coin quantity: quantity × currentPrice. The price used is fetched from binance.prices() at the time of the call.

Supported symbols

fetchBalance queries balances for a fixed hardcoded list of coins. If the coin derived from the symbol argument is not in this list, the function throws an error. The supported symbols are:
SymbolCoin
BTCUSDTBTC
POLUSDTPOL
ZECUSDTZEC
HYPEUSDTHYPE
DOGEUSDTDOGE
SOLUSDTSOL
PENGUUSDTPENGU
TRXUSDTTRX
HBARUSDTHBAR
NEARUSDTNEAR
FARTCOINUSDTFARTCOIN
ETHUSDTETH
PUMPUSDTPUMP

Example

const balance = await wallet.walletPublicService.fetchBalance("SOLUSDT");
console.log(balance);
// { quantity: 2.5, usdt: 193.90 }

if (balance.quantity === 0) {
  console.log("No SOL held on account");
}

Build docs developers (and LLMs) love