The Wallet Manager REPL is a lightweight interactive shell that gives you direct, programmatic access to a live Binance spot account. It is the fastest way to inspect balances, examine order history, place entries, and flatten positions by hand — without involving the trading engine at all. Use it when you need to reconcile a symbol manually, debug a broker adapter flow against a real account, or run one-off trades outside of any automated strategy.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.
Starting the REPL
Run the singlenpm start command from the wallet-manager directory. It builds the Rollup bundle first, loads .env via dotenv, and then launches the REPL process:
.env file is present with valid Binance credentials:
Prompt Behavior
The prompt evaluates raw JavaScript.await is fully supported at the top level — every expression is implicitly awaited. Object and array results are pretty-printed as indented JSON. Scalar results (numbers, strings) are printed as-is. Type exit to terminate the session cleanly.
Two Globals
Two objects are injected into the global scope at startup.wallet — the service container. It exposes two layers:
| Global | Purpose | When to use |
|---|---|---|
wallet.walletPublicService | Per-symbol execution queue, input validation, structured audit log after every commit* call | Default — use this one |
wallet.walletPrivateService | Raw layer with no validation, no queue, and no audit log | Debugging and introspection only |
fs — Node’s built-in fs module. Useful for saving results to disk between sessions:
Audit Log
Every tradingcommit* call (commitBuy, commitSell, commitTrade, commitCancel) routed through walletPublicService emits a structured console.log record immediately after the operation completes, regardless of whether it succeeded or failed. commitReload does not emit a log entry — it only flushes caches.
The record always contains at minimum:
action field is one of "buy", "sell", "trade", or "cancel". The status field is "success" when the call returned normally and "failed" when it threw. For commitTrade, the record includes two additional fields — takeProfitPrice and stopLossPrice — alongside the base fields above. The walletPrivateService.clear() cache flush is always called in the finally block after every trading commit, so subsequent reads reflect the post-trade state.
Per-Symbol Queue
walletPublicService serializes all operations on the same symbol through a queued() execution queue. Each symbol gets its own independent queue instance, memoized by symbol string. If you fire two concurrent commit* calls on "SOLUSDT", the second call waits for the first to finish before it executes — they are never parallelized. Calls on different symbols run concurrently.
This prevents the classic broker-adapter race condition where a sell order is placed while a pending buy still holds USDT in lock, or where two partial sells compete against the same coin balance.
Next Steps
Read Commands
Inspect live prices, balances, order history, and PnL without placing any orders.
Mutating Commands
Execute guarded buys, sells, OCO bracket trades, and full-flatten cancels.