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

# PnL histogram distribution

> Returns a customizable histogram of profitable wallets by PnL range.
Specify the number of buckets and the USD min/max range to build your own distribution chart.
Includes counts for wallets below min and above max. Optionally filter by DEX platform.




## OpenAPI

````yaml openapi-spec/history.yaml get /api/sol/platform/pnl-distribution
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/platform/pnl-distribution:
    get:
      summary: PnL histogram distribution
      description: >
        Returns a customizable histogram of profitable wallets by PnL range.

        Specify the number of buckets and the USD min/max range to build your
        own distribution chart.

        Includes counts for wallets below min and above max. Optionally filter
        by DEX platform.
      operationId: getPnlDistribution
      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.
        - name: buckets
          in: query
          schema:
            type: integer
            default: 10
            minimum: 2
            maximum: 100
          description: Number of histogram bins
        - name: min
          in: query
          schema:
            type: number
            default: 0
          description: Minimum PnL in USD for the histogram range
        - name: max
          in: query
          schema:
            type: number
            default: 100000
          description: Maximum PnL in USD for the histogram range
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PnlDistributionResponse'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PnlDistributionResponse:
      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
        bins:
          type: array
          description: Histogram bins with wallet counts
          items:
            type: object
            properties:
              fromUsd:
                type: number
                description: Lower bound of this bin (USD)
              toUsd:
                type: number
                description: Upper bound of this bin (USD)
              count:
                type: integer
                description: Number of wallets in this bin
        belowMin:
          type: integer
          description: Wallets with PnL below the requested min
        aboveMax:
          type: integer
          description: Wallets with PnL above the requested max
        totalProfitableWallets:
          type: integer
        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

````