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

# PnL chart + summary header

> Same compute-on-read daily series as `/history`, chart-shaped (`t`/`realized`/`unrealized`/`value`) plus a summary header whose `unrealized_sol` is read-time spot (reconciles with `/v2/pnl/wallets/{wallet}`). Cached 30s.



## OpenAPI

````yaml /api-reference/openapi.json get /v2/pnl/wallets/{wallet}/chart
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/wallets/{wallet}/chart:
    get:
      tags:
        - Wallet PnL (v2)
      summary: PnL chart + summary header
      description: >-
        Same compute-on-read daily series as `/history`, chart-shaped
        (`t`/`realized`/`unrealized`/`value`) plus a summary header whose
        `unrealized_sol` is read-time spot (reconciles with
        `/v2/pnl/wallets/{wallet}`). Cached 30s.
      operationId: getPnlV2Chart
      parameters:
        - name: wallet
          in: path
          required: true
          schema:
            type: string
          description: Wallet address (base58, 32–44 characters).
        - name: from
          in: query
          required: false
          schema:
            type: string
          description: Inclusive start date (UTC, `YYYY-MM-DD`).
        - name: to
          in: query
          required: false
          schema:
            type: string
          description: Inclusive end date (UTC, `YYYY-MM-DD`).
        - 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`.
      responses:
        '200':
          description: Chart + summary
          content:
            application/json:
              schema:
                type: object
                properties:
                  wallet:
                    type: string
                  pnl_mode:
                    type: string
                  points:
                    type: array
                    items:
                      type: object
                      properties:
                        t:
                          type: string
                          description: YYYY-MM-DD.
                        realized:
                          type: number
                          description: Cumulative, mode-selected.
                        unrealized:
                          type: number
                          description: Day-close mark.
                        value:
                          type: number
                  summary:
                    type: object
                    properties:
                      realized_sol:
                        type: number
                        description: Latest cumulative checkpoint.
                      unrealized_sol:
                        type: number
                        description: Read-time spot; reconciles with /v2.
                      total_value_sol:
                        type: number
                        description: Spot.
                      unrealized_usd:
                        type:
                          - number
                          - 'null'
                      total_value_usd:
                        type:
                          - number
                          - 'null'
                      win_rate:
                        type: number
                        description: Winning sells / total sells (mode-selected).
                      best_day:
                        oneOf:
                          - type: object
                            properties:
                              day:
                                type: string
                              realized_sol:
                                type: number
                          - type: 'null'
                      worst_day:
                        oneOf:
                          - type: object
                            properties:
                              day:
                                type: string
                              realized_sol:
                                type: number
                          - type: 'null'
                        description: Per-day realized DELTA.
                      open_positions:
                        type: integer
                      closed_positions:
                        type: integer
        '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:
    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.

````