Skip to main content

Portfolio API

The Portfolio API provides access to user positions and trading activity history.

Endpoints

Positions

MethodEndpointDescription
GET/v1/portfolio/positionsGet user’s trading positions

Activities

MethodEndpointDescription
GET/v1/portfolio/activitiesGet trading activity history

Positions Response

The positions response returns a map of market slug to position, not an array:
{
  "positions": {
    "will-x-happen": {
      "netPosition": "100",
      "qtyBought": "100",
      "qtySold": "0",
      ...
    },
    "another-market": {
      "netPosition": "-50",
      ...
    }
  },
  "nextCursor": "abc123",
  "eof": false
}

Position Fields

FieldTypeDescription
netPositionstring (int64)Net position quantity (positive = long, negative = short)
qtyBoughtstring (int64)Total quantity bought
qtySoldstring (int64)Total quantity sold
costAmountTotal cost basis
realizedAmountRealized profit/loss
cashValueAmountCurrent unrealized value
qtyAvailablestring (int64)Quantity available to trade
bodPositionstring (int64)Beginning of day position
expiredbooleanWhether the position has expired
updateTimestring (date-time)Last update timestamp
marketMetadataobjectMarket information (slug, title, outcome)

Activities Response

Activities are returned as an array with pagination:
{
  "activities": [
    {
      "type": "ACTIVITY_TYPE_TRADE",
      "trade": { ... }
    }
  ],
  "nextCursor": "xyz789",
  "eof": false
}

Activity Structure

Each activity has a type field and a corresponding nested object:
TypeNested FieldDescription
ACTIVITY_TYPE_TRADEtradeTrade execution details
ACTIVITY_TYPE_POSITION_RESOLUTIONpositionResolutionMarket settlement details
ACTIVITY_TYPE_ACCOUNT_DEPOSITaccountBalanceChangeDeposit details
ACTIVITY_TYPE_ACCOUNT_WITHDRAWALaccountBalanceChangeWithdrawal details
ACTIVITY_TYPE_TRANSFERaccountBalanceChangeTransfer details

Trade Object

FieldTypeDescription
idstringExchange-assigned trade ID
marketSlugstringMarket slug
statestringTrade state (CLEARED, BUSTED, etc.)
priceAmountTrade price
qtystringTrade quantity
isAggressorbooleanTrue if user’s order was the taker
costBasisAmountCost basis for the trade
realizedPnlAmountRealized profit/loss
createTimestring (date-time)Creation timestamp
updateTimestring (date-time)Last update timestamp

Position Resolution Object

FieldTypeDescription
marketSlugstringMarket slug
beforePositionUserPositionPosition before resolution
afterPositionUserPositionPosition after resolution
sidestringResolution side (LONG, SHORT, NEUTRAL)
tradeIdstringAssociated trade ID
updateTimestring (date-time)Resolution timestamp

Account Balance Change Object

FieldTypeDescription
transactionIdstringTransaction ID
statusstringStatus (PENDING, COMPLETED, REJECTED)
amountAmountAmount of the balance change
createTimestring (date-time)Creation timestamp
updateTimestring (date-time)Last update timestamp

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:
GET /v1/portfolio/activities?types=ACTIVITY_TYPE_TRADE&marketSlug=will-x-happen

Sort Order

Activities can be sorted ascending or descending by time:
Sort OrderDescription
SORT_ORDER_DESCENDINGNewest first (default)
SORT_ORDER_ASCENDINGOldest first