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

# List user positions

> Handles `GET /v1/users/{user_pubkey}/positions` via `get.v1.users.by_user_pubkey.positions`.



## OpenAPI

````yaml /openapi/phoenix-public-api.json get /v1/users/{user_pubkey}/positions
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/users/{user_pubkey}/positions:
    get:
      tags:
        - Trader
      summary: List user positions
      description: >-
        Handles `GET /v1/users/{user_pubkey}/positions` via
        `get.v1.users.by_user_pubkey.positions`.
      operationId: get.v1.users.by_user_pubkey.positions
      parameters:
        - name: user_pubkey
          in: path
          description: User pubkey (base58 encoded)
          required: true
          schema:
            type: string
        - name: traderPdaIndex
          in: query
          description: >-
            PDA index of the user's trader; its cross account and every
            subaccount

            are included.
          required: true
          schema:
            type: integer
            format: int32
        - name: marketSymbol
          in: query
          description: Optional market symbol to filter by (e.g., "SOL")
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: Optional lifecycle status to filter by
          required: false
          schema:
            $ref: '#/components/schemas/PositionStatus'
        - name: limit
          in: query
          description: Number of positions to return (max 50)
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: cursor
          in: query
          description: '`nextCursor` of a previous page'
          required: false
          schema:
            type: string
        - name: at
          in: query
          description: |-
            `{slot}-{slotIndex}-{eventIndex}` of one of the trader's trades, as
            `trades_v2` returns it: the page starts at the position the trade
            belongs to. A trade that reverses a position belongs to the one it
            closes. Requires `atSubaccountIndex` and `atMarketSymbol`, and
            excludes `cursor`.
          required: false
          schema:
            type: string
        - name: atSubaccountIndex
          in: query
          description: Subaccount of the trade in `at`.
          required: false
          schema:
            type: integer
            format: int32
        - name: atMarketSymbol
          in: query
          description: Market symbol of the trade in `at`.
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_Vec_PositionSummary'
          description: Successful response
components:
  schemas:
    PositionStatus:
      type: string
      enum:
        - open
        - closed
    PaginatedResponse_Vec_PositionSummary:
      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: >-
              One position of one subaccount: from the trade that left the
              market flat

              (or reversed the previous position) to the trade that next made it
              flat or

              reversed it.


              Size amounts are in base units and money amounts in USD, as
              decimal

              strings. PnL terms are signed; `fees` is what the trader paid,
              negative

              for net rebates; `netPnl = realizedPnl + fundingPayment - fees`.
              For an

              open position every amount covers the trades so far and excludes

              unrealized PnL.
            required:
              - positionId
              - userPubkey
              - traderPdaIndex
              - subaccountIndex
              - marketSymbol
              - side
              - status
              - openedAt
              - openKey
              - entrySize
              - avgEntryPrice
              - exitSize
              - peakSize
              - realizedPnl
              - fundingPayment
              - fees
              - netPnl
              - complete
            properties:
              avgEntryPrice:
                type: string
              avgExitPrice:
                type:
                  - string
                  - 'null'
                description: '`None` until the position is reduced.'
              closeKey:
                oneOf:
                  - $ref: '#/components/schemas/TradeKey'
                    description: >-
                      The trade that closed the position; the position's trades
                      are those

                      from `openKey` through `closeKey` in its subaccount and
                      market.
                  - type: 'null'
              closeReason:
                oneOf:
                  - $ref: '#/components/schemas/PositionCloseReason'
                  - type: 'null'
              closedAt:
                type:
                  - string
                  - 'null'
                format: date-time
              complete:
                type: boolean
                description: >-
                  `false` when the recorded history does not account for the
                  whole

                  position; amounts then cover only the recorded part.
              entrySize:
                type: string
                description: Total size bought (long) or sold (short) into the position.
              exitSize:
                type: string
                description: Total size traded out of the position.
              fees:
                type: string
              fundingPayment:
                type: string
              marketSymbol:
                type: string
              netPnl:
                type: string
              openKey:
                $ref: '#/components/schemas/TradeKey'
                description: The trade that opened the position.
              openedAt:
                type: string
                format: date-time
              peakSize:
                type: string
                description: Largest size held at any point.
              positionId:
                type: string
                description: Stable identifier of the position.
              realizedPnl:
                type: string
              reversedFrom:
                type:
                  - string
                  - 'null'
                description: The position this one reversed out of.
              reversedInto:
                type:
                  - string
                  - 'null'
                description: The position this one reversed into.
              side:
                $ref: '#/components/schemas/PositionSide'
              status:
                $ref: '#/components/schemas/PositionStatus'
              subaccountIndex:
                type: integer
                format: int32
                description: Subaccount holding the position; 0 is the cross account.
              traderPdaIndex:
                type: integer
                format: int32
              tradesCursor:
                type:
                  - string
                  - 'null'
                description: >-
                  `cursor` for `trades_v2` whose first page starts at `closeKey`
                  and goes

                  back in time; `None` while the position is open.
              userPubkey:
                type: string
                description: >-
                  Wallet of the user whose trader holds the position (base58
                  encoded).
        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.
    TradeKey:
      type: object
      description: |-
        Coordinates of one of a trader's trades, shared with the `slot`,
        `slotIndex` and `eventIndex` of `trades_v2`.
      required:
        - slot
        - slotIndex
        - eventIndex
      properties:
        eventIndex:
          type: integer
          format: int32
        slot:
          type: integer
          format: int64
        slotIndex:
          type: integer
          format: int32
    PositionCloseReason:
      type: string
      description: How a closed position ended.
      enum:
        - closed
        - reversed
        - liquidated
        - adl
        - marketSettled
        - takeProfit
        - stopLoss
    PositionSide:
      type: string
      enum:
        - long
        - short

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.