> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raze.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Read a live Phoenix position

> Live `(wallet, market)` position straight from the trader account —
`{"position": null}` when flat. Use it to pre-check a close instead of
running a Phoenix SDK call client-side.




## OpenAPI

````yaml openapi-spec/trading.yaml post /perp/sol/phoenix-position
openapi: 3.0.3
info:
  title: Raze Trading API
  description: >
    Trading endpoints for Solana token swaps — quote, buy, sell, atomic

    round-trips and raw instructions. Perpetuals (Jupiter Perps + Phoenix) live

    here too.


    Quotes can also be **streamed**: `/swap/sol/quote/stream` is a WebSocket
    that

    pushes a fresh quote whenever the pools under your route move. It is not

    describable in OpenAPI — see

    [Streaming quotes](/api-reference/router/quote-stream).


    Write utilities (`/utils/sol/*` — launch, transfer, burn, consolidate, fees)

    moved to the History API on `https://api.raze.bot` (see `history.yaml`).


    Runs on port 8082.


    **Auth methods**: `Authorization: Bearer sk_...` header, `X-API-Key: sk_...`
    header, or `?apiKey=sk_...` query param.
  version: 2.1.0
servers:
  - url: https://router.raze.bot
    description: >-
      Raze global trading router — GeoDNS routes to the nearest region
      automatically
security: []
paths:
  /perp/sol/phoenix-position:
    post:
      summary: Read a live Phoenix position
      description: |
        Live `(wallet, market)` position straight from the trader account —
        `{"position": null}` when flat. Use it to pre-check a close instead of
        running a Phoenix SDK call client-side.
      operationId: phoenixPosition
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoenixPositionRequest'
            example:
              wallet: 62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm
              market_id: phoenix:SOL-PERP
      responses:
        '200':
          description: Position read
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoenixPositionResponse'
              examples:
                open:
                  summary: Open long
                  value:
                    success: true
                    data:
                      position:
                        side: long
                        baseUnits: '12.5'
                flat:
                  summary: No position
                  value:
                    success: true
                    data:
                      position: null
        '400':
          description: Invalid wallet or market_id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Upstream read failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    PhoenixPositionRequest:
      type: object
      required:
        - wallet
        - market_id
      properties:
        wallet:
          type: string
        market_id:
          type: string
          example: phoenix:SOL-PERP
    PhoenixPositionResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
          properties:
            position:
              type: object
              nullable: true
              description: '`null` when the wallet is flat on that market.'
              properties:
                side:
                  type: string
                baseUnits:
                  type: string
        error:
          type: string
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        details:
          type: string
      required:
        - success
        - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````