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

# Wallet Closed Positions

> Every position a wallet has fully exited: total bought and sold (USD and native), realized PnL in absolute and percent, buy/sell counts and last trade time. The realized counterpart of `/v1/wallet/positions` - the realized PnL of every position lands in exactly one of the two. EVM and Solana.

`GET /v1/wallet/closed-positions` · **2 credits**

Every position a wallet has fully exited: total bought and sold (USD and native), realized PnL in absolute and percent, buy/sell counts and last trade time. The realized counterpart of [`/v1/wallet/positions`](/endpoints/wallet-positions) - the realized PnL of every position lands in exactly one of the two. EVM and Solana.

<Note>On Solana, USD figures are valued at the SOL price at the time of each trade; on EVM chains, at the current native price. `decimals` is the token's decimals. `buyFeesUsd`, `sellFeesUsd` and `totalFeesUsd` are the fees paid trading the token (network fees, tips and platform fees, in USD at the time of each transaction); `null` when not available for the position. `realizedPnlPercent` is realized PnL over total USD bought. `meta.hasMore` signals another page; `meta.oldestAt` is the last row's exit time; `meta.asOf` is the moment the holdings were read on-chain, shared by every page of the same snapshot.</Note>

<Note>`tokens=` scopes the response to 1 to 50 token addresses: the realized PnL of a fully-exited token in one call, without paging the wallet. A token whose bag is fully sold but still shows a residual balance is listed here with its realized PnL, and on [`/v1/wallet/positions`](/endpoints/wallet-positions) as a holding with `buys` and `sells` at 0.</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl 'https://api.serialized.xyz/v1/wallet/closed-positions?chain=solana&wallet=GuhieZDx6nwJV14WjeUQH2ted6CGPKoGCCTaPSPNgG2E&limit=2&sort=pnl' \
    -H 'Authorization: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "chain": "solana",
        "address": "9x4EQVaPRWSw4jKoWTpRzMP7YAu5sZwHyLJ9tbJYpump",
        "symbol": "JOKE",
        "name": "Jokecoin",
        "iconUrl": "https://serialized.cloud/token/24edc11a-af3e-4b87-b419-50ccf51ba34c/icon",
        "decimals": 6,
        "totalBuyUsd": 41.208763,
        "totalSellUsd": 58.913145,
        "totalBuyNative": 0.198734,
        "totalSellNative": 0.284102,
        "realizedPnlUsd": 17.704382,
        "realizedPnlNative": 0.085368,
        "realizedPnlPercent": 42.96,
        "buyCount": 4,
        "sellCount": 3,
        "lastTradeAt": 1786940537718,
        "buyFeesUsd": 0.016744,
        "sellFeesUsd": 0.019118,
        "totalFeesUsd": 0.035862
      },
      {
        "chain": "solana",
        "address": "GFQLVG2UKYydSCJ2WjkuMXijpgJ6hbs2nEsNwdZFpump",
        "symbol": "Tortuga",
        "name": "Tortuga",
        "iconUrl": null,
        "decimals": 6,
        "totalBuyUsd": 7.444819,
        "totalSellUsd": 3.836057,
        "totalBuyNative": 0.035902,
        "totalSellNative": 0.018501,
        "realizedPnlUsd": -3.608762,
        "realizedPnlNative": -0.017401,
        "realizedPnlPercent": -48.47,
        "buyCount": 1,
        "sellCount": 1,
        "lastTradeAt": 1786907901306,
        "buyFeesUsd": 0.019147,
        "sellFeesUsd": 0.026285,
        "totalFeesUsd": 0.045432
      }
    ],
    "meta": {
      "asOf": 1787163135112,
      "hasMore": false,
      "oldestAt": 1786907901306
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json GET /v1/wallet/closed-positions
openapi: 3.1.0
info:
  title: Serialized Data API
  description: >-
    On-chain data for trading apps - tokens, candles, token filters. Built on
    our own indexers. 18 EVM chains + Solana, live.
  version: 0.1.0
servers:
  - url: https://demo.serialized.xyz
    description: 'Demo: no key needed, read endpoints, rate-limited per IP'
  - url: https://api.serialized.xyz
    description: 'Production: your API key in the Authorization header'
security:
  - apiKey: []
  - {}
paths:
  /v1/wallet/closed-positions:
    get:
      summary: Wallet Closed Positions
      description: >-
        Every position a wallet has fully exited: total bought and sold (USD and
        native), realized PnL in absolute and percent, buy/sell counts and last
        trade time. The realized counterpart of `/v1/wallet/positions` - the
        realized PnL of every position lands in exactly one of the two. EVM and
        Solana.
      operationId: get-v1-wallet-closed-positions
      parameters:
        - schema:
            type: string
          in: query
          name: wallet
          required: true
          description: Wallet address (EVM hex, case-insensitive; Solana base58).
        - schema:
            type: string
            x-default: solana
          in: query
          name: chain
          required: false
          description: Public chain id - `evm:<id>` or `solana`. Omit for all EVM chains.
          example: solana
        - schema:
            type: string
          in: query
          name: tokens
          required: false
          description: >-
            Comma-separated token addresses (1-50) to scope the response to: the
            realized PnL of those tokens, without paging the whole wallet.
        - schema:
            minimum: 1
            maximum: 100
            default: 30
            type: integer
            x-default: 30
          in: query
          name: limit
          required: true
          description: 1-100. Default 30.
          example: 30
        - schema:
            minimum: 0
            default: 0
            type: integer
            x-default: 0
          in: query
          name: offset
          required: true
          description: Rows to skip. Default 0.
          example: 0
        - schema:
            enum:
              - lastTradeAt
              - pnl
            default: lastTradeAt
            type: string
            x-default: lastTradeAt
          in: query
          name: sort
          required: false
          description: '`lastTradeAt` (default) or `pnl`.'
          example: lastTradeAt
      responses:
        '200':
          description: Standard `{ data, meta }` envelope.
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: Authorization
      in: header
      description: Your raw API key (not needed on the demo server).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.