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

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



## OpenAPI

````yaml /openapi/phoenix-public-api.json get /v1/users/{user_pubkey}/positions/{position_id}/events
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/{position_id}/events:
    get:
      tags:
        - Trader
      summary: Get position events
      description: >-
        Handles `GET /v1/users/{user_pubkey}/positions/{position_id}/events` via
        `get.v1.users.by_user_pubkey.positions.by_position_id.events`.
      operationId: get.v1.users.by_user_pubkey.positions.by_position_id.events
      parameters:
        - name: user_pubkey
          in: path
          description: User pubkey (base58 encoded)
          required: true
          schema:
            type: string
        - name: position_id
          in: path
          description: Position id
          required: true
          schema:
            type: string
        - name: traderPdaIndex
          in: query
          description: PDA index of the user's trader holding the position.
          required: true
          schema:
            type: integer
            format: int32
        - name: limit
          in: query
          description: Number of events to return (max 1000)
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: cursor
          in: query
          description: '`nextCursor` of a previous page'
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_Vec_PositionEvent'
          description: Successful response
components:
  schemas:
    PaginatedResponse_Vec_PositionEvent:
      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 change to a position. Sizes are signed (negative for short) in
              base

              units and cover only the part of the trade that belongs to this
              position:

              a reversing trade appears as the `close` of one position, ending
              at zero,

              and the `open` of the next, starting from zero.
            required:
              - eventId
              - kind
              - timestamp
              - slot
              - instructionType
              - sizeBefore
              - sizeAfter
              - tradeSize
              - realizedPnl
              - fundingPayment
              - liquidated
            properties:
              eventId:
                type: string
                description: >-
                  Unique across positions: a reversing trade appears in both
                  positions

                  under different ids.
              fundingPayment:
                type: string
              instructionType:
                type: string
              kind:
                $ref: '#/components/schemas/PositionEventKind'
              liquidated:
                type: boolean
                description: The trade liquidated this trader in this market.
              price:
                type:
                  - string
                  - 'null'
                description: Average price of `tradeSize`; `None` for funding.
              realizedPnl:
                type: string
              sizeAfter:
                type: string
              sizeBefore:
                type: string
              slot:
                type: integer
                format: int64
              timestamp:
                type: string
                format: date-time
              tpsl:
                oneOf:
                  - $ref: '#/components/schemas/PositionTpslKind'
                    description: >-
                      The take-profit or stop-loss trigger whose order this
                      trade was.
                  - type: 'null'
              tradeSize:
                type: string
                description: Unsigned size traded for this position; zero for funding.
        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.
    PositionEventKind:
      type: string
      enum:
        - open
        - increase
        - reduce
        - close
        - funding
    PositionTpslKind:
      type: string
      enum:
        - takeProfit
        - stopLoss

````

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