> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.immix.xyz/api-reference/trading/account-balances/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.immix.xyz/_mcp/server. # Account balances **`Request — sent`** ```json title="Request — sent" { "op": "subscribe", "reqId": "", "params": { "topics": [ "accountBalance" ] } } ``` **`Response — received`** ```json title="Response — received" { "op": "subscribe", "reqId": "", "success": true } ``` **`accountBalance · snapshot part — received`** ```json title="accountBalance · snapshot part — received" { "event": "accountBalance", "msgType": "accountBalance", "topic": "accountBalance", "seq": "", "seqTs": "", "isSnapshot": true, "snapshotId": "", "part": 0, "last": true, "data": [ { "accountId": 0, "account": "", "credentialId": 0, "assetId": 0, "asset": "", "total": "", "available": "", "held": "", "venueTsNs": "", "venueRevision": "", "observedAtNs": "" } ] } ``` **`accountBalance · delta — received`** ```json title="accountBalance · delta — received" { "event": "accountBalance", "msgType": "accountBalance", "topic": "accountBalance", "seq": "", "seqTs": "", "isSnapshot": false, "data": [ { "accountId": 0, "account": "", "credentialId": 0, "assetId": 0, "asset": "", "total": "", "available": "", "held": "", "venueTsNs": "", "venueRevision": "", "observedAtNs": "" } ] } ``` Each frame is its shape, read off the contract: `` stands for a value, and a union shows its first form. **URL** — No public environment serves this socket yet. **Topic** `accountBalance` ## Request parameters | Parameter | Type | Required | Description | | ---------- | ---------------- | -------- | ----------------------------------------------------------------------------------------------- | | `op` | string | Yes | `subscribe` | | `reqId` | string | Yes | Echoed byte-exact on the answer. Printable ASCII, escape-free; anything else answers MALFORMED. | | `params` | object | Yes | | | > `topics` | array of strings | Yes | `accountBalance` | ## Response parameters | Parameter | Type | Required | Description | | --------- | ------- | -------- | ----------------------------------------------------------------------------------------------- | | `op` | string | Yes | One of `subscribe`, `unsubscribe`. | | `reqId` | string | Yes | Echoed byte-exact on the answer. Printable ASCII, escape-free; anything else answers MALFORMED. | | `success` | boolean | Yes | `true` | ## Push data parameters Every amount is required money: a zero balance is a measurement, so "0.00000000" is a value and never a null. `available` is what the venue would let move; `held` is margin, pending withdrawals and freezes. **What the image holds.** The latest reading for every (`accountId`, `assetId`) pair this member has seen for the organization — one row per pair, not a history. Rows appear as connectors report them, so an image is what has been reported, never a list of assets the venue supports. **How a row leaves.** It does not. **A pool that empties is reported as zero**, which is a measurement and stays in your map; it never vanishes, and its absence would mean "never reported", which is a different thing. A row for an account whose own status has moved on is still served — read the account's state from the `account` channel, not from a balance's presence. | Parameter | Type | Required | Description | | ----------------- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `event` | string | Yes | `accountBalance` | | `msgType` | string | Yes | `accountBalance` | | `topic` | string | Yes | `accountBalance` | | `seq` | string | Yes | The stream position, as a decimal string — an int64 a JSON number would truncate. | | `seqTs` | string | Yes | The stream timestamp, epoch-ns as a decimal string. | | `isSnapshot` | boolean | Yes | One of `true`, `false`. | | `snapshotId` | string | No | **Present on a snapshot part only**, and the same on every part of one image; the next image of any topic carries a different one. **Opaque — compare it for equality and nothing else.** It is not a sequence, a version or a timestamp, and its shape may change; a client that ordered by it would be relying on how a member happens to mint it. Use it to keep two images apart. A repeat `subscribe` re-pushes the image — that is the resync, and there is no separate op — so a client can start image N+1 while N is still arriving, and without a name on each part it cannot tell which `last: true` closes which, nor stop a straggling part of N landing in the map N+1 just cleared. **Discard any part whose `snapshotId` is not the one you are currently applying.** | | `part` | integer | No | Present on a snapshot part only; 1-based. | | `last` | boolean | No | Present on a snapshot part only. The image is complete when true — including for an empty channel, which is still one part. | | `data` | array of objects | Yes | One pool's latest readout, keyed by (`accountId`, `assetId`) — the pair is the upsert key, neither half alone. | | > `accountId` | integer | Yes | | | > `account` | string, nullable | Yes | | | > `credentialId` | integer | Yes | | | > `assetId` | integer | Yes | | | > `asset` | string, nullable | Yes | | | > `total` | string | Yes | Required money **at the scale this reading itself states**, trailing zeros kept — not the asset's canonical scale, which can differ and is never consulted here. Two assets in one frame routinely carry different digit counts, and so can two readings of the same asset. Parse the decimal; do not predict its length. A zero balance is a MEASUREMENT, so "0.00000000" is a value and never a null. | | > `available` | string | Yes | What the venue would let move. | | > `held` | string | Yes | Margin, pending withdrawals and freezes. | | > `venueTsNs` | string, nullable | Yes | | | > `venueRevision` | string, nullable | Yes | | | > `observedAtNs` | string | Yes | | > A pool's latest readout