Skip to main content

Portfolio API

The Portfolio API provides access to user positions, account balances, and trading activity history.
Authentication RequiredAll Portfolio API endpoints require API key authentication. See the Authentication guide for details on signing requests.

Base URL

Endpoints

Positions

Activities

Account

Positions Response

The positions response returns a map of market slug to position, not an array:

Position Fields

Use the *Decimal quantity fields for display and calculations. The older integer fields remain for backward compatibility and should not be used for partial-contract markets.

Activities Response

Activities are returned as an array with pagination:

Activity Structure

Each activity has a type field and a corresponding nested object:

Trade Object

Trade States

The state field on a trade progresses through the following values:
Handling TRADE_STATE_BUSTEDA busted trade was executed and then voided by the exchange (via an error-trade bust), and its position impact was reversed. Busted trades remain visible in trade history — treat them as reversed for position, P&L, and reconciliation purposes. Do not silently drop them.
TRADE_STATE_UNDEFINED (value 0) is the unset/unknown sentinel. It is omitted from API responses and does not appear in the published enum lists. Treat any unrecognized state value defensively rather than assuming the values above are exhaustive.

Position Resolution Object

Account Balance Change Object

Pagination

Both endpoints support cursor-based pagination. Use cursor parameter with the nextCursor value to fetch the next page. When eof is true, there are no more results.
Real-Time Position UpdatesFor real-time position changes, use the WebSocket Private Stream with the SUBSCRIPTION_TYPE_POSITION subscription instead of polling.

Filtering Activities

Filter activities by type and market:

Sort Order

Activities can be sorted ascending or descending by time:

Account Balances

The account balances endpoint returns current balance information:

Balance Fields

Buying Power

The buyingPower field represents unencumbered capital available for trading:
Real-Time Balance UpdatesFor real-time balance changes, use the WebSocket Private Stream with the SUBSCRIPTION_TYPE_ACCOUNT_BALANCE subscription instead of polling.