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

# List a wallet's positions

> Paginated cost-basis positions for a wallet. `min_value_sol` is applied **after** read-time pricing on `current_value_sol`. `total` is the true total under the LIMIT (`count() OVER ()`).



## OpenAPI

````yaml /api-reference/openapi.json get /v2/pnl/wallets/{wallet}/positions
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}/positions:
    get:
      tags:
        - Wallet PnL (v2)
      summary: List a wallet's positions
      description: >-
        Paginated cost-basis positions for a wallet. `min_value_sol` is applied
        **after** read-time pricing on `current_value_sol`. `total` is the true
        total under the LIMIT (`count() OVER ()`).
      operationId: getPnlV2Positions
      parameters:
        - name: wallet
          in: path
          required: true
          schema:
            type: string
          description: Wallet address (base58, 32–44 characters).
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - open
              - closed
              - all
            default: open
          description: Which positions to include.
        - name: mint
          in: query
          required: false
          schema:
            type: string
          description: Filter to a single mint.
        - name: min_value_sol
          in: query
          required: false
          schema:
            type: number
          description: Minimum read-time `current_value_sol` (applied post-pricing).
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - value
              - realized
              - unrealized
            default: value
          description: Sort key.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 200
          description: Page size.
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
          description: Page offset.
        - 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: breakdown
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 0
              - 1
            default: 0
          description: When `1`, forces `realized_breakdown` onto every row.
      responses:
        '200':
          description: Positions page
          content:
            application/json:
              schema:
                type: object
                properties:
                  wallet:
                    type: string
                  pnl_mode:
                    type: string
                  total:
                    type: integer
                    description: True total under LIMIT (count() OVER ()).
                  limit:
                    type: integer
                  offset:
                    type: integer
                  positions:
                    type: array
                    items:
                      $ref: '#/components/schemas/PnlPosition'
        '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:
    PnlPosition:
      type: object
      description: >-
        A single (wallet, mint) cost-basis position. All `*_sol` fields are
        already SOL (lamports/1e9). `avg_cost_per_token` and any spot price are
        lamports per **atomic** token unit. `first_trade_ts`/`last_trade_ts` are
        epoch **milliseconds**.
      properties:
        mint:
          type: string
          description: >-
            Token mint (omitted on token-keyed variants where `wallet` is
            present instead).
        balance_atomic:
          type: integer
          description: Current open balance in atomic token units (int64).
        avg_cost_per_token:
          type: number
          description: Average cost in lamports per atomic token unit.
        cost_basis_sol:
          type: number
        realized_sol:
          type: number
          description: Realized PnL in SOL for the selected `pnl_mode`.
        unrealized_sol:
          type:
            - number
            - 'null'
          description: Read-time spot unrealized PnL in SOL. `null` for null-priced mints.
        current_value_sol:
          type:
            - number
            - 'null'
          description: >-
            Read-time spot value of the open balance, in SOL. `null` when
            unpriced.
        total_buys_sol:
          type: number
        total_sells_sol:
          type: number
        total_buy_count:
          type: integer
        total_sell_count:
          type: integer
        largest_buy_sol:
          type: number
        largest_sell_sol:
          type: number
        fastest_flip_seconds:
          type: integer
          description: Shortest buy→sell round-trip in seconds (sentinel 0 = no flip).
        longest_hold_seconds:
          type: integer
        first_trade_ts:
          type: integer
          description: Epoch milliseconds of the first trade in this position.
        last_trade_ts:
          type: integer
          description: Epoch milliseconds of the most recent trade.
        is_arbitrageur:
          type: boolean
          description: >-
            Whether this (wallet, mint) was tagged as habitual cross-venue
            arbitrage.
        tags:
          type: array
          items:
            type: string
          description: Inline per-(wallet, mint) wallet-intel tags.
        realized_usd:
          type:
            - number
            - 'null'
          description: Realized PnL in USD via the Pyth oracle.
        unrealized_usd:
          type:
            - number
            - 'null'
        current_value_usd:
          type:
            - number
            - 'null'
        cost_basis_usd:
          type:
            - number
            - 'null'
        realized_breakdown:
          allOf:
            - $ref: '#/components/schemas/RealizedBreakdown'
          description: >-
            Only present on glass-box endpoints (single-token, batch, traders)
            or when `breakdown=1`.
    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.

````