Read balance, positions and open orders
Everything readable about an account hangs off /api/v1/accounts/{id}/* — what it
is worth, what it holds, and what is still working. {id} takes the account UUID
or the bare account number (PH-000123, or the digits), and a readonly
credential is enough for every call here.
-
Read balance and equity
Section titled “Read balance and equity”GET /accounts/{id}/statereturns one row per venue the account has traded on. Amounts are USD decimal strings.Terminal window curl -s https://api.troncharts.xyz/api/v1/accounts/$ACCOUNT_ID/state \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG"# → { accountId, accountNumber,# perVenue: [ { venue, exchange, equityUsd, balanceUsd, marginUsedUsd,# marginAvailableUsd, unrealizedPnlUsd, source, … } ] }const state = await sdk.accounts.state(accountId)const equityUsd = state.perVenue.reduce((sum, v) => sum + Number(v.equityUsd), 0) -
Read open positions
Section titled “Read open positions”GET /accounts/{id}/positionsreturns{ accountId, accountNumber, positions }.unrealizedPnlUsdis computed frommarkPriceand isnullwhenever the mark is unavailable — treat it as nullable, not zero.Terminal window curl -s https://api.troncharts.xyz/api/v1/accounts/$ACCOUNT_ID/positions \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG"# → positions: [ { venue, exchange, symbol, side, qty, entryPrice, markPrice,# liquidationPrice, leverage, unrealizedPnlUsd,# openedAt, updatedAt } ]const { positions } = await sdk.accounts.positions(accountId)const open = positions.filter((p) => Number(p.qty) !== 0) -
Read orders
Section titled “Read orders”GET /accounts/{id}/ordersreads the OMS order intents, sostatusis the intent state andsidecomes backlong/short, notbuy/sell. Filters:venue,symbol,cursor,limit(1–1000, default 100). Page by passingnextCursorback until it isnull.For orders working at the venue — including any placed outside the OMS — use
GET /accounts/{id}/order-history?status=open. It is the only one of the two that reads astatusfilter;/ordersignores it silently.Terminal window curl -s "https://api.troncharts.xyz/api/v1/accounts/$ACCOUNT_ID/orders?limit=50" \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG"# → { accountId, accountNumber, nextCursor,# orders: [ { orderId, venueOrderId, venue, exchange, symbol, side,# type, status, qty, price, triggerPrice, timeInForce,# reduceOnly, kind, parentIntentId, composedAt } ] }const page = await sdk.accounts.orders(accountId, { limit: 50 }) as unknown as {orders: { orderId: string; venueOrderId: string | null; status: string }[]nextCursor: string | null}console.log(page.orders.length, page.nextCursor) -
Read closed round-trips
Section titled “Read closed round-trips”GET /accounts/{id}/tradesaggregates entry and exit into one row per round-trip, with realized P&L and the fee split.sdk.accounts.trades(accountId)is the SDK equivalent, with the caveat from step 3.Terminal window curl -s "https://api.troncharts.xyz/api/v1/accounts/$ACCOUNT_ID/trades?limit=50" \-H "authorization: Bearer $TOKEN" \-H "x-tenant-slug: $TC_TENANT_SLUG"# → { accountId, accountNumber, total, nextCursor,# trades: [ { tradeId, symbol, side, qty, avgEntryPrice, avgClosePrice,# openTime, closeTime, pnlUsd, pnlPct, durationMs,# fees: { total, maker, taker } } ] }
Next: Accounts & positions · Stream account and position updates · Create a paper account