Skip to main content

Model

Total holdings = 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:
Generation 2: ?vaults=1 adds a per-vault breakdown and ?vault=0x… reads one vault. See Balances and positions.

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 in balances.
    • portfolioValue is 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 via POST /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 as available (unencumbered) and locked (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 available balance, 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:
Response:
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; null only for a never-locked token when balanceSource is projection, on resolved positions, and wherever quantity is null. Read availableQuantity directly rather than computing quantity − encumberedQuantity: it is floored at 0.

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)
GET /api/me/balance-events returns the append-only ledger for the authenticated wallet, newest first, one page at a time (limit default 100, max 500). Pass the response’s nextCursor back as ?cursor= until it is null to walk the full history. Event id and orderId are UUIDs; tradeId is a numeric string:
reason is a machine-readable tag — for example deposit, lock, terminal_refund, withdrawal_lock, withdrawal_confirmed, chain_fill_settled_buyer_drain, chain_fill_settled_seller_credit, chain_match_failed_buyer_taker_refund, position_redeemed_credit. The list grows over time; treat unknown values as opaque. Pair with the WS vault_activity channel (on-chain fills, deposits, withdrawals and exchange_balance_synced balance updates for your vault) for live updates — the REST endpoint is the canonical reconciliation source after a reconnect or any time you need to walk history.

Getting testnet balance

The faucet is not an endpoint on the partner API surface. Mint testnet USDC by calling the MockCollateral contract’s public mint(address, uint256) method directly, or use the operator-run faucet web UI: After minting, deposit normally via vault.depositERC20(...) — the faucet flow does not credit /api/me/balances until you deposit. See Environments — getting testnet USDC for the full step-by-step.