> ## 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

> Handles `GET /v1/view/trader/{pubkey}` via `get.v1.view.trader.by_pubkey`.



## OpenAPI

````yaml /openapi/phoenix-public-api.json get /v1/view/trader/{pubkey}
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/view/trader/{pubkey}:
    get:
      tags:
        - Trader
      summary: Get trader
      description: >-
        Handles `GET /v1/view/trader/{pubkey}` via
        `get.v1.view.trader.by_pubkey`.
      operationId: get.v1.view.trader.by_pubkey
      parameters:
        - name: pubkey
          in: path
          description: Base58 encoded trader account pubkey
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Phoenix Eternal trader
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraderView'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '500':
          $ref: '#/components/responses/ErrorResponse'
      security:
        - PhoenixBearerAuth: []
components:
  schemas:
    TraderView:
      type: object
      description: Trader view with all trading information
      required:
        - flags
        - state
        - capabilities
        - slot
        - slotIndex
        - traderKey
        - traderPdaIndex
        - traderSubaccountIndex
        - authority
        - collateralBalance
        - effectiveCollateral
        - effectiveCollateralForWithdrawals
        - unrealizedPnl
        - discountedUnrealizedPnl
        - unsettledFundingOwed
        - accumulatedFunding
        - portfolioValue
        - maintenanceMargin
        - cancelMargin
        - initialMargin
        - initialMarginForWithdrawals
        - riskState
        - riskTier
        - positions
        - limitOrders
        - makerFeeOverrideMultiplier
        - takerFeeOverrideMultiplier
        - maxPositions
        - lastDepositSlot
        - isInActiveTraders
        - numMarketsWithSplines
      properties:
        accumulatedFunding:
          type: string
          description: Accumulated funding amount.
        authority:
          type: string
          description: Trader authority public key.
        cancelMargin:
          type: string
          description: Margin threshold used for cancellation checks.
        capabilities:
          $ref: '#/components/schemas/TraderCapabilitiesView'
          description: Derived capability matrix.
        collateralBalance:
          type: string
          description: Collateral balance.
        discountedUnrealizedPnl:
          type: string
          description: Discounted unrealized PnL used in risk calculations.
        effectiveCollateral:
          type: string
          description: Effective collateral used for risk checks.
        effectiveCollateralForWithdrawals:
          type: string
          description: Effective collateral used for withdrawal checks.
        flags:
          $ref: '#/components/schemas/TraderCapabilityFlags'
          description: Raw trader capability flags.
        initialMargin:
          type: string
          description: Required initial margin.
        initialMarginForWithdrawals:
          type: string
          description: Initial margin used for withdrawal checks.
        isInActiveTraders:
          type: boolean
          description: Whether trader is currently in the active-trader buffer.
        lastDepositSlot:
          type: integer
          format: int64
          description: Last collateral deposit slot.
          minimum: 0
        limitOrders:
          type: object
          description: Open limit orders grouped by symbol.
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/LimitOrder'
          propertyNames:
            type: string
        maintenanceMargin:
          type: string
          description: Required maintenance margin.
        makerFeeOverrideMultiplier:
          type: number
          format: double
          description: >-
            Maker fee multiplier (1.0 = default, <1.0 = discount, >1.0 =
            premium).
        maxPositions:
          type: integer
          format: int64
          description: Maximum number of positions allowed.
          minimum: 0
        numMarketsWithSplines:
          type: integer
          format: int32
          description: Number of markets where this trader has registered splines
          minimum: 0
        portfolioValue:
          type: string
          description: Current portfolio value.
        positions:
          type: array
          items:
            $ref: '#/components/schemas/TraderPositionView'
          description: Open positions.
        riskState:
          $ref: '#/components/schemas/RiskState'
          description: Current risk state.
        riskTier:
          $ref: '#/components/schemas/RiskTier'
          description: Current risk tier.
        slot:
          type: integer
          format: int64
          description: Solana slot of the state snapshot used to build this trader view.
          minimum: 0
        slotIndex:
          type: integer
          format: int32
          description: |-
            Intra-slot sequence index of the state snapshot used to build this
            trader view.
          minimum: 0
        state:
          $ref: '#/components/schemas/TraderActivityStateView'
          description: Derived high-level trader state.
        takerFeeOverrideMultiplier:
          type: number
          format: double
          description: >-
            Taker fee multiplier (1.0 = default, <1.0 = discount, >1.0 =
            premium).
        traderKey:
          type: string
          description: Trader PDA public key.
        traderPdaIndex:
          type: integer
          format: int32
          description: Trader PDA index under the authority.
          minimum: 0
        traderSubaccountIndex:
          type: integer
          format: int32
          description: Trader subaccount index.
          minimum: 0
        unrealizedPnl:
          type: string
          description: Total unrealized PnL.
        unsettledFundingOwed:
          type: string
          description: >-
            Unsettled funding amount owed to the trader.

            - Positive value = funding you will receive when settled (increases
              collateral)
            - Negative value = funding you owe when settled (decreases
            collateral)
    TraderCapabilitiesView:
      type: object
      description: |-
        Capability matrix exposed alongside a trader's status. Each field is a
        nested object that reports whether the action is immediately available
        (`immediate`) and whether it becomes available after activating a cold
        trader (`viaColdActivation`).
      required:
        - placeLimitOrder
        - placeMarketOrder
        - riskIncreasingTrade
        - riskReducingTrade
        - depositCollateral
        - withdrawCollateral
      properties:
        depositCollateral:
          $ref: '#/components/schemas/CapabilityAccessView'
          description: Capability to deposit collateral.
        placeLimitOrder:
          $ref: '#/components/schemas/CapabilityAccessView'
          description: Capability to place limit orders.
        placeMarketOrder:
          $ref: '#/components/schemas/CapabilityAccessView'
          description: Capability to place market orders.
        riskIncreasingTrade:
          $ref: '#/components/schemas/CapabilityAccessView'
          description: Capability to execute risk-increasing trades.
        riskReducingTrade:
          $ref: '#/components/schemas/CapabilityAccessView'
          description: Capability to execute risk-reducing trades.
        withdrawCollateral:
          $ref: '#/components/schemas/CapabilityAccessView'
          description: Capability to withdraw collateral.
    TraderCapabilityFlags:
      type: integer
      format: int32
      description: >-
        Canonical capability mask stored in every trader header. The derived
        preset

        constructors (`cold`, `hot_active`, `reduce_only`, `frozen`) preserve
        the

        intended behavioural guarantees: cold traders operate from their local

        buffer until warmed, active traders have full matching-engine access,

        reduce-only traders may only take risk-reducing actions (but can still
        move

        collateral), and frozen traders are fully quarantined with balance
        transfers

        disabled.
      minimum: 0
    LimitOrder:
      type: object
      description: A trader's limit order.
      required:
        - price
        - side
        - orderSequenceNumber
        - initialTradeSize
        - tradeSizeRemaining
        - marginRequirement
        - marginFactor
        - isReduceOnly
      properties:
        initialTradeSize:
          type: string
        isConditionalOrder:
          type: boolean
        isReduceOnly:
          type: boolean
        isStopLoss:
          type: boolean
        isStopLossDirection:
          type: boolean
        marginFactor:
          type: string
          description: >-
            The margin factor applied to limit orders (0.75 = 75% margin
            required).
        marginRequirement:
          type: string
          description: The margin requirement for this specific limit order.
        orderSequenceNumber:
          type: string
        price:
          type: string
        side:
          $ref: '#/components/schemas/Side'
        tradeSizeRemaining:
          type: string
    TraderPositionView:
      type: object
      description: A trader's position view.
      required:
        - symbol
        - positionSize
        - virtualQuotePosition
        - entryPrice
        - unrealizedPnl
        - discountedUnrealizedPnl
        - positionInitialMargin
        - initialMargin
        - maintenanceMargin
        - backstopMargin
        - limitOrderMargin
        - positionValue
        - unsettledFunding
        - accumulatedFunding
        - liquidationPrice
      properties:
        accumulatedFunding:
          type: string
          description: Accumulated funding amount.
        backstopMargin:
          type: string
          description: The backstop margin threshold for transfer mechanism.
        discountedUnrealizedPnl:
          type: string
          description: Unrealized PnL after risk discounting.
        entryPrice:
          type: string
          description: Average entry price.
        initialMargin:
          type: string
          description: The total initial margin required for position + limit orders.
        limitOrderMargin:
          type: string
          description: The margin required for current limit orders.
        liquidationPrice:
          type: string
          description: Estimated liquidation price.
        maintenanceMargin:
          type: string
          description: The maintenance margin required to avoid liquidation.
        positionInitialMargin:
          type: string
          description: |-
            The initial margin required for just the position (excluding limit
            orders).
        positionSize:
          type: string
          description: Net position size in base units.
        positionValue:
          type: string
          description: Current position notional value.
        stopLossPrice:
          type:
            - string
            - 'null'
          description: Best stop-loss trigger price, if configured.
        symbol:
          type: string
          description: Market symbol (for example, "SOL-PERP").
        takeProfitPrice:
          type:
            - string
            - 'null'
          description: Best take-profit trigger price, if configured.
        unrealizedPnl:
          type: string
          description: Current unrealized PnL.
        unsettledFunding:
          type: string
          description: >-
            Unsettled funding amount.

            - Positive value = funding you will receive when settled (increases
              collateral)
            - Negative value = funding you owe when settled (decreases
            collateral)
        virtualQuotePosition:
          type: string
          description: Virtual quote position in quote units.
    RiskState:
      type: string
      enum:
        - healthy
        - unhealthy
        - underwater
        - zeroCollateralNoPositions
    RiskTier:
      type: string
      enum:
        - safe
        - atRisk
        - cancellable
        - liquidatable
        - backstopLiquidatable
        - highRisk
    TraderActivityStateView:
      type: string
      description: Serializable representation of a trader's high-level activity state.
      enum:
        - uninitialized
        - cold
        - active
        - reduceOnly
        - frozen
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    CapabilityAccessView:
      type: object
      description: >-
        Capability exposure for the current trader state. `immediate` indicates
        the

        action can be taken without additional state transitions, while

        `via_cold_activation` signals the action will succeed if the trader
        warms

        from `InitializedCold` to `InitializedHot` during processing.
      required:
        - immediate
      properties:
        immediate:
          type: boolean
          description: Whether this capability is currently available.
        viaColdActivation:
          type: boolean
          description: Whether this capability becomes available after cold activation.
    Side:
      type: string
      enum:
        - bid
        - ask
  responses:
    ErrorResponse:
      description: Standard JSON error payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    PhoenixBearerAuth:
      type: http
      scheme: bearer
      description: Bearer access token issued by `/v1/auth/*` login endpoints.

````