Skip to main content
Account balance reads show what the authenticated wallet has available, locked, and total inside Monaco. Use this page when your app needs balance tables, order-entry validation, movement history, or live balance updates.

Surface Map

Balance Model

Every Monaco balance row is scoped to an asset UUID. Use raw fields for validation and transaction amounts. Use normalized fields for display.

Read Balances

getUserBalances returns paginated balances for the authenticated wallet session. It is cursor-paginated: omit pageToken or pass "" to start, then follow nextPageToken until it comes back empty. There is no page: the SDK rejects one with a ValidationError before sending, and a raw REST request carrying it gets 400.
Use getUserBalanceByAssetId when validating a specific order, deposit, withdrawal, or transfer.

Movements

Movements are the ledger history behind balance changes. Use them for account activity, reconciliation, and user-facing transaction history.
Movement rows can include deposits, withdrawals, trades, fees, funding payments, liquidations, rewards, interest, and collateral transfers. Filter server-side with transactionType and entryType. The two surfaces do not offer identical value sets: the endpoint accepts nine transaction types — DEPOSIT, WITHDRAWAL, TRADE, FEE, FUNDING, LIQUIDATION, INTEREST, REWARD and CHAIN_SYNC — while the SDK’s TransactionType union (and its Zod schema) covers the first eight, so CHAIN_SYNC is selectable only over raw REST. entryType is CREDIT, DEBIT, LOCK, UNLOCK or FEE on both. Both the filter values and the values a row reports are upper-case — a funding row comes back with transactionType: "FUNDING" and entryType: "DEBIT" or "CREDIT" — and the server matches the filter case-insensitively. The lower-case forms ("funding", "debit") are the live movements WebSocket shape, not the REST one; normalize before comparing a REST row against a WebSocket frame. Funding movements read slightly differently from token movements. Funding payments are unioned into the feed at read time from the funding ledger, and a funding payment is a collateral USD delta rather than a token transfer. So amount is a magnitude and the direction lives in entryType — "DEBIT" when the account paid funding, "CREDIT" when it received it — while decimals is 0 and amountRaw equals amount rather than being a smallest-unit integer. Zero-amount funding windows are excluded. Each funding movement carries the same id as its live movements WebSocket frame, so a client reading both the REST history and the live stream deduplicates by id — which is what useUserMovements already does. Deduplicate on the id alone, though: the two payloads are not the same shape. The REST row keeps the upper-case enum values and resolves the asset metadata, while the live frame uses the lower-case forms and carries no resolved asset id.

Live Balance Updates

React integrations can use useUserBalances to fetch balances over REST and keep them updated with WebSocket balance events.
Balance events can be triggered by deposits, withdrawals, new orders locking funds, cancelled or expired orders unlocking funds, fills, fees, and margin transfers. Genuine spot-row events carry the same version as REST and the subscribe-time snapshot. Apply a higher version, treat an equal version as an idempotent duplicate, and ignore a lower version for that whole row. updatedAt remains display/source metadata and does not order balance state. A collateral transfer that moves the spot wallet row is a genuine spot-row event and is versioned like any other. The balances channel also carries older and margin-collateral notifications for compatibility — a parent to risk-bucket allocation, for instance, which re-earmarks collateral inside the margin account and moves no wallet balance. Those frames have no version: margin collateral is not a user_balances row, the wire identity has no margin-account ID, and a margin-routed deposit may report a delta rather than whole-row state. Do not compare those notifications with a spot snapshot watermark or treat them as authoritative aggregate (user, token) state. Handle them fail-open and refresh the corresponding margin account state. Durable margin-collateral reconciliation is not solved by the spot balance version.

Builder Checklist

  • Keep wallet balances, Monaco spot balances, parent margin collateral, and risk-bucket exposure visually separate.
  • Use availableBalanceRaw for max order, withdrawal, and transfer validation.
  • Order spot state by version, never by updatedAt or WebSocket arrival time.
  • Refresh balances after approval, deposit, withdrawal, collateral transfer, order fill, cancel, expiry, funding payment, or liquidation.
  • Treat a missing valid balance as zero, but handle 404 separately from authentication or network failures.