Balance monitoring
WhiteBIT separates funds into three account types. Each has a dedicated balance endpoint:| Account type | Endpoint | Doc page |
|---|---|---|
| Main | POST /api/v4/main-account/balance | Main Balance |
| Trade (Spot) | POST /api/v4/trade-account/balance | Trading Balance |
| Collateral | POST /api/v4/collateral-account/balance | Collateral Balance |
Fetch Trade balance
- cURL
- Python
available— funds ready for trading or withdrawalfreeze— 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:| Channel | Subscribe method | Use case |
|---|---|---|
| Balance Spot | balanceSpot_subscribe | Spot (Trade) balance changes |
| Balance Margin | balanceMargin_subscribe | Collateral balance changes (Margin + Futures) |
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
- cURL
- Python
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
Order activity monitoring
Open orders
Query active orders across all markets or filter by a specific market: Endpoint:POST /api/v4/orders
- cURL
- Python
Executed orders
Query trade history for filled and canceled orders: Endpoint:POST /api/v4/trade-account/order/history
- cURL
- Python
Real-time order updates via WebSocket
For instant order state change notifications, subscribe to account streams:| Channel | Subscribe method | Events |
|---|---|---|
| Orders Pending | ordersPending_subscribe | Order placed, partially filled, canceled |
| Deals | deals_subscribe | Trade executions (fills) |
- Python
- wscat
Polling vs WebSocket decision matrix
| Use case | Recommended approach | Reason |
|---|---|---|
| Balance snapshot | REST | One-time check, no persistent connection needed |
| Live balance changes | WebSocket | Instant notification on every change |
| Deposit/withdrawal status | Webhook + REST fallback | Reliability — webhooks for speed, REST for reconciliation |
| Open order monitoring | WebSocket | Real-time state changes (fills, cancellations) |
| Historical trades | REST | Paginated query over a time range |
Recommended polling intervals
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.| Use case | Endpoint | Suggested interval |
|---|---|---|
| Balance dashboard | POST /api/v4/trade-account/balance | 5–30 seconds |
| Deposit detection (fallback) | POST /api/v4/main-account/history | 5 minutes |
| Order history reconciliation | POST /api/v4/trade-account/order/history | 30–60 seconds |
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.