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

# Wallet perp PnL aggregate

> Per-(venue, market_id) aggregate for the wallet. Jupiter rows are derived
from the ClickHouse position materialization; Phoenix rows (when present)
are appended. Reports gross + net PnL as separate fields — the API never
silently switches between the two.




## OpenAPI

````yaml openapi-spec/history.yaml get /api/sol/perp/wallets/{address}/perp-pnl
openapi: 3.0.3
info:
  title: Raze Database API
  description: >
    Paid subscription API for Solana transaction data and history.


    Also hosts write utilities (`/utils/sol/*`): token launch, transfer, burn,

    consolidate, fees claim/config, and agent initialize — previously on

    `router.raze.bot`. Mixer/distribute removed 2026-07-25.


    ## Batch Requests

    All endpoints with path parameters (mint, signer, address, tokenMint,
    ownerAddress) support batch queries

    via comma-separated values. For example:
    `/api/sol/trades/mint/mint1,mint2,mint3?limit=50`


    - Maximum 10 values per batch request

    - Each value must be a valid address (>= 32 characters)

    - Single values behave identically to non-batch requests

    - Batch response format: `{ "success": true, "results": { "value1": {...},
    "value2": {...} }, "count": N, "timestamp": "..." }`

    - Each key in `results` contains the full single-entity response

    - Queries run in parallel for maximum performance
  version: 1.0.0
servers:
  - url: https://api.raze.bot
    description: >-
      Raze global History API — GeoDNS routes to the nearest region
      automatically
security:
  - ApiKeyAuth: []
paths:
  /api/sol/perp/wallets/{address}/perp-pnl:
    get:
      summary: Wallet perp PnL aggregate
      description: >
        Per-(venue, market_id) aggregate for the wallet. Jupiter rows are
        derived

        from the ClickHouse position materialization; Phoenix rows (when
        present)

        are appended. Reports gross + net PnL as separate fields — the API never

        silently switches between the two.
      operationId: getPerpWalletPnl
      parameters:
        - name: address
          in: path
          required: true
          schema:
            type: string
          example: 62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerpWalletPnlResponse'
components:
  schemas:
    PerpWalletPnlResponse:
      type: object
      properties:
        address:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/PerpWalletPnlEntry'
        count:
          type: integer
        note:
          type: string
    PerpWalletPnlEntry:
      type: object
      properties:
        market_id:
          type: string
        venue:
          type: string
        long_size:
          type: integer
          format: int64
        short_size:
          type: integer
          format: int64
        volume_usd_e6:
          type: integer
          format: int64
          description: Cumulative fill volume in USD micros.
        fees_paid_e6:
          type: integer
          format: int64
        gross_pnl_e6:
          type: integer
          format: int64
          description: Gross realized PnL in USD micros (before fees).
        net_pnl_e6:
          type: integer
          format: int64
          description: Net realized PnL in USD micros (gross − fees).
        first_fill_ts:
          type: integer
          format: int64
        last_fill_ts:
          type: integer
          format: int64
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: apiKey

````