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

> Obsoleto. Use PnL V2: `GET /v2/pnl/wallets/{wallet}` para resumen de cartera y `GET /v2/pnl/wallets/{wallet}/positions` para posiciones por token.

Antes: PnL de todas las posiciones de la cartera.

## SDK Example

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

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

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


## OpenAPI

````yaml /es/data-api/openapi.json get /pnl/{wallet}
openapi: 3.1.0
info:
  title: API de datos Solana Tracker
  description: >-
    API de datos de Solana Tracker: precios de tokens, tenedores, operaciones,
    gráficos, datos de cartera, señales de riesgo y analítica de mercado.
  version: 1.0.0
  contact:
    email: contact@solanatracker.io
servers:
  - url: https://data.solanatracker.io
    description: Entorno de producción
security:
  - apiKey: []
paths:
  /pnl/{wallet}:
    get:
      tags:
        - PnL
      summary: 'Deprecated: Get Wallet PnL'
      description: >-
        Obsoleto. Use PnL V2: `GET /v2/pnl/wallets/{wallet}` para resumen de
        cartera y `GET /v2/pnl/wallets/{wallet}/positions` para posiciones por
        token.


        Antes: PnL de todas las posiciones de la cartera.
      parameters:
        - name: wallet
          in: path
          required: true
          schema:
            type: string
        - name: showHistoricPnL
          in: query
          description: Añade PnL en intervalos de 1d, 7d y 30d (BETA).
          schema:
            type: boolean
        - name: holdingCheck
          in: query
          description: Comprobación adicional del valor actual de las tenencias.
          schema:
            type: boolean
        - name: hideDetails
          in: query
          description: Solo resumen agregado, sin detalle por 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: Clave API para autenticación

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.