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

# Aggregate PnL statistics

> Returns aggregate statistics for profitable wallets: total count, total/average/median PnL,
90th and 99th percentile thresholds, and maximum PnL. All values in both SOL and USD.
Optionally filter by DEX platform.




## OpenAPI

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


    ## 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/platform/pnl-summary:
    get:
      summary: Aggregate PnL statistics
      description: >
        Returns aggregate statistics for profitable wallets: total count,
        total/average/median PnL,

        90th and 99th percentile thresholds, and maximum PnL. All values in both
        SOL and USD.

        Optionally filter by DEX platform.
      operationId: getPnlSummary
      parameters:
        - name: period
          in: query
          schema:
            type: string
            enum:
              - daily
              - weekly
              - monthly
            default: daily
          description: Time period to aggregate over
        - name: platform
          in: query
          schema:
            type: string
          description: >-
            Optional DEX platform filter (e.g. pumpfun, raydiumv4, orca,
            meteoradlmm, pumpswap). Omit for global stats.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PnlSummaryResponse'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PnlSummaryResponse:
      type: object
      properties:
        success:
          type: boolean
        period:
          type: string
          enum:
            - daily
            - weekly
            - monthly
        platform:
          type: string
          description: DEX platform filter applied, or "all" if unfiltered
        totalProfitableWallets:
          type: integer
          description: Total number of wallets with positive PnL
        totalPnlSol:
          type: number
        totalPnlUsd:
          type: number
        avgPnlSol:
          type: number
        avgPnlUsd:
          type: number
        medianPnlSol:
          type: number
        medianPnlUsd:
          type: number
        p90PnlSol:
          type: number
          description: 90th percentile PnL threshold in SOL
        p90PnlUsd:
          type: number
        p99PnlSol:
          type: number
          description: 99th percentile PnL threshold in SOL
        p99PnlUsd:
          type: number
        maxPnlSol:
          type: number
        maxPnlUsd:
          type: number
        solPriceUsd:
          type: number
        timestamp:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        code:
          type: string
        success:
          type: boolean
      example:
        error: Unauthorized
        message: Invalid API key
        code: INVALID_KEY
        success: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: apiKey

````