Skip to main content

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.

Read commands never place orders. They are safe to call at any time and are the right tool for sanity-checking market state before issuing a mutating command. All examples below use wallet.walletPublicService, which runs each call through the per-symbol queue and validation layer. See the Overview for why this is the recommended surface.

fetchPrice

Returns the current average market price for a symbol as a plain number. Caching: result is cached for 30 seconds per symbol. Subsequent calls within that window return the cached value without hitting the exchange.
symbol
string
required
The Binance trading pair, e.g. "SOLUSDT", "BTCUSDT".
Return type: Promise<number> — the average price in USDT. REPL example:
repl => await wallet.walletPublicService.fetchPrice("SOLUSDT")
77.56

fetchFiat

Returns the total USDT balance — the sum of free and locked USDT — as a plain number.
symbol
string
required
The trading pair whose quote currency balance you want to check. For all standard USDT pairs this returns your overall USDT balance (free + locked across all open orders).
Return type: Promise<number> — total USDT balance (free + locked). REPL example:
repl => await wallet.walletPublicService.fetchFiat("SOLUSDT")
430.12
Use this before calling commitBuy to verify you have enough free USDT. commitBuy itself returns 0 early when free USDT is below the requested amount, but checking ahead of time helps diagnose why.

fetchBalance

Returns the coin balance for the base asset of the given symbol as { quantity, usdt }.
symbol
string
required
The Binance trading pair, e.g. "SOLUSDT". The base coin (e.g. SOL) is extracted automatically.
Return type: Promise<{ quantity: number; usdt: number }>
FieldDescription
quantityTotal coin held, including amounts locked in open orders (onOrder).
usdtThe USDT-equivalent value of that coin at the current price.
REPL example:
repl => await wallet.walletPublicService.fetchBalance("SOLUSDT")
{
  "quantity": 5.21,
  "usdt": 404.69
}
quantity reflects the total balance including any coins locked in pending SELL orders. It is not the amount available to trade right now — check open orders with fetchOrders if you need to know the unlocked portion.

fetchOrders

Returns recent orders for a symbol — filled, canceled, and still open — with full side, price, quantity, and timestamp detail. Caching: results are cached for 10 minutes per (symbol, limit) pair. The cache is automatically cleared after any commit* call on the same symbol.
symbol
string
required
The Binance trading pair.
limit
number
default:"25"
Maximum number of orders to return. Defaults to 25.
Return type: Promise<IOrderData[]>
interface IOrderData {
  symbol:      string;
  orderId:     number;
  status:      "FILLED" | "CANCELED" | "NEW";
  side:        "BUY" | "SELL";
  price:       string;   // limit price set on the order
  amount:      string;   // original order quantity
  executedQty: string;   // quantity actually filled so far
  time:        string;   // ISO timestamp of order creation
}
REPL example:
repl => await wallet.walletPublicService.fetchOrders("SOLUSDT", 5)
[
  {
    "symbol": "SOLUSDT",
    "orderId": 3849201,
    "status": "FILLED",
    "side": "BUY",
    "price": "77.64",
    "amount": "0.25",
    "executedQty": "0.25",
    "time": "2024-11-14T09:55:00.000Z"
  },
  {
    "symbol": "SOLUSDT",
    "orderId": 3849345,
    "status": "CANCELED",
    "side": "SELL",
    "price": "82.00",
    "amount": "0.25",
    "executedQty": "0.00",
    "time": "2024-11-14T10:01:15.000Z"
  }
]
Dump a larger history to a file for offline review:
repl => const orders = await wallet.walletPublicService.fetchOrders("SOLUSDT", 100)
repl => fs.writeFileSync("orders.json", JSON.stringify(orders, null, 2))

fetchPnl

Returns a daily PnL estimate for a symbol reconstructed from your trade history combined with 1-hour VWAP candle data. Caching: results are cached for 10 minutes per (symbol, limit) pair.
symbol
string
required
The Binance trading pair.
limit
number
default:"25"
Number of days to include in the estimate. Defaults to 25.
Return type: Promise<IDailyPnL[]>
interface IDailyPnL {
  date:         string; // "YYYY-MM-DD"
  pnl:          string; // estimated profit/loss in USDT for that day
  walletCost:   string; // USDT cost basis of the position on that day
  amountQty:    string; // coin quantity held that day
  amountUSDT:   string; // USDT value of holdings at day-end price
  averagePrice: string; // VWAP-derived average cost per coin
}
FieldDescription
dateCalendar day this row covers ("YYYY-MM-DD").
pnlEstimated daily profit/loss in USDT. Positive = gain, negative = loss.
walletCostThe USDT cost basis carried into that day.
amountQtyCoin quantity attributed to that day’s activity.
amountUSDTUSDT value of those coins at that day’s closing price.
averagePriceThe average price derived from 1h VWAP candles.
REPL example:
repl => await wallet.walletPublicService.fetchPnl("SOLUSDT", 7)
[
  {
    "date": "2024-11-13",
    "pnl": "1.84",
    "walletCost": "154.20",
    "amountQty": "2.00",
    "amountUSDT": "156.04",
    "averagePrice": "78.02"
  },
  {
    "date": "2024-11-14",
    "pnl": "-0.62",
    "walletCost": "156.04",
    "amountQty": "2.00",
    "amountUSDT": "155.42",
    "averagePrice": "77.71"
  }
]
To save a 90-day PnL report:
repl => const pnl = await wallet.walletPublicService.fetchPnl("SOLUSDT", 90)
repl => fs.writeFileSync("pnl-90d.json", JSON.stringify(pnl, null, 2))

Build docs developers (and LLMs) love