Skip to main content
GET
/
v1
/
users
/
{user_pubkey}
/
trades_v2
Get user trade history v2
curl --request GET \
  --url https://perp-api.phoenix.trade/v1/users/{user_pubkey}/trades_v2 \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "baseLotsAfter": "<string>",
      "baseLotsBefore": "<string>",
      "baseLotsDelta": "<string>",
      "eventIndex": 123,
      "fees": "<string>",
      "instructionIndex": 123,
      "instructionType": "<string>",
      "marketSymbol": "<string>",
      "price": "<string>",
      "realizedPnl": "<string>",
      "slot": 123,
      "slotIndex": 123,
      "subaccountIndex": 123,
      "timestamp": "2023-11-07T05:31:56Z",
      "traderId": 123,
      "traderPdaIndex": 123,
      "userId": 123,
      "virtualQuoteLotsAfter": "<string>",
      "virtualQuoteLotsBefore": "<string>",
      "virtualQuoteLotsDelta": "<string>",
      "fillId": "<string>",
      "orderSequenceNumber": 123,
      "signature": "<string>",
      "splineSequenceNumber": 123
    }
  ],
  "hasMore": true,
  "nextCursor": "<string>",
  "prevCursor": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer access token issued by /v1/auth/* login endpoints.

Path Parameters

user_pubkey
string
required

Query Parameters

market_symbol
string

Optional market symbol to filter by (e.g., "SOL-PERP")

trader_pda_index
integer<int32>

Optional trader PDA index to scope results for a specific trader PDA

limit
integer<int64>

Number of items to return (max 1000)

cursor
string

Optional cursor for pagination (format: "slot" or "slot,slot_index") Items returned will be older than (exclusive of) this cursor

privy_id
string

Privy user ID (optional)

Response

200 - application/json

Generic paginated response wrapper with bidirectional cursor support.

The cursor system supports both forward (newer) and backward (older) pagination:

  • prev_cursor: Use this cursor to poll for new items (items newer than the current result set)
  • next_cursor: Use this cursor to load more items (items older than the current result set)

The direction is embedded in the cursor itself, so clients just need to pass the appropriate cursor to the cursor parameter.

data
object[]
required
hasMore
boolean
required

Whether there are more results available after this page

nextCursor
string | null

Opaque cursor for fetching the next page of older results. Pass this value as the cursor parameter in the next request to load more.

prevCursor
string | null

Opaque cursor for fetching newer items (for polling). Pass this value as the cursor parameter to get items newer than the first item in data.