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

# Token traders by realized PnL

> Traders of a token ranked by realized PnL (mode-selected, full breakdown included). `total` is the true total under LIMIT. `platform` and `dex` are accepted but ignored — each adds an entry to `warnings`. Cached 30s.



## OpenAPI

````yaml /api-reference/openapi.json get /v2/pnl/tokens/{token}/traders
openapi: 3.1.0
info:
  title: Dexploit API
  version: 1.0.0
  description: Real-time and historical Solana DEX swap and OHLCV data.
servers:
  - url: https://api.dexploit.dev
    description: Production
security:
  - ApiKeyHeader: []
  - BearerAuth: []
  - ApiKeyQuery: []
paths:
  /v2/pnl/tokens/{token}/traders:
    get:
      tags:
        - Wallet PnL (v2)
      summary: Token traders by realized PnL
      description: >-
        Traders of a token ranked by realized PnL (mode-selected, full breakdown
        included). `total` is the true total under LIMIT. `platform` and `dex`
        are accepted but ignored — each adds an entry to `warnings`. Cached 30s.
      operationId: getPnlV2TokenTraders
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
          description: Token mint address (base58).
        - name: pnl_mode
          in: query
          required: false
          schema:
            type: string
            enum:
              - raw
              - strict
              - adjusted
            default: adjusted
          description: >-
            PnL accounting mode. `strict` (FIFO) and `adjusted` (weighted-avg
            cost) are realized-PnL figures; `raw` is **net cash-flow** (Σ sells
            − Σ buys), not realized PnL. Unknown values fall back to `adjusted`.
        - name: exclude_arbitrage
          in: query
          required: false
          schema:
            type: boolean
            default: false
          description: Exclude arbitrageur positions.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
            minimum: 1
            maximum: 1000
          description: Page size.
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
          description: Page offset.
        - name: platform
          in: query
          required: false
          schema:
            type: string
          description: Accepted but ignored (produces a warning).
        - name: dex
          in: query
          required: false
          schema:
            type: string
          description: Accepted but ignored (produces a warning).
      responses:
        '200':
          description: Traders page
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                  pnl_mode:
                    type: string
                  total:
                    type: integer
                    description: True total under LIMIT (count() OVER ()).
                  limit:
                    type: integer
                  offset:
                    type: integer
                  traders:
                    type: array
                    items:
                      $ref: '#/components/schemas/TokenTraderRow'
                  warnings:
                    type: array
                    items:
                      type: string
        '400':
          description: Invalid parameter or malformed body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    TokenTraderRow:
      type: object
      description: >-
        One trader of a token, with mode-selected realized PnL plus the full
        breakdown.
      properties:
        wallet:
          type: string
        realized_sol:
          type: number
          description: Mode-selected.
        realized_breakdown:
          $ref: '#/components/schemas/RealizedBreakdown'
        unrealized_sol:
          type:
            - number
            - 'null'
        current_value_sol:
          type:
            - number
            - 'null'
        balance_atomic:
          type: integer
        avg_cost_per_token:
          type: number
        cost_basis_sol:
          type: number
        total_buy_count:
          type: integer
        total_sell_count:
          type: integer
        is_arbitrageur:
          type: boolean
        is_kol:
          type: boolean
        tags:
          type: array
          items:
            type: string
    ErrorEnvelope:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: INVALID_PARAM
            message:
              type: string
              example: >-
                use pair_address; see /api/v1/pairs?token_address=X to discover
                pools
    RealizedBreakdown:
      type: object
      description: >-
        Per-mode realized accounting (SOL). Present on glass-box responses or
        when `breakdown=1`. Note `raw` is **not** realized PnL — it is net
        cash-flow (Σ sells − Σ buys). Only `strict` and `adjusted` are
        cost-basis realized-PnL figures.
      properties:
        raw:
          type: number
          description: >-
            Net cash-flow in SOL: Σ(SOL received from sells) − Σ(SOL spent on
            buys). **Not realized PnL** — it ignores cost basis and counts every
            buy (including zero-token buys), so it diverges from
            `strict`/`adjusted` whenever a position still holds open lots (Wave
            6.5 / QW-9).
        strict:
          type: number
          description: >-
            Realized PnL in SOL under strict FIFO lot matching (`proceeds −
            matched_cost` on the matched portion of each sell).
        adjusted:
          type: number
          description: >-
            Realized PnL in SOL under weighted-average cost basis (`proceeds −
            avg_cost × sell_qty`). The default `pnl_mode`.
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Preferred for swaps-api endpoints (`/swaps/*`, `/stats/*`, `/trending`,
        `/pool-events`).
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Required by the OHLCV endpoints (`/api/v1/*`) and accepted by every
        other endpoint. Send `Authorization: Bearer ohlcv_live_sk_<your_key>`.
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: >-
        Browser-friendly alternative to the Bearer header — accepted by every
        endpoint and required for WebSocket from the browser.

````