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

> Batch twin: up to 20 wallets per call, EVM and Solana mixed freely, response array in input order. Each slot is `{ data, hasMore, nextCursor, oldestAt, usdBasis }`, the body of the single GET for that wallet, or `{ error }` when that wallet failed, so one wallet never fails the others. Every item names its `chain` (the swap history is per chain) and may carry its own `cursor`: each wallet paginates independently with the `nextCursor` of its slot. `limit`, `from`, `to`, `beforeAt` and `fromAt` apply to every wallet of the call. Billed per wallet.

`POST /v1/wallet/swaps` · **1 credit per wallet**

Batch twin: up to 20 wallets per call, EVM and Solana mixed freely, response array in input order. Each slot is `{ data, hasMore, nextCursor, oldestAt, usdBasis }`, the body of the single GET for that wallet, or `{ error }` when that wallet failed, so one wallet never fails the others. Every item names its `chain` (the swap history is per chain) and may carry its own `cursor`: each wallet paginates independently with the `nextCursor` of its slot. `limit`, `from`, `to`, `beforeAt` and `fromAt` apply to every wallet of the call. Billed per wallet.

<Note>A slot's `data`, `hasMore`, `nextCursor`, `oldestAt` and `usdBasis` are exactly what `GET /v1/wallet/swaps` returns for that wallet with the same options; see [that page](/endpoints/wallet-swaps) for the row fields and the pagination contract (`hasMore: false` means the wallet's history is fully served).</Note>

<Note>**Time window.** `from` and `to` (unix milliseconds, both inclusive) are shared by every wallet of the call; `fromAt` and `beforeAt` remain supported, one name per bound.</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://api.serialized.xyz/v1/wallet/swaps' \
    -H 'Authorization: YOUR_API_KEY' -H 'Content-Type: application/json' \
    -d '{"items":[{"wallet":"0x41f26df3bebc317cc07b43cfd6950e9e1d5bc4d4","chain":"evm:8453"},{"wallet":"4YFpz3g8AJ11fxxi8w4EUmGDa83scByRaMoM3hqNMPBr","chain":"solana"}],"limit":1,"to":1791057737000}'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "data": [
          {
            "id": "0x389b7d278813e8a3544af9388dfcfaa1feca04d0dd26634cbeb46ec723381f14",
            "at": 1791057737000,
            "chain": "evm:8453",
            "txHash": "0x389b7d278813e8a3544af9388dfcfaa1feca04d0dd26634cbeb46ec723381f14",
            "block": 52134195,
            "sent": [
              {
                "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
                "symbol": "USDC",
                "name": "USD Coin",
                "decimals": 6,
                "amount": 125.139974
              }
            ],
            "received": [
              {
                "tokenAddress": "0x0000000000000000000000000000000000000000",
                "symbol": "ETH",
                "name": "Native Token",
                "decimals": 18,
                "amount": 0.04658273783960646
              }
            ],
            "volumeNative": 0.04658273783960646,
            "volumeUsd": 125.12006926873696,
            "feesNative": null,
            "route": [
              {
                "poolAddress": "0xaf15cd1f9c3874bbcfddfc2b544544612c9de8c8bae28ba21c129c6b286c1e19",
                "poolType": "UNISWAP_V4",
                "sent": {
                  "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
                  "amount": 73.292855
                },
                "received": {
                  "tokenAddress": "0x0000000000000000000000000000000000000000",
                  "amount": 0.027281798642902547
                }
              },
              {
                "poolAddress": "0x2f9175276740364e50932fc6932e329f014fce73ee03d2c5780cc491e3ac939d",
                "poolType": "UNISWAP_V4",
                "sent": {
                  "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
                  "amount": 51.847119
                },
                "received": {
                  "tokenAddress": "0x4200000000000000000000000000000000000006",
                  "amount": 0.019300939196703913
                }
              }
            ]
          }
        ],
        "hasMore": true,
        "nextCursor": "MTc5MTA1NzczN3w1MjEzNDE5NXw0MTB8MHgzODliN2QyNzg4MTNlOGEzNTQ0YWY5Mzg4ZGZjZmFhMWZlY2EwNGQwZGQyNjYzNGNiZWI0NmVjNzIzMzgxZjE0",
        "oldestAt": 1791057737000
      },
      {
        "data": [
          {
            "id": "3Ju3RNke89G1TAHs2YnxjqqvPXdgdWX1mruVsoYge7vcavPS84icJ1hdSpRsvdCbrD9Vwpo9X4y3FRUzNKhpdjeu",
            "at": 1791056268000,
            "chain": "solana",
            "txHash": "3Ju3RNke89G1TAHs2YnxjqqvPXdgdWX1mruVsoYge7vcavPS84icJ1hdSpRsvdCbrD9Vwpo9X4y3FRUzNKhpdjeu",
            "block": 453029751,
            "sent": [
              {
                "tokenAddress": "Dz9mQ9NzkBcCsuGPFJ3r1bS4wgqKMHBPiVuniW8Mbonk",
                "symbol": "USELESS",
                "name": "USELESS COIN",
                "decimals": 6,
                "amount": 14.550249
              }
            ],
            "received": [
              {
                "tokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                "symbol": "USDC",
                "name": "USD Coin",
                "decimals": 6,
                "amount": 3.422499
              }
            ],
            "volumeNative": 0.02859042,
            "volumeUsd": 3.422363300972725,
            "feesNative": 0.000382217,
            "route": [
              {
                "poolAddress": "Q2sPHPdUWFMg7M7wwrQKLrn619cAucfRsmhVJffodSp",
                "poolType": "RAYDIUM_CPMM",
                "sent": {
                  "tokenAddress": "Dz9mQ9NzkBcCsuGPFJ3r1bS4wgqKMHBPiVuniW8Mbonk",
                  "amount": 14.550249
                },
                "received": {
                  "tokenAddress": "So11111111111111111111111111111111111111112",
                  "amount": 0.02859042
                },
                "router": {
                  "programId": "DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH",
                  "name": "DFlow"
                }
              },
              {
                "poolAddress": "2Y7HATmn9aJBcxCskE5V2U2epmjvkZmB51zTJBbhj4cU",
                "poolType": "BISONFI",
                "sent": {
                  "tokenAddress": "So11111111111111111111111111111111111111112",
                  "amount": 0.02859042
                },
                "received": {
                  "tokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                  "amount": 3.422499
                },
                "router": {
                  "programId": "DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH",
                  "name": "DFlow"
                }
              }
            ],
            "router": {
              "programId": "DF1ow4tspfHX9JwWJsAb9epbkA8hmpSEAtxXy1V27QBH",
              "name": "DFlow"
            }
          }
        ],
        "hasMore": true,
        "usdBasis": "trade",
        "nextCursor": "MTc5MTA1NjI2OHwzSnUzUk5rZTg5RzFUQUhzMllueGpxcXZQWGRnZFdYMW1ydVZzb1lnZTd2Y2F2UFM4NGljSjFoZFNwUnN2ZENickQ5VndwbzlYNHkzRlJVek5LaHBkamV1",
        "oldestAt": 1791056268000
      }
    ],
    "meta": {
      "asOf": 1791064128697
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json POST /v1/wallet/swaps
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/swaps:
    post:
      summary: 'Wallet Swaps: batch'
      description: >-
        Batch twin: up to 20 wallets per call, EVM and Solana mixed freely,
        response array in input order. Each slot is `{ data, hasMore,
        nextCursor, oldestAt, usdBasis }`, the body of the single GET for that
        wallet, or `{ error }` when that wallet failed, so one wallet never
        fails the others. Every item names its `chain` (the swap history is per
        chain) and may carry its own `cursor`: each wallet paginates
        independently with the `nextCursor` of its slot. `limit`, `from`, `to`,
        `beforeAt` and `fromAt` apply to every wallet of the call. Billed per
        wallet.
      operationId: wallet-swaps-batch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - items
                - limit
              properties:
                items:
                  minItems: 1
                  maxItems: 20
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - wallet
                      - chain
                    properties:
                      wallet:
                        description: Wallet address (EVM hex or Solana base58)
                        type: string
                      chain:
                        description: >-
                          Public chain id (required: the swap history is per
                          chain).
                        type: string
                      cursor:
                        description: Opaque resume token from meta.nextCursor
                        type: string
                  description: >-
                    `[{ "wallet": "…", "chain": "…", "cursor": "…" }]` - 1 to 20
                    wallets, EVM and Solana mixed freely; `chain` required;
                    `cursor` optional, the `nextCursor` of that wallet's
                    previous slot.
                limit:
                  minimum: 1
                  maximum: 100
                  default: 50
                  type: integer
                  description: Page size per wallet, 1-100. Default 50.
                  example: 50
                  x-default: 50
                from:
                  minimum: 0
                  description: >-
                    Inclusive lower time bound, unix MILLISECONDS. A value in
                    seconds is rejected (400).
                  type: integer
                to:
                  minimum: 0
                  description: >-
                    Inclusive upper time bound, unix MILLISECONDS. A value in
                    seconds is rejected (400).
                  type: integer
                beforeAt:
                  minimum: 0
                  description: >-
                    Same as the GET, applied to every wallet: upper bound in
                    unix MILLISECONDS, swaps strictly older. Ignored for an item
                    that carries a `cursor`.
                  type: integer
                fromAt:
                  minimum: 0
                  description: >-
                    Same as the GET, applied to every wallet: inclusive lower
                    bound in unix MILLISECONDS.
                  type: integer
      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.