> ## 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](/cn/graphql/examples/balance-holders) | MCP: `wallet_get_pnl`


## OpenAPI

````yaml /cn/api-reference/openapi-data-cn.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

````