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

> 已弃用。请改用 PnL V2：`GET /v2/pnl/wallets/{wallet}` 获取钱包汇总，`GET /v2/pnl/wallets/{wallet}/positions` 获取各代币仓位。

原接口：返回钱包全部仓位的盈亏数据。

## 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 /cn/data-api/openapi.json get /pnl/{wallet}
openapi: 3.1.0
info:
  title: Solana Tracker 数据 API
  description: Solana Tracker 数据 API：提供代币价格、持币地址、成交、图表、钱包数据、风险信号与市场分析等能力。
  version: 1.0.0
  contact:
    email: contact@solanatracker.io
servers:
  - url: https://data.solanatracker.io
    description: 生产环境
security:
  - apiKey: []
paths:
  /pnl/{wallet}:
    get:
      tags:
        - PnL
      summary: 'Deprecated: Get Wallet PnL'
      description: >-
        已弃用。请改用 PnL V2：`GET /v2/pnl/wallets/{wallet}` 获取钱包汇总，`GET
        /v2/pnl/wallets/{wallet}/positions` 获取各代币仓位。


        原接口：返回钱包全部仓位的盈亏数据。
      parameters:
        - name: wallet
          in: path
          required: true
          schema:
            type: string
        - name: showHistoricPnL
          in: query
          description: 附加 1 日、7 日、30 日区间的盈亏（测试版）。
          schema:
            type: boolean
        - name: holdingCheck
          in: query
          description: 额外校验钱包内当前持仓估值。
          schema:
            type: boolean
        - name: hideDetails
          in: query
          description: 仅返回汇总，不包含各代币明细。
          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

````