The Balance WebSocket provides real-time updates for wallet balances, including USDC.e and all position token balances. It also streams order status updates, making it the primary channel for monitoring trading activity.
Endpoint: wss://synthesis.trade/ws/balance
Use cases
Subscribe
Subscribe by providing an array of wallet addresses. You can subscribe to multiple wallets at once (up to 500). The server automatically detects the chain based on address format (0x for Polygon, base58 for Solana).
Optionally filter to specific assets. This is useful when you only care about certain positions or just USDC.e:
Initial response
Upon subscribing, you receive the current balances for all subscribed wallets:
Real-time updates
After the initial snapshot, you receive updates whenever balances change:
Order status updates are also streamed through this channel:
Complete example
Position token IDs are numeric strings. USDC.e is always keyed as "USDC.e". When a position balance reaches zero, you’ll receive an update with balance "0".