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

# 錢包 - 盈虧摘要

> 取得錢包的彙總盈虧資料

<Note>
  取得錢包的盈虧概覽。展示所有代幣部位的已實現與未實現 PnL。
</Note>

**相關**: [GraphQL 錢包 PnL](/zh-Hant/graphql/examples/balance-holders) | MCP: `wallet_get_pnl`


## OpenAPI

````yaml /zh-Hant/api-reference/openapi-data-zh-Hant.yaml GET /v2/wallet/{chain}/{walletAddress}/pnl
openapi: 3.1.0
info:
  title: Services API
  description: Services API
  contact:
    name: AI
    email: ai@sx.ai
  license:
    name: MIT
  version: '1.0'
servers:
  - url: https://api.chainstream.io
    description: Production
security:
  - bearer_auth: []
  - api_key_auth: []
tags:
  - name: Blockchain
    description: 區塊鏈相關操作
  - name: Token
    description: 代幣相關操作
  - name: Trade
    description: 交易相關操作
  - name: Wallet
    description: 錢包相關操作
  - name: Dex
    description: DEX 相關操作
  - name: Ranking
    description: 排行榜相關操作
  - name: DexPool
    description: DEX 池子相關操作
  - name: Watchlist
    description: 關注列表相關操作
  - name: KYT
    description: KYT 相關操作
  - name: Webhook
    description: Webhook 相關操作
  - name: RedPacket
    description: 紅包相關操作
  - name: IPFS
    description: IPFS 相關操作
  - name: DexScreener
    description: DexScreener 相關操作
paths:
  /v2/wallet/{chain}/{walletAddress}/pnl:
    get:
      tags:
        - Wallet
      summary: 錢包 - 盈虧摘要
      description: 取得錢包的彙總盈虧資料
      operationId: get.pnl
      parameters:
        - name: chain
          in: path
          description: 支援網路列表中的鏈名稱
          required: true
          schema:
            $ref: '#/components/schemas/ChainSymbol'
          example: sol
        - name: walletAddress
          in: path
          description: 錢包地址
          required: true
          schema:
            type: string
          example: 54Pz1e35z9uoFdnxtzjp7xZQoFiofqhdayQWBMN7dsuy
        - name: resolution
          in: query
          description: 盈虧時間粒度（1d, 7d, 30d, 或 all）
          required: false
          schema:
            oneOf:
              - $ref: '#/components/schemas/PnlResolution'
            default: 1d
          example: 1d
      responses:
        '200':
          description: 成功回應
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletPnlSummary'
components:
  schemas:
    ChainSymbol:
      type: string
      description: Supported blockchain chains
      enum:
        - sol
        - eth
        - bsc
    PnlResolution:
      type: string
      description: PnL resolution period
      enum:
        - 1d
        - 7d
        - 30d
        - all
    WalletPnlSummary:
      type: object
      description: Wallet PnL Summary (aggregated across all tokens for a given resolution)
      required:
        - walletAddress
        - resolution
        - tokens
        - buys
        - sells
        - totalTrades
        - wins
        - losses
        - winRate
        - buyAmountInUsd
        - sellAmountInUsd
        - totalCostInUsd
        - realizedProfitInUsd
        - realizedProfitRatio
        - unrealizedProfitInUsd
        - unrealizedProfitRatio
        - totalProfitInUsd
        - totalProfitRatio
        - avgProfitPerTradeInUsd
      properties:
        avgProfitPerTradeInUsd:
          type: string
          description: 每筆交易平均利潤（USD 計）
          example: '402.86'
        buyAmountInUsd:
          type: string
          description: 總買入金額（USD 計）
          example: '101371192.39'
        buys:
          type: string
          description: 買入交易總次數
          example: '1515999'
        losses:
          type: string
          description: 虧損交易次數
          example: '348350'
        realizedProfitInUsd:
          type: string
          description: 已實現利潤（USD 計）
          example: '802583.91'
        realizedProfitRatio:
          type: string
          description: 已實現利潤率
          example: '0.0035521324'
        resolution:
          type: string
          description: 盈虧時間粒度
          example: 1d
        sellAmountInUsd:
          type: string
          description: 總賣出金額（USD 計）
          example: '60369621.10'
        sells:
          type: string
          description: 賣出交易總次數
          example: '1011994'
        tokens:
          type: string
          description: 交易代幣總數
          example: '15126'
        totalCostInUsd:
          type: string
          description: 總成本（USD 計）
          example: '225944253.64'
        totalProfitInUsd:
          type: string
          description: 總利潤（已實現 + 未實現，USD 計）
          example: '1018427683.08'
        totalProfitRatio:
          type: string
          description: 總利潤率
          example: '4.5074290081'
        totalTrades:
          type: string
          description: 總交易次數
          example: '2527993'
        unrealizedProfitInUsd:
          type: string
          description: 未實現利潤（USD 計）
          example: '1017625099.17'
        unrealizedProfitRatio:
          type: string
          description: 未實現利潤率
          example: '4.5038768756'
        updatedAt:
          type:
            - string
            - 'null'
          description: 最後更新時間戳
          example: '2026-02-04T11:42:50.000Z'
        walletAddress:
          type: string
          description: 錢包地址
          example: 54Pz1e35z9uoFdnxtzjp7xZQoFiofqhdayQWBMN7dsuy
        winRate:
          type: string
          description: 勝率
          example: '0.5575'
        wins:
          type: string
          description: 獲利交易次數
          example: '438944'
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    api_key_auth:
      type: apiKey
      in: header
      name: X-API-KEY

````