> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phoenix.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Get trade history

> Handles `GET /v1/trader/{authority}/trades-history` via `get.v1.trader.by_authority.trades_history`.



## OpenAPI

````yaml /openapi/phoenix-public-api.json get /v1/trader/{authority}/trades-history
openapi: 3.1.0
info:
  title: Phoenix Eternal API
  description: >-
    RESTful API for accessing Phoenix Eternal perpetual trading data. Provides
    real-time orderbook levels, asset information, and market metadata.
  termsOfService: https://www.phoenix.trade/terms-of-service
  contact:
    name: Phoenix Development Team
    url: https://github.com/Ellipsis-Labs/phoenix
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://perp-api.phoenix.trade
    description: Phoenix Eternal Perp API
security: []
tags:
  - name: Auth
    description: Wallet and session authentication.
  - name: Exchange
    description: Exchange, market, candle, and no-referral register-instruction workflows.
  - name: Invite
    description: Invite validation, referral activation, and wallet allowlist checks.
  - name: Notifications
    description: Trader notification reads and acknowledgement helpers.
  - name: Trader
    description: Trader state, account history, and transaction builders.
externalDocs:
  url: https://docs.phoenix.trade
  description: Phoenix developer documentation
paths:
  /v1/trader/{authority}/trades-history:
    get:
      tags:
        - Trader
      summary: Get trade history
      description: >-
        Handles `GET /v1/trader/{authority}/trades-history` via
        `get.v1.trader.by_authority.trades_history`.
      operationId: get.v1.trader.by_authority.trades_history
      parameters:
        - name: authority
          in: path
          description: Authority pubkey
          required: true
          schema:
            type: string
        - name: pdaIndex
          in: query
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: marketSymbol
          in: query
          required: false
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: cursor
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Trade history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_Vec_TradeHistoryV2Item'
      security:
        - PhoenixBearerAuth: []
components:
  schemas:
    PaginatedResponse_Vec_TradeHistoryV2Item:
      type: object
      description: >-
        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.
      required:
        - data
        - hasMore
      properties:
        data:
          type: array
          items:
            type: object
            description: A single flattened trade history item with PnL and position data
            required:
              - userId
              - traderId
              - traderPdaIndex
              - subaccountIndex
              - marketSymbol
              - timestamp
              - slot
              - slotIndex
              - eventIndex
              - instructionIndex
              - instructionType
              - baseLotsBefore
              - baseLotsAfter
              - baseLotsDelta
              - virtualQuoteLotsBefore
              - virtualQuoteLotsAfter
              - virtualQuoteLotsDelta
              - price
              - realizedPnl
              - fees
              - liquidity
              - tradeType
            properties:
              baseLotsAfter:
                type: string
                description: Base lots after the trade (human readable)
              baseLotsBefore:
                type: string
                description: Base lots before the trade (human readable)
              baseLotsDelta:
                type: string
                description: Base lots delta (human readable, signed)
              eventIndex:
                type: integer
                format: int32
              fees:
                type: string
              fillId:
                type:
                  - string
                  - 'null'
                description: Deterministic UUID v3 derived from the raw fill coordinates.
              instructionIndex:
                type: integer
                format: int32
              instructionType:
                type: string
                description: Instruction type (e.g., "PlaceLimitOrder", "PlaceMarketOrder")
              liquidity:
                $ref: '#/components/schemas/LiquidityRole'
              marketSymbol:
                type: string
                description: Market symbol
              orderSequenceNumber:
                type:
                  - integer
                  - 'null'
                format: int64
              price:
                type: string
              realizedPnl:
                type: string
                description: Realized PnL from this trade (human readable USD)
              signature:
                type:
                  - string
                  - 'null'
                description: Transaction signature
              slot:
                type: integer
                format: int64
                description: Slot coordinates for cursor
              slotIndex:
                type: integer
                format: int32
              splineSequenceNumber:
                type:
                  - integer
                  - 'null'
                format: int64
              subaccountIndex:
                type: integer
                format: int32
                description: Subaccount index
              timestamp:
                type: string
                format: date-time
                description: Formatted datetime string (ISO 8601).
              tradeType:
                $ref: '#/components/schemas/TradeType'
              traderId:
                type: integer
                format: int64
                description: Trader ID
              traderPdaIndex:
                type: integer
                format: int32
                description: Trader PDA index
              userId:
                type: integer
                format: int64
                description: User ID
              virtualQuoteLotsAfter:
                type: string
                description: Virtual quote lots after (human readable)
              virtualQuoteLotsBefore:
                type: string
                description: Virtual quote lots before (human readable)
              virtualQuoteLotsDelta:
                type: string
                description: Virtual quote lots delta (human readable, signed)
        hasMore:
          type: boolean
          description: Whether there are more results available after this page
        nextCursor:
          type:
            - string
            - 'null'
          description: >-
            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:
          type:
            - string
            - 'null'
          description: >-
            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.
    LiquidityRole:
      type: string
      description: Liquidity role for the tracked account's fill.
      enum:
        - maker
        - taker
    TradeType:
      type: string
      enum:
        - limit
        - market
        - liquidation
        - adl
  securitySchemes:
    PhoenixBearerAuth:
      type: http
      scheme: bearer
      description: Bearer access token issued by `/v1/auth/*` login endpoints.

````