> ## 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 Token-Specific PnL

> 已弃用。请改用：`GET /v2/pnl/wallets/{wallet}/tokens/{token}`。

原接口：某钱包内指定代币的盈亏。

## SDK Example

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

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

  const data = await client.getTokenPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN');

  ```
</CodeGroup>


## OpenAPI

````yaml /cn/data-api/openapi.json get /pnl/{wallet}/{token}
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}/{token}:
    get:
      tags:
        - PnL
      summary: 'Deprecated: Get Token-Specific PnL'
      description: |-
        已弃用。请改用：`GET /v2/pnl/wallets/{wallet}/tokens/{token}`。

        原接口：某钱包内指定代币的盈亏。
      parameters:
        - name: wallet
          in: path
          required: true
          schema:
            type: string
        - name: token
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenPnLResponse'
              example:
                holding: 34587.83040999995
                held: 569619.4014500001
                sold: 569619.4014500001
                sold_usd: 8.848779535217
                realized: 4.101715619389
                unrealized: -0.696452596669
                total: 3.40526302272
                total_sold: 8.848779535217
                total_invested: 5.919909387386
                average_buy_amount: 0.227688822592
                current_value: 0.476392874873
                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.getTokenPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF',
            '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN');
      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.getTokenPnL('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF',
            '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN');
components:
  schemas:
    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
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 用于鉴权的 API Key

````