> ## 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: batch

> Batch twin: up to 20 wallets per call, response array in input order. Each slot is `{ data, hasMore, oldestAt }`, the body of the single GET for that wallet, or `{ error }` when that wallet failed, so one wallet never fails the others. `limit`, `offset` and `sort` apply to every wallet of the call. Billed per wallet.

`POST /v1/wallet/closed-positions` · **2 per wallet credits**

Batch twin: up to 20 wallets per call, response array in input order. Each slot is `{ data, hasMore, oldestAt }`, the body of the single GET for that wallet, or `{ error }` when that wallet failed, so one wallet never fails the others. `limit`, `offset` and `sort` apply to every wallet of the call. Billed per wallet.

<Note>A slot's `data`, `hasMore` and `oldestAt` are exactly what `GET /v1/wallet/closed-positions` returns for that wallet with the same options; see that page for the row fields.</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://api.serialized.xyz/v1/wallet/closed-positions' \\
    -H 'Authorization: YOUR_API_KEY' -H 'Content-Type: application/json' \\
    -d '{"items":[{"wallet":"0xd13da05b9288ba4961973110594bd0fe3428791f","chain":"evm:8453"},{"wallet":"GuhieZDx6nwJV14WjeUQH2ted6CGPKoGCCTaPSPNgG2E","chain":"solana"}],"limit":1,"sort":"pnl"}'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "data": [
          {
            "chain": "evm:8453",
            "address": "0x940181a94a35a4569e4529a3cdfb74e38fd98631",
            "symbol": "AERO",
            "name": "Aerodrome",
            "iconUrl": null,
            "decimals": 18,
            "totalBuyUsd": 0,
            "totalSellUsd": 386683376.976055,
            "totalBuyNative": 0,
            "totalSellNative": 154148.93611,
            "realizedPnlUsd": 386683376.976055,
            "realizedPnlNative": 154148.93611,
            "realizedPnlPercent": 0,
            "buyCount": 0,
            "sellCount": 332133,
            "lastTradeAt": 1788936321000,
            "buyFeesUsd": null,
            "sellFeesUsd": null,
            "totalFeesUsd": null
          }
        ],
        "hasMore": true,
        "oldestAt": 1788936321000
      },
      {
        "data": [
          {
            "chain": "solana",
            "address": "Ls8ZWkthUviRsL3Rb62VzrTVZggiwb8KzYtGNzKpump",
            "symbol": "HIPPO",
            "name": "disappointed hippo",
            "iconUrl": null,
            "decimals": 6,
            "totalBuyUsd": 204.930108,
            "totalSellUsd": 291.328612,
            "totalBuyNative": 1.955556,
            "totalSellNative": 2.780017,
            "realizedPnlUsd": 86.398504,
            "realizedPnlNative": 0.824462,
            "realizedPnlPercent": 42.159986,
            "buyCount": 2,
            "sellCount": 2,
            "lastTradeAt": 1786904394000,
            "buyFeesUsd": null,
            "sellFeesUsd": null,
            "totalFeesUsd": null
          }
        ],
        "hasMore": true,
        "oldestAt": 1786904394000
      }
    ],
    "meta": {
      "asOf": 1788937642860
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json POST /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:
    post:
      summary: 'Wallet Closed Positions: batch'
      description: >-
        Batch twin: up to 20 wallets per call, response array in input order.
        Each slot is `{ data, hasMore, oldestAt }`, the body of the single GET
        for that wallet, or `{ error }` when that wallet failed, so one wallet
        never fails the others. `limit`, `offset` and `sort` apply to every
        wallet of the call. Billed per wallet.
      operationId: wallet-closed-positions-batch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - items
                - limit
                - offset
              properties:
                items:
                  minItems: 1
                  maxItems: 20
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - wallet
                    properties:
                      wallet:
                        description: Wallet address (EVM hex or Solana base58)
                        type: string
                      chain:
                        description: Public chain id. Omit for all EVM chains.
                        type: string
                  description: >-
                    `[{ "wallet": "…", "chain": "…" }]` - 1 to 20 wallets, EVM
                    and Solana mixed freely; `chain` optional (omit for all EVM
                    chains).
                limit:
                  minimum: 1
                  maximum: 100
                  default: 30
                  type: integer
                  description: Page size per wallet, 1-100. Default 30.
                  example: 30
                  x-default: 30
                offset:
                  minimum: 0
                  default: 0
                  type: integer
                  description: Rows to skip per wallet. Default 0.
                  example: 0
                  x-default: 0
                sort:
                  enum:
                    - lastTradeAt
                    - pnl
                  default: lastTradeAt
                  type: string
                  description: '`lastTradeAt` (default) or `pnl`, applied to every wallet.'
                  example: lastTradeAt
                  x-default: 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.