account.balance is a private account-scoped channel. Authentication: realtime ticket, sent in an auth frame before subscribing.
Payload schema: RealtimeAccountBalancePayload. Source status: live.
Authenticate the socket with a realtime ticket and wait for auth_ok before you send the
subscribe envelope below; a subscribe sent earlier is refused as unauthorized.
The socket authentication flow covers minting, rotation and expiry.
changeAtoms is a signed cash delta. Subscribe to account.margin for the absolute cashBalanceAtoms, including after a deposit into an account with no open positions. The two channels use their own sequence fields; do not compare a balance payload’s sequence with a margin payload’s journalSequence.
Subscribe envelope
Send this exact JSON shape.requestId is required and there is no action field.
The series field is not sent for this channel.
Accepted frame
The subscription is active only after a matchingrealtime-subscription-accepted/v1 frame arrives.
Data frame
The envelope isrealtime-stream/v1; its payload validates against RealtimeAccountBalancePayload.
Worked example
- Send the subscribe envelope with request id
subscribe-account-balance. - Wait for the accepted frame with the same request id; receiving any other frame does not prove this subscription.
- Process the data frame at sequence
1and validate its payload asRealtimeAccountBalancePayload.