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.
fetchOrders returns a unified view of recent order activity for a symbol, combining historical trade data (filled and cancelled orders) with the current open order book. Each result is enriched with the full order status from binance.orderStatus(), giving accurate status, executedQty, and origQty fields even for partially-filled entries. The result list always places pending orders first so the current state of the book is immediately visible at the top.
Signature
Parameters
Binance trading pair symbol, e.g.
"SOLUSDT".Maximum number of historical (filled/cancelled) orders to return. Defaults to
25. Open orders are always prepended regardless of this limit.Returns
An array of order records. Pending (
NEW) orders appear first, sorted by time descending. Historical orders follow, also sorted by time descending. Each record conforms to the IOrderData interface:Result ordering
- Pending orders (
NEWstatus) frombinance.openOrders(symbol)— sorted by time descending, prepended to the array. - Historical orders from
binance.trades()— deduplicated byorderId, enriched withbinance.orderStatus(), sorted by time descending.
Caching
Results are cached for 10 minutes (ORDERS_TTL = 10 * 60 * 1_000) keyed by symbol-limit inside WalletPrivateService. The cache is automatically busted after every commit* call via walletPrivateService.clear(). To manually invalidate the cache without placing an order, call commitReload(symbol).
Implementation detail
FETCH_ORDERS_FN uses binance.trades() to fetch recent trade history, iterating in paginated batches via iterateDocuments and deduplicating entries by orderId using a Set. Each unique order ID is then resolved to its full status via binance.orderStatus() using a concurrency-controlled execution pool (execpool). The current open orders are fetched separately via binance.openOrders(symbol) and prepended to the result.