> ## 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 trader market PnL

> Handles `GET /v1/traders/{trader_pubkey}/pnl/markets` via `get.v1.traders.by_trader_pubkey.pnl.markets`.



## OpenAPI

````yaml /openapi/phoenix-public-api.json get /v1/traders/{trader_pubkey}/pnl/markets
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/traders/{trader_pubkey}/pnl/markets:
    get:
      tags:
        - Trader
      summary: Get trader market PnL
      description: >-
        Handles `GET /v1/traders/{trader_pubkey}/pnl/markets` via
        `get.v1.traders.by_trader_pubkey.pnl.markets`.
      operationId: get.v1.traders.by_trader_pubkey.pnl.markets
      parameters:
        - name: trader_pubkey
          in: path
          description: Trader public key (base58 encoded)
          required: true
          schema:
            type: string
        - name: resolution
          in: query
          description: 'Resolution/timeframe: 1m, 5m, 15m, 1h, 4h, 1d'
          required: true
          schema:
            type: string
        - name: startTime
          in: query
          description: 'Start time in milliseconds since Unix epoch (max range: 1 year)'
          required: false
          schema:
            type: integer
            format: int64
        - name: endTime
          in: query
          description: 'End time in milliseconds since Unix epoch (max range: 1 year)'
          required: false
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          description: 'Max number of data points per market (default: 1000, max: 1000)'
          required: false
          schema:
            type: integer
            format: int64
        - name: symbols
          in: query
          description: Comma separated list of market symbols to filter (defaults to all)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TraderMarketPnLSeries'
      security:
        - PhoenixBearerAuth: []
components:
  schemas:
    TraderMarketPnLSeries:
      type: object
      description: Per-market PnL time-series for a trader
      required:
        - marketId
        - symbol
        - tickSize
        - baseDecimals
        - points
      properties:
        baseDecimals:
          type: integer
          format: int32
          description: Base decimals used for this market
        marketId:
          type: integer
          format: int64
          description: Market identifier
        points:
          type: array
          items:
            $ref: '#/components/schemas/TraderMarketPnLPoint'
          description: Time-series points
        symbol:
          type: string
          description: Market symbol (e.g. BTC, SOL, ETH)
        tickSize:
          type: integer
          format: int32
          description: Tick size in quote lots per base lot per tick
    TraderMarketPnLPoint:
      type: object
      description: Per-market PnL point including position context
      required:
        - timestamp
        - startTime
        - endTime
        - realizedPnl
        - cumulativePnl
        - cumulativeFundingPayment
        - totalTakerFee
        - cumulativeTakerFee
        - unrealizedPnl
        - baseLots
        - virtualQuoteLots
        - markPrice
      properties:
        baseLots:
          type: integer
          format: int64
          description: Base lots position at the end of the bucket
        cumulativeFundingPayment:
          type: number
          format: double
          description: Cumulative funding payments up to this point
        cumulativePnl:
          type: number
          format: double
          description: Cumulative PnL up to this point
        cumulativeTakerFee:
          type: number
          format: double
          description: Cumulative taker fees paid up to this point
        endTime:
          type: integer
          format: int64
          description: End time in seconds since Unix epoch
        markPrice:
          type: integer
          format: int64
          description: Mark price in ticks at the end of the bucket
        realizedPnl:
          type: number
          format: double
          description: Realized PnL accrued inside the bucket
        startTime:
          type: integer
          format: int64
          description: Start time in seconds since Unix epoch
        timestamp:
          type: integer
          format: int64
          description: 'Deprecated: Unix timestamp in seconds.'
        totalTakerFee:
          type: number
          format: double
          description: Taker fees paid inside the bucket
        unrealizedPnl:
          type: number
          format: double
          description: Unrealized PnL at the end of the bucket
        virtualQuoteLots:
          type: integer
          format: int64
          description: Virtual quote lots position at the end of the bucket
  securitySchemes:
    PhoenixBearerAuth:
      type: http
      scheme: bearer
      description: Bearer access token issued by `/v1/auth/*` login endpoints.

````