Portfolio API
The Portfolio API provides access to user positions, account balances, and trading activity history.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 atype field and a corresponding nested object:
Trade Object
Trade States
Thestate field on a trade progresses through the following values:
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. Usecursor parameter with the nextCursor value to fetch the next page. When eof is true, there are no more results.
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
ThebuyingPower field represents unencumbered capital available for trading: