Account (WebSocket)
Balances & Positions
Apply margin, position, and transfer-lock updates to account state.
WSS
Use
marginUpdate, positionUpdate, and lockedAmountsUpdate to maintain
balances and positions after an account snapshot.
These arrive on the public account subscription,
without a signature. There is no network-side event filter; other account
messages may also arrive.
When it arrives
Updates report changes to account margin, positions, or transfer and withdrawal locks. Delivery is asynchronous relative to a tradingpost result; neither
arrival order acts as a barrier for the other stream.
Handling
Apply reported values to the relevant state rather than adding them as numeric increments.marginUpdate places account-local fields directly in data;
snapshots place them inside data.margin. For parents with attached isolated
accounts, incremental parent margin updates are suppressed: obtain local and
agg* totals from snapshots or HTTP account state.
Do not depend on a margin delta after every isolated fill or add isolated
values to aggregate totals again.
Key positions by symbol and isolated-account identity. A zero-size update
closes that position row. Replace the locked-amount list when it updates;
an empty array clears all locks. Use protocol-reported margin and risk values
instead of reconstructing them from position rows.
There is no account sequence or replay cursor. On reconnect, replace state
from a fresh snapshot and reconcile missed fills through
account history.