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

# Deprecated: Get Wallet PnL

> Deprecated. Use PnL V2 instead: `GET /v2/pnl/wallets/{wallet}` for wallet summaries and `GET /v2/pnl/wallets/{wallet}/positions` for token positions.

Gets Profit and Loss data for all positions of a wallet

## SDK Example

<CodeGroup>
  ```typescript SDK
  import { Client } from '@solana-tracker/data-api';

  const client = new Client({ apiKey: 'YOUR_API_KEY' });

  const data = await client.getWalletPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF');

  ```
</CodeGroup>


## OpenAPI

````yaml /data-api/openapi.json get /pnl/{wallet}
openapi: 3.1.0
info:
  title: Solana Tracker Data API
  description: >-
    Solana Tracker Data API for token prices, holders, trades, charts, wallet
    data, risk signals, and market analytics.
  version: 1.0.0
  contact:
    email: contact@solanatracker.io
servers:
  - url: https://data.solanatracker.io
    description: Production server
security:
  - apiKey: []
paths:
  /pnl/{wallet}:
    get:
      tags:
        - PnL
      summary: 'Deprecated: Get Wallet PnL'
      description: >-
        Deprecated. Use PnL V2 instead: `GET /v2/pnl/wallets/{wallet}` for
        wallet summaries and `GET /v2/pnl/wallets/{wallet}/positions` for token
        positions.


        Gets Profit and Loss data for all positions of a wallet
      parameters:
        - name: wallet
          in: path
          required: true
          schema:
            type: string
        - name: showHistoricPnL
          in: query
          description: Adds PnL data for 1d, 7d and 30d intervals (BETA)
          schema:
            type: boolean
        - name: holdingCheck
          in: query
          description: Does an extra check for current holding value in wallet
          schema:
            type: boolean
        - name: hideDetails
          in: query
          description: Return only summary without data for each token
          schema:
            type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletPnLResponse'
              example:
                tokens:
                  DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263:
                    holding: 34587.83040999995
                    held: 569619.4014500001
                    sold: 569619.4014500001
                    sold_usd: 8.848779535217
                    realized: 4.101715619389
                    unrealized: -0.698268859628
                    total: 3.403446759761
                    total_sold: 8.848779535217
                    total_invested: 5.919909387386
                    average_buy_amount: 0.227688822592
                    current_value: 0.474576611914
                    cost_basis: 0.000033909195
                    first_buy_time: 1750435283197
                    last_buy_time: 1753194281458
                    last_sell_time: 1754205433802
                    last_trade_time: 1754205433802
                    buy_transactions: 26
                    sell_transactions: 23
                    total_transactions: 49
      deprecated: true
      x-codeSamples:
        - lang: typescript
          label: SDK
          source: >
            import { Client } from '@solana-tracker/data-api';


            const client = new Client({ apiKey: 'YOUR_API_KEY' });


            const data = await
            client.getWalletPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF');
      x-code-samples:
        - lang: typescript
          label: SDK
          source: >
            import { Client } from '@solana-tracker/data-api';


            const client = new Client({ apiKey: 'YOUR_API_KEY' });


            const data = await
            client.getWalletPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF');
components:
  schemas:
    WalletPnLResponse:
      type: object
      properties:
        tokens:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TokenPnLResponse'
        summary:
          $ref: '#/components/schemas/PnLSummary'
    TokenPnLResponse:
      type: object
      properties:
        holding:
          type: number
        held:
          type: number
        sold:
          type: number
        sold_usd:
          type: number
        realized:
          type: number
        unrealized:
          type: number
        total:
          type: number
        total_sold:
          type: number
        total_invested:
          type: number
        average_buy_amount:
          type: number
        current_value:
          type: number
        cost_basis:
          type: number
        first_buy_time:
          type: integer
        last_buy_time:
          type: integer
        last_sell_time:
          type: integer
        last_trade_time:
          type: integer
        buy_transactions:
          type: integer
        sell_transactions:
          type: integer
        total_transactions:
          type: integer
    PnLSummary:
      type: object
      properties:
        realized:
          type: number
        unrealized:
          type: number
        total:
          type: number
        totalInvested:
          type: number
        averageBuyAmount:
          type: number
        totalWins:
          type: integer
        totalLosses:
          type: integer
        winPercentage:
          type: number
        lossPercentage:
          type: number
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````