userAccount channel pushes the complete account view for one account within one market deployer — collateral, positions, and margin — on a timer. The payload is identical to the REST userAccount response. A first frame arrives immediately on subscribe, then a fresh frame every 3 seconds.
Use it to keep equity, available margin, position size, and unrealized PnL current without polling.
Subscribing
string
required
The account’s wallet address, not the numeric account ID. The server resolves it to an account; an unregistered address receives no frames.
integer
required
The market deployer to report on. The account view differs per deployer, so subscribe once per deployer you care about. This carries the same meaning as
marketDeployerId in the REST query.subscription object and "method": "unsubscribe".
Push message format
data carries the full REST response body.
Field reference
string
Always
"UserAccount" for this channel.string
The channel this frame belongs to, keyed by the subscribed address.
object
The account view. Every margin, collateral, position, and account-level field is defined exactly as in the REST
userAccount response — see that page for the complete field reference.int64
Frame send time in Unix milliseconds, from the server clock.
Maintaining local state
1
Subscribe and take the first frame
The first frame arrives immediately and is a complete snapshot. Use it as your starting state.
2
Replace state on every frame
Each frame is a full snapshot, not a delta. Overwrite your local account state wholesale — there are no patches to apply.
3
Convert raw values for display
Prices and quantities are raw integers. Convert with the contract’s
priceScale and qtyScale from configs.positions[].unrealizedPnl is computed against the mark price and is recalculated on every frame, so it moves even when your position does not.