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

# Aggregate wallet trading statistics

> Returns aggregate trading statistics for the wallet over the specified window: best and worst trades by realized PnL, win rate, total trade count, and total SOL volume.

An empty wallet (no indexed swaps) returns 200 with zero values. Response cached 60 seconds.



## OpenAPI

````yaml /api-reference/openapi.json get /wallets/{w}/stats
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:
  /wallets/{w}/stats:
    get:
      tags:
        - Wallet portfolio
      summary: Aggregate wallet trading statistics
      description: >-
        Returns aggregate trading statistics for the wallet over the specified
        window: best and worst trades by realized PnL, win rate, total trade
        count, and total SOL volume.


        An empty wallet (no indexed swaps) returns 200 with zero values.
        Response cached 60 seconds.
      operationId: getWalletStats
      parameters:
        - name: w
          in: path
          required: true
          schema:
            type: string
          description: Wallet address (base58, 32–44 characters).
        - name: window
          in: query
          required: false
          schema:
            type: string
            enum:
              - 30d
              - 90d
              - 1y
              - all
            default: all
          description: Time window to compute stats over.
        - name: dex
          in: query
          required: false
          schema:
            type: integer
          description: Filter to a single DEX by integer ID. See `DexId` for the mapping.
      responses:
        '200':
          description: Wallet stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletStatsResponse'
        '400':
          description: Invalid parameter
          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:
    WalletStatsResponse:
      type: object
      description: Aggregate trading statistics for a wallet over a given window.
      required:
        - wallet
        - window
      properties:
        wallet:
          type: string
        window:
          type: string
        total_trades:
          type: integer
        win_count:
          type: integer
          description: Number of sells that were profitable.
        win_rate:
          type: number
          description: Fraction of sells that were profitable (0.0–1.0).
        total_volume_sol:
          type: number
          description: Cumulative SOL volume.
        best_trade_pnl_sol:
          type:
            - number
            - 'null'
          description: Realized PnL of the single most profitable sell, in SOL.
        best_trade_mint:
          type:
            - string
            - 'null'
          description: Mint of the best trade.
        worst_trade_pnl_sol:
          type:
            - number
            - 'null'
          description: Realized PnL of the single worst sell, in SOL.
        worst_trade_mint:
          type:
            - string
            - 'null'
          description: Mint of the worst trade.
    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
  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.

````