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

# Wallet PnL

> Per-token profitability rows for a wallet, including realized and unrealized PnL, ROI, volumes, and trade counts.

export const EndpointMeta = ({premium, cus, cusUnit, mainnetOnly}) => {
  const items = [];
  const planName = typeof premium === "string" ? premium : "Pro";
  if (premium) {
    items.push({
      icon: "\u26a0\ufe0f",
      label: "Premium endpoint",
      text: <>
          Requires the <strong>{planName} plan</strong> or above.{" "}
          <a href="/data-api/introduction/resources/premium-endpoints">
            View all
          </a>
          .
        </>
    });
  }
  if (cus) {
    const isDynamic = !!cusUnit;
    items.push({
      icon: "\u26a1",
      label: isDynamic ? "Dynamic cost" : "Endpoint cost",
      text: isDynamic ? <>
          {cus} CUs per {cusUnit}.{" "}
          <a href="/get-started/pricing#dynamic-endpoints">Learn more</a>.
        </> : <>
          {cus} CUs.{" "}
          <a href="/get-started/pricing">Learn more</a>.
        </>
    });
  }
  if (mainnetOnly) {
    items.push({
      icon: "\ud83d\udd17",
      label: "Mainnet only",
      text: <>Testnet chains are not supported.</>
    });
  }
  if (items.length === 0) return null;
  return <div className="endpoint-meta" style={{
    border: "1px solid var(--border-color, #e2e8f0)",
    borderRadius: "8px",
    overflow: "hidden",
    marginBottom: "16px",
    fontSize: "14px",
    lineHeight: "1.6",
    maxWidth: "100%"
  }}>
      <style dangerouslySetInnerHTML={{
    __html: `
            .endpoint-meta {
              --border-color: #e2e8f0;
              --row-bg: #f8fafc;
              --label-color: #0f172a;
              --text-color: #1f2937;
            }
            .endpoint-meta a {
              color: #0f7fff !important;
              text-decoration: underline;
            }
            @media (prefers-color-scheme: dark) {
              .endpoint-meta {
                --border-color: #374151 !important;
                --row-bg: #1e293b !important;
                --label-color: #f9fafb !important;
                --text-color: #e5e7eb !important;
              }
              .endpoint-meta a {
                color: #60a5fa !important;
              }
            }
            html.dark .endpoint-meta,
            [data-theme="dark"] .endpoint-meta {
              --border-color: #374151 !important;
              --row-bg: #1e293b !important;
              --label-color: #f9fafb !important;
              --text-color: #e5e7eb !important;
            }
            html.dark .endpoint-meta a,
            [data-theme="dark"] .endpoint-meta a {
              color: #60a5fa !important;
            }
          `
  }} />
      {items.map((item, i) => <div key={i} style={{
    display: "flex",
    alignItems: "baseline",
    gap: "8px",
    padding: "10px 14px",
    borderBottom: i < items.length - 1 ? "1px solid var(--border-color, #e2e8f0)" : "none",
    backgroundColor: "var(--row-bg, #f8fafc)"
  }}>
          <span style={{
    flexShrink: 0
  }}>{item.icon}</span>
          <span style={{
    wordBreak: "break-word",
    color: "var(--text-color, #1f2937)"
  }}>
            <strong style={{
    color: "var(--label-color, #0f172a)"
  }}>
              {item.label}:
            </strong>{" "}
            {item.text}
          </span>
        </div>)}
    </div>;
};

<EndpointMeta cus={50} cusUnit="chain" mainnetOnly />

<Note>
  This is the multi-chain successor to the legacy Deep Index [Wallet PnL Breakdown](/data-api/evm/wallet/wallet-pnl) endpoint. Pass multiple `chains` (or `mainnets`) to get per-token profitability across chains in a single request.
</Note>


## OpenAPI

````yaml openapi-files/data-api/api-v1.json GET /v1/wallets/{walletAddress}/pnl
openapi: 3.0.0
info:
  title: Moralis Universal API 🚧
  description: This API is in early access and is subject to change.
  version: '1.0'
servers:
  - url: https://api.moralis.com
security: []
externalDocs:
  description: Moralis API Docs
  url: https://docs.moralis.com
paths:
  /v1/wallets/{walletAddress}/pnl:
    get:
      tags:
        - Wallets
        - PnL
      summary: Get per-token profitability for a wallet across multiple chains.
      description: >-
        Per-token profitability rows for a wallet, including realized and
        unrealized PnL, ROI, volumes, and trade counts.
      operationId: getWalletProfitability
      parameters:
        - name: walletAddress
          required: true
          in: path
          description: The address
          examples:
            '0xcb1c1fde09f811b294172696404e88e658659905':
              value: '0xcb1c1fde09f811b294172696404e88e658659905'
          schema:
            type: string
        - name: chains
          required: false
          in: query
          description: Chains to query
          schema:
            type: array
            items:
              type: string
              enum:
                - '0x1'
                - ethereum
                - '0x171'
                - pulse
                - '0x2105'
                - base
                - '0x38'
                - binance
                - '0x89'
                - polygon
                - '0xa'
                - optimism
                - '0xa86a'
                - avalanche
                - all
                - mainnets
        - name: tokenAddresses
          required: false
          in: query
          description: >-
            Filter to specific token addresses. A single value is coerced to a
            one-element array. Omit to return all tokens.
          schema:
            type: array
            items:
              type: string
        - name: period
          required: false
          in: query
          description: >-
            Period (e.g. 7d, 30d, all). Ignored when fromTimestamp/toTimestamp
            are provided.
          schema:
            example: 7d
            type: string
        - name: fromTimestamp
          required: false
          in: query
          description: From timestamp in ms.
          schema:
            type: string
        - name: toTimestamp
          required: false
          in: query
          description: To timestamp in ms.
          schema:
            type: string
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            default: 100
            type: number
        - name: cursor
          required: false
          in: query
          description: Encoded v2 cursor (JWT).
          schema:
            type: string
        - name: sortBy
          required: false
          in: query
          schema:
            default: totalPnl
            enum:
              - realizedPnl
              - unrealizedPnl
              - totalPnl
              - volume
              - tradeCount
            type: string
        - name: excludeLowLiquidity
          required: false
          in: query
          schema:
            type: boolean
        - name: minVolumeUsd
          required: false
          in: query
          schema:
            minimum: 0
            type: number
        - name: minTradeCount
          required: false
          in: query
          schema:
            minimum: 0
            type: number
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWalletProfitabilityResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GetWalletProfitabilityResponse:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/MultiChainResponseMetaDto'
        result:
          type: array
          items:
            $ref: '#/components/schemas/WalletProfitabilityRow'
        cursor:
          type: string
          nullable: true
          description: >-
            Encoded v2 cursor (JWT) — refresh within 5 minutes per cursor
            staleness contract
        limit:
          type: number
          example: 100
      required:
        - meta
        - result
        - cursor
        - limit
    MultiChainResponseMetaDto:
      type: object
      properties:
        syncedAt:
          type: object
          description: >-
            Last sync block position for each chain in the response. The literal
            'latest' indicates the chain is synced up to the latest block (no
            pinned block number available).
          additionalProperties:
            oneOf:
              - type: number
              - type: string
          example:
            '0x1': 1710000000
            solana-mainnet: latest
        unsupportedChains:
          description: Requested chains that are not supported
          nullable: true
          example:
            - '0x89'
          type: array
          items:
            type: string
        failedChains:
          description: Requested chains that are not supported
          nullable: true
          example:
            - '0x89'
          type: array
          items:
            $ref: '#/components/schemas/ChainFailureDto'
      required:
        - syncedAt
        - unsupportedChains
        - failedChains
    WalletProfitabilityRow:
      type: object
      properties:
        chain:
          type: string
          example: '0x1'
        walletAddress:
          type: string
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f2BD9e'
        tokenAddress:
          type: string
          example: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
        totalTokensBought:
          type: number
          example: 100
        totalTokensSold:
          type: number
          example: 50
        totalBoughtVolumeUsd:
          type: number
          example: 150
        totalSoldVolumeUsd:
          type: number
          example: 100
          description: >-
            Total USD volume sold (pinned field name: totalSoldVolumeUsd, NOT
            totalSoldUsd).
        totalTrades:
          type: number
          example: 10
        totalBuys:
          type: number
          example: 5
        totalSells:
          type: number
          example: 5
        avgBuyPriceUsd:
          type: number
          example: 1.5
        avgSellPriceUsd:
          type: number
          example: 2
        avgCostOfQuantitySold:
          type: number
          example: 75
        remainingBalance:
          type: number
          example: 50
        currentPriceUsd:
          type: number
          nullable: true
          example: 2.1
        realizedProfitUsd:
          type: number
          example: 25
        realizedProfitPercentage:
          type: number
          example: 16.66
        unrealizedProfitUsd:
          type: number
          example: 5
        unrealizedProfitPercentage:
          type: number
          example: 3.33
        totalPnlUsd:
          type: number
          example: 30
        totalPnlPercentage:
          type: number
          example: 20
        roi:
          type: number
          example: 0.2
        name:
          type: string
          nullable: true
          example: Wrapped Ether
        symbol:
          type: string
          nullable: true
          example: WETH
        decimals:
          type: number
          nullable: true
          example: 18
        logo:
          type: string
          nullable: true
        possibleSpam:
          type: boolean
          nullable: true
          example: false
        verifiedContract:
          type: boolean
          nullable: true
          example: true
        securityScore:
          type: number
          nullable: true
          example: 95
      required:
        - chain
        - walletAddress
        - tokenAddress
        - totalTokensBought
        - totalTokensSold
        - totalBoughtVolumeUsd
        - totalSoldVolumeUsd
        - totalTrades
        - totalBuys
        - totalSells
        - avgBuyPriceUsd
        - avgSellPriceUsd
        - avgCostOfQuantitySold
        - remainingBalance
        - currentPriceUsd
        - realizedProfitUsd
        - realizedProfitPercentage
        - unrealizedProfitUsd
        - unrealizedProfitPercentage
        - totalPnlUsd
        - totalPnlPercentage
        - roi
        - name
        - symbol
        - decimals
        - logo
        - possibleSpam
        - verifiedContract
        - securityScore
    ChainFailureDto:
      type: object
      properties:
        chainId:
          type: string
          description: Chain ID of the failed chain
          example: '0x89'
        code:
          type: string
          description: Error code for the failed chain
          example: INTERNAL_SERVER_ERROR
        error:
          type: object
          description: Error message for the failed chain
          example: Failed to fetch data from the chain
          nullable: true
      required:
        - chainId
        - code
        - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````