Skip to main content
Account endpoints use API-key authentication. Balances and portfolio values are decimal strings so clients do not lose precision.

Understand balances

GET /balances requires ACCOUNT_READ. Add ?asset=USD when you need only one asset.
  • available can be used for a new order.
  • locked is reserved by open orders.
  • Cancelling an order releases its unfilled reservation.
  • Fills move value between assets and can change both fields.
Always refresh balances after order activity instead of calculating the authoritative balance only on the client.

Review balance history

GET /balances/history returns every recorded balance movement newest first. Each entry includes the resulting available, locked, and total balances plus the signed deltaAvailable, deltaLocked, and deltaTotal that produced them.
The response also returns assets, a per-asset summary, and filtered, which reports the filtered entry count and net change for the selected asset.

Chart balance history

GET /balances/history/series returns a chart-ready trajectory. Pass asset for a single asset or omit it to value the whole account at current market prices. Supported ranges are 24h, 7d, 30d, 90d, and all; the default is 30d.
When the total series includes a funded asset without a usable mark price, partial is true and the series excludes that asset from its valuation.

Track portfolio performance

GET /portfolio requires ACCOUNT_READ. It values open positions in the platform quote asset and reports cash, weighted-average cost basis, realised PnL, and unrealised PnL.
baselineEquity, pnl, and pnlPercent are retained as aliases for netContributions, totalPnl, and totalPnlPercent.

Weighted-average cost

Every fill updates the position projection, so these values are available without recalculating trades yourself.
  • A buy adds the fill’s quote amount to costBasis and increases quantity.
  • A sell removes cost proportionally: costBasis × soldQty ÷ heldQty. The difference between proceeds and removed cost is realizedPnl.
  • averageCost is costBasis ÷ qty for an open position.
  • unrealizedPnl is value − costBasis; totalPnl for the account is equity minus contributions.
Cost basis and PnL are null while the projection has no cost data for a position, such as an asset received without a recorded fill. Treat partial: true as an incomplete valuation. Do not present it as the value of the entire portfolio without a warning.

Read history

GET /portfolio/history returns stored snapshots for the equity chart. Supported ranges are 24h, 7d, 30d, 90d, and all; the default is 30d.
Each point includes cash, positionsValue, equity, realizedPnl, unrealizedPnl, netContributions, totalPnl, and partial. History is written at most once per minute per user. The worker keeps one year of snapshots, thinning older rows to hourly, daily, and weekly buckets so all stays compact. A response reads at most 2000 stored rows and downsamples to roughly 120 chart points.

Read analytics

GET /portfolio/analytics combines allocation, per-asset performance, and trading statistics.
  • allocation lists open positions by value with each asset’s share of equity; cashAllocationPercent is cash’s share.
  • performance ranks traded assets by totalPnl. Its entries include costBasis, realizedPnl, unrealizedPnl, totalPnlPercent, tradeCount, and open.
  • bestAsset and worstAsset are the first and last performance entries.
  • trading counts buys and sells, reports winRate across profitable sells, and totals realised PnL.
  • change24h compares the current total PnL with the earliest snapshot in the last 24 hours. Deposits and withdrawals are excluded, so the figure measures performance rather than a change in account size.
Percentages are fixed two-decimal strings. Numeric percentages can be null when their denominator is zero or unknown.

Inspect one asset

GET /portfolio/positions/{asset} returns one position with its PnL breakdown and trade statistics.
The response wraps the position, account-level portfolio values, and trading counts (fills, buys, sells, first and last trade times). A 404 with POSITION_NOT_FOUND means the account has no recorded balance or trades for that asset. GET /portfolio/positions/{asset}/events returns the fill ledger behind the projection, newest first. Each event includes price, qty, quoteAmount, costBasisBefore, costBasisAfter, and realizedPnl, so you can reconstruct how average cost changed over time. Use page and limit (up to 100) to paginate. Live updates for the portfolio are pushed over the authenticated WebSocket channel. See Subscribe to WebSocket streams.

Reconcile with private trades

Use GET /trades with the ORDER_READ scope to retrieve your fills newest first. Each record identifies your side, maker status, and related order.
Use order history for intent and status, private trades for executions, and balances for the current authoritative funds.