Model
available + locked. There is no separate total property on Balance; clients compute available + locked. unsettled and quarantined are reserved for future settlement modes and currently always zero.
All USDC amounts (
available, unsettled, locked, quarantined, and portfolioValue.value) are decimal strings floored to 6 dp — USDC’s native on-chain precision. They are never 18-scale wei and never carry more than 6 fraction digits, so you can parse them directly as human-readable USDC units. The same 6-dp formatting applies to the cash breakdown in GET /api/me/overview.Reading balances
Query parameters
Response:
For multi-vault accounts,
?vaults=1 adds a per-vault breakdown (vaults[]), and ?vault=0x… reads one designated vault. See Vault overview.Per-vault USDC
With?vaults=1 (and without cashOnly), vaults[].usdc and
positionsValue are computed from the same reads as portfolioValue
(RND-1869), so a client can render Available / Locked / Open positions
per vault and in total without deriving anything. While
portfolioValue.status is exact (and the value is not clamped at 0),
to the micro-USDC:
portfolioValue.value = Σ vaults[].usdc.available + Σ vaults[].usdc.locked + Σ vaults[].usdc.inTransit + positionsValue.value
For the active vault, available + locked + pendingWithdrawal equals its
balances USDC row. Every figure of one response (balances,
portfolioValue, vault, vaults) comes from one read of your vaults
(RND-2083), so a vault upgrade committing during the request is counted
either wholly before or wholly after it, never twice. While an atomic
Gen-1 → Gen-2 vault USDC move is settling (~0.5–15 seconds after the
destination vault is credited and before the source vault’s withdrawal hold
is released; RND-2082), portfolioValue returns
{ value: null, status: "unavailable" } and vaults[].usdc is omitted on
every vault rather than counting the transferred amount twice, while
positionsValue continues to report open positions as read.
Generation 1 vs Generation 2 semantics
- Generation 1 (single-vault): Each user has one smart-contract vault. All balances and positions are bound to this vault.
- Generation 2 (multi-vault): Once upgraded via
POST /api/me/vault/upgrade, the user has an active Generation 2 vault and a preserved Generation 1 vault:- New deposits, promotional bonuses, on-ramp, and trading collateral flow into the active vault.
GET /api/me/balances(without params) reports the active vault’s cash inbalances.portfolioValueis always wallet-wide: active cash + inactive vault cash + mark-to-market positions across all vaults minus pending withdrawals.- The remaining free USDC on a Generation 1 vault can be inspected via
GET /api/me/vault(usdcMove.freeUsdc) and migrated to Generation 2 viaPOST /api/me/vault/upgrade/transfer.
On-chain collateral & bonus balances
- On-chain balance vs Off-chain ledger: The user’s deposited USDC is held on-chain by the smart-contract vault (
onChainBalance). The exchange mirrors this asavailable(unencumbered) andlocked(reserved for orders or withdrawals). - Bonuses & rewards: Promotional credits and incentives are credited directly to the user’s active vault in USDC collateral. They are reflected inside
availablebalance, not separated into an unbacked or artificial token.
Aggregate portfolio dashboard: GET /api/me/portfolio
For web dashboards and mobile clients displaying account status in a single round-trip, GET /api/me/portfolio aggregates vault status, balances, positions, and responsible-gambling reality-check state:
There is no singular
/api/me/balance route; GET /api/me/balances is the plural endpoint for cash balances, and GET /api/me/portfolio is the aggregate view. The fee tier was removed from GET /api/me/portfolio to eliminate cross-service latency spikes; query GET /api/me/fee-tier separately if needed.How locked moves
SELL orders don’t move USDC
balances — they reserve the
outcome shares you are selling instead. After you place a
SELL, your available and locked USDC are unchanged; what does
change is the available-to-promise outcome-share balance for the
underlying token. When the SELL fills on-chain, USDC proceeds land
in available per the table above.Inspect outcome-share balances via GET /api/me/positions.
Each position row carries three quantity fields:quantity— mirror total (matches on-chain ERC-1155 balance). Use for “what do I own”.availableQuantity— post-encumbrance, the amount you can currently sell or burn. Use for “what can I trade”.encumberedQuantity— shares reserved by your open SELL orders and pending co-signed vault operations (such as a merge or convert) on the same(vault, tokenId)."0"when nothing is reserved;nullonly for a never-locked token whenbalanceSourceisprojection, on resolved positions, and whereverquantityisnull. ReadavailableQuantitydirectly rather than computingquantity − encumberedQuantity: it is floored at0.
Append-only ledger
Every balance change is recorded in an append-only balance-event ledger on the platform side. The conservation invariant holds for any(user, token):
SUM(deltaAvailable) + SUM(deltaLocked) === current(available) + current(locked)