Understand balances
GET /balances requires ACCOUNT_READ. Add ?asset=USD when you need only one asset.
availablecan be used for a new order.lockedis reserved by open orders.- Cancelling an order releases its unfilled reservation.
- Fills move value between assets and can change both fields.
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.
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
costBasisand increases quantity. - A sell removes cost proportionally:
costBasis × soldQty ÷ heldQty. The difference between proceeds and removed cost isrealizedPnl. averageCostiscostBasis ÷ qtyfor an open position.unrealizedPnlisvalue − costBasis;totalPnlfor the account is equity minus contributions.
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.
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.
allocationlists open positions by value with each asset’s share of equity;cashAllocationPercentis cash’s share.performanceranks traded assets bytotalPnl. Its entries includecostBasis,realizedPnl,unrealizedPnl,totalPnlPercent,tradeCount, andopen.bestAssetandworstAssetare the first and last performance entries.tradingcounts buys and sells, reportswinRateacross profitable sells, and totals realised PnL.change24hcompares 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.
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.
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
UseGET /trades with the ORDER_READ scope to retrieve your fills newest first. Each record identifies your side, maker status, and related order.