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

> Handles `GET /v1/trader/{authority}/twap` via `get.v1.trader.by_authority.twap`.



## OpenAPI

````yaml /openapi/phoenix-public-api.json get /v1/trader/{authority}/twap
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}/twap:
    get:
      tags:
        - Trader
      summary: Get trader TWAP orders
      description: >-
        Handles `GET /v1/trader/{authority}/twap` via
        `get.v1.trader.by_authority.twap`.
      operationId: get.v1.trader.by_authority.twap
      parameters:
        - name: authority
          in: path
          description: Trader authority public key
          required: true
          schema:
            type: string
        - name: traderPdaIndex
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
        - name: traderSubaccountIndex
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
        - name: assetId
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
      responses:
        '200':
          description: Active TWAP state for trader
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TwapSnapshot'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    TwapSnapshot:
      type: object
      description: Active TWAP snapshot for a trader PDA.
      required:
        - authority
        - traderPdaIndex
        - slot
        - accounts
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/TwapAccountSnapshot'
        authority:
          type: string
        slot:
          type: integer
          format: int64
          minimum: 0
        terminalEvents:
          type: array
          items:
            $ref: '#/components/schemas/TwapTerminalEvent'
          description: >-
            Live WebSocket events only; REST and initial snapshots leave this
            empty.
        traderPdaIndex:
          type: integer
          format: int32
          minimum: 0
    TwapAccountSnapshot:
      type: object
      required:
        - twapAccount
        - traderSubaccountIndex
        - assetId
        - sequenceNumber
      properties:
        assetId:
          type: integer
          format: int32
          minimum: 0
        order:
          oneOf:
            - $ref: '#/components/schemas/TwapOrderSnapshot'
            - type: 'null'
        sequenceNumber:
          type: integer
          format: int64
          minimum: 0
        traderSubaccountIndex:
          type: integer
          format: int32
          minimum: 0
        twapAccount:
          type: string
    TwapTerminalEvent:
      type: object
      required:
        - eventId
        - twapAccount
        - orderSequenceNumber
        - errorCode
      properties:
        errorCode:
          type: string
        eventId:
          type: string
          description: >-
            Stable event identifier used to deduplicate live terminal
            notifications.
        orderSequenceNumber:
          type: integer
          format: int64
          minimum: 0
        twapAccount:
          type: string
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    TwapOrderSnapshot:
      type: object
      required:
        - traderAccount
        - traderAuthority
        - traderPdaIndex
        - traderSubaccountIndex
        - assetId
        - orderSequenceNumber
        - cooldownSlots
        - nChildOrders
        - nDustOrders
        - childOrdersExecuted
        - childOrdersRemaining
        - quoteLotsFilled
        - baseLotsFilled
        - dueSlot
        - lastExecutedSlot
        - lastValidSlot
        - latestSequenceNumber
        - transferCollateralAccountCount
      properties:
        assetId:
          type: integer
          format: int32
          minimum: 0
        baseLotsFilled:
          type: integer
          format: int64
          description: Cumulative base lots filled across executed child orders.
          minimum: 0
        cancelExisting:
          type:
            - boolean
            - 'null'
        childOrderCollateralQuoteLotsToTransfer:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        childOrderMaxPriceInTicks:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        childOrderMaxSlippageBps:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        childOrderMinPriceInTicks:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        childOrdersExecuted:
          type: integer
          format: int64
          minimum: 0
        childOrdersRemaining:
          type: integer
          format: int64
          minimum: 0
        clientOrderId:
          type:
            - string
            - 'null'
        cooldownSlots:
          type: integer
          format: int64
          minimum: 0
        dueSlot:
          type: integer
          format: int64
          minimum: 0
        dustOrderSize:
          type:
            - integer
            - 'null'
          format: int64
          description: Size of each dust execution in base lots; null when unavailable.
          minimum: 0
        lastExecutedSlot:
          type: integer
          format: int64
          minimum: 0
        lastValidSlot:
          type: integer
          format: int64
          minimum: 0
        lastValidSlotFromPacket:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        latestSequenceNumber:
          type: integer
          format: int64
          minimum: 0
        matchLimit:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        minBaseLotsToFill:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        minQuoteLotsToFill:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        nChildOrders:
          type: integer
          format: int64
          description: Total executions, including additional dust executions.
          minimum: 0
        nDustOrders:
          type: integer
          format: int64
          description: >-
            Additional dust executions. Zero also covers legacy final-child
            dust.
          minimum: 0
        numBaseLots:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        numQuoteLots:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        orderFlags:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        orderSequenceNumber:
          type: integer
          format: int64
          minimum: 0
        priceInTicks:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 0
        quoteLotsFilled:
          type: integer
          format: int64
          description: Cumulative quote lots filled across executed child orders.
          minimum: 0
        selfTradeBehavior:
          type:
            - string
            - 'null'
        side:
          type:
            - string
            - 'null'
        traderAccount:
          type: string
        traderAuthority:
          type: string
        traderPdaIndex:
          type: integer
          format: int32
          minimum: 0
        traderSubaccountIndex:
          type: integer
          format: int32
          minimum: 0
        transferCollateralAccountCount:
          type: integer
          format: int32
          minimum: 0
  responses:
    ErrorResponse:
      description: Standard JSON error payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````

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