Skip to main content
Monitor account state across Main, Trade, and Collateral balances using REST endpoints and WebSocket streams. This guide covers balance queries, deposit/withdrawal tracking, order activity monitoring, and the decision framework for choosing between REST polling and WebSocket subscriptions. Applicable to any integration that needs real-time or periodic account state awareness. Payment processing integrations (deposit/withdrawal monitoring): focus on the balance monitoring and deposit/withdrawal tracking sections — Main balance does not support WebSocket streaming, so webhooks and REST polling are the primary mechanisms. Trading integrations (bots, dashboards): focus on balance monitoring and order activity monitoring via WebSocket for real-time state.

Balance monitoring

WhiteBIT separates funds into three account types. Each has a dedicated balance endpoint: For an explanation of account types and how funds move between them, see Balances & Transfers.

Fetch Trade balance

For Go and PHP examples, see SDKs. Response fields:
  • available — funds ready for trading or withdrawal
  • freeze — funds locked in open orders or pending operations

Real-time balance via WebSocket

REST polling provides point-in-time snapshots. For instant balance change notifications, subscribe to WebSocket account streams:
Main balance does not have a WebSocket subscription channel. Monitor Main balance changes — including deposit arrivals — via webhooks for real-time notifications or REST polling of POST /api/v4/main-account/history as a fallback.

Subscribe to balance updates

The following example assumes an authenticated WebSocket session. See WebSocket Quickstart — Authenticate for private channels for the full authentication flow. Without authentication, the subscription request is rejected.

Deposit and withdrawal tracking

REST polling

Query deposit and withdrawal history using the main account history endpoint: Endpoint: POST /api/v4/main-account/history

Webhook-based monitoring

For real-time deposit and withdrawal notifications, configure webhooks. Webhook delivery includes up to 5 retries at 10-minute intervals (50-minute coverage window). Recommended reconciliation approach:
  • Primary: Webhooks — process events as they arrive for near-instant updates
  • Fallback: REST polling — periodically query the history endpoint to catch any events missed during webhook downtime or after the 50-minute retry window expires
See Webhooks for setup, signature verification, and event types. For the full deposit/withdrawal lifecycle including status state machines and fee calculation, see Payment Integration.

Order activity monitoring

Open orders

Query active orders across all markets or filter by a specific market: Endpoint: POST /api/v4/orders

Executed orders

Query trade history for filled and canceled orders: Endpoint: POST /api/v4/trade-account/order/history

Real-time order updates via WebSocket

For instant order state change notifications, subscribe to account streams: For final order state with aggregate data (fully filled or canceled), see also Orders Executed.

Polling vs WebSocket decision matrix

General guidance: Use REST for on-demand queries and historical data. Use WebSocket for any data that changes frequently and requires immediate reaction. Combine both: WebSocket for primary real-time flow, REST for startup state hydration and periodic reconciliation. When using REST polling, align the interval with the use case and the endpoint rate budget. See Rate Limits & Error Codes for per-scope request limits.

What’s Next

Payment Integration

Full deposit/withdrawal lifecycle, fee calculation, and reconciliation.

WebSocket Quickstart

Connection setup, authentication, and real-time data streaming.

Trading Bot

End-to-end automated trading with order management and error handling.