For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/gateway/get-portfolio.md.
Get the authenticated user's portfolio
Unified portfolio across CeFi and DeFi venues: valued balances, open positions, and PnL in a single call.
total_usd is total account equity: balances_usd plus the margin committed to open positions, counted once. A Hyperliquid unified account's spot USDC balance already holds that margin, so none is added for it. Unrealized PnL is deliberately not added, because balances and margin are already marked to market. balances_usd on its own is the value of balances, which excludes collateral committed to perps except on a unified account.
A balance with no live price returns price, value and change_24h_pct as null and is excluded from every total. A CeFi holding that TrueX or the asset catalog cannot identify has no row, counts in no total and is named in incomplete.unrecognized_cefi_assets.
Funds allocated to CeFi trading count once, through the CeFi row: a DeFi row's allocated quantity is left out of its value and of DeFi's totals. Funds allocated that TrueX has not credited yet appear as the CeFi row's in_transit and count in the totals at that row's price. A release needs no such add-back, since TrueX completes its debit only once the allocation is released.
cost_basis is present only for non-quote assets acquired on platform. Quote and stable assets omit it, and so does any quantity received by deposit or bridge.
A read that fails is flagged in incomplete rather than failing the request. When DeFi, TrueX or pricing cannot be read, the venues that were read are still returned, incomplete.defi_unavailable or incomplete.cefi_unavailable is set, and every aggregate (total_usd, account_total_usd, balances_usd, cash_usd, change_24h_usd, change_24h_pct, unrealized_pnl_usd, realized_pnl_usd) is null: each depends on both venues, so a partial sum would be wrong rather than merely incomplete.
total_usd covers the main wallet only. The Strategies wallet is a separate account, reported in strategies and added into account_total_usd; it is read only when no venue filter is set. A failed Strategies read returns strategies and account_total_usd as null and sets incomplete.strategies_unavailable, and the request still succeeds.
bearerAuthAuthorizationBearer <JWT>An access token from POST /v1/auth/api-key/token. An organization token lasts one hour and has no refresh token; a personal token can be refreshed.
venue?stringRestrict the portfolio to one venue (defi, cefi). Defaults to all venues when omitted.
"defi""cefi"TM-On-Behalf-Of?stringAct as one of your organization's users. The value is the user_id returned when the user was created; the request then reads and writes that user's account. Requires an organization token and a user your organization created: 400 for a personal token, a repeated header or a non-UUID, 403 for a user outside your organization. Not accepted on organization-scoped routes.
uuidThe user's portfolio
application/json- response
The user's portfolio across the venues in scope: valued balances, open positions, and PnL.
total_usd*|Main wallet account equity (decimal string): balances_usd plus the margin committed to open positions, counted once. A Hyperliquid unified account's spot USDC balance already holds that margin, so none is added for it. Unrealized PnL is not added; balances and margin are already marked to market. The Strategies wallet is not included; see account_total_usd. Null when a venue in scope could not be read (incomplete.defi_unavailable or incomplete.cefi_unavailable).
account_total_usd*|total_usd plus strategies.value_usd (decimal string): both wallets. Null whenever either is unknown: when total_usd is null, when the Strategies read failed, when strategies.perp_data_unavailable is true, or when a venue filter is set.
balances_usd*|Value of balances (decimal string), excluding unpriced assets. Collateral committed to open perps is excluded, except on a Hyperliquid unified account, whose spot USDC balance holds it. Null when a venue in scope could not be read.
cash_usd*|Value of stablecoin and quote-asset balances at the venues in scope (decimal string). Null when a venue in scope could not be read.
change_24h_usd*|Rolling 24h change in balance value (decimal string). Null when a venue in scope could not be read.
change_24h_pct*|Rolling 24h change as a percent (decimal string). Null when a venue in scope could not be read.
unrealized_pnl_usd*|Spot unrealized PnL plus position unrealized PnL (decimal string). Spot covers on-platform acquisitions only. Null when a venue in scope could not be read.
realized_pnl_usd*|Realized PnL from on-platform spot sells (decimal string). Null when a venue in scope could not be read.
balances*array<>positions*array<>strategies*|nullThe Strategies wallet. Null when a venue filter is set or when the Strategies read failed, in which case incomplete.strategies_unavailable is true.
incomplete?What the portfolio could not read or value exactly. Omitted when everything was read. Every field is omitted when it has nothing to report.
curl -X GET 'https://api.truemarkets.co/v1/gateway/portfolio' \ -H 'TM-On-Behalf-Of: 3f6d2c0e-8a41-4c2b-9f1e-2b7d5c0a9e11'{ "total_usd": "string", "account_total_usd": "string", "balances_usd": "string", "cash_usd": "string", "change_24h_usd": "string", "change_24h_pct": "string", "unrealized_pnl_usd": "string", "realized_pnl_usd": "string", "balances": [ { "asset_id": "b4695157-0d1d-4da0-8f9e-5c53149389e4", "economic_asset_id": "7f93aecf-1e3c-4189-b692-a8b4a0ef8e5b", "symbol": "string", "name": "string", "venue": "defi", "chain": "string", "address": "string", "decimals": 0, "icon": "string", "status": "active", "stable": true, "tradeable": true, "total": "string", "available": "string", "held": "string", "allocated": "string", "in_transit": "string", "price": "string", "value": "string", "change_24h_pct": "string", "cost_basis": { "avg_entry_price": "string", "cost_usd": "string", "qty": "string", "realized_pnl": "string", "unrealized_pnl": "string" } } ], "positions": [ { "asset_id": "b4695157-0d1d-4da0-8f9e-5c53149389e4", "venue": "defi", "symbol": "string", "side": "long", "size": "string", "entry_price": "string", "mark_price": "string", "liquidation_price": "string", "margin_used": "string", "unrealized_pnl": "string", "return_on_equity": "string", "leverage": 0 } ], "strategies": { "value_usd": "string", "cash_usd": "string", "free_usd": "string", "allocated_usd": "string", "pnl_usd": "string", "pnl_24h_usd": "string", "as_of": "2019-08-24T14:15:22Z", "perp_data_unavailable": true }, "incomplete": { "unavailable_chains": [ { "chain": "string", "owner": "string" } ], "unpriced": [ "string" ], "over_allocated": [ { "asset_id": "b4695157-0d1d-4da0-8f9e-5c53149389e4", "symbol": "string" } ], "stranded": [ { "asset_id": "b4695157-0d1d-4da0-8f9e-5c53149389e4", "symbol": "string" } ], "unrecognized_cefi_assets": [ "string" ], "positions_unavailable": true, "defi_unavailable": true, "cefi_unavailable": true, "strategies_unavailable": true }}