# A wallet's swaps

`GET https://api.getchord.xyz/v1/chains/{chain}/wallet/{address}/trades`

Source: https://getchord.xyz/docs/api-reference/operations/chainwallettrades/

The wallet's swaps on the chain, newest first, each with the token and its symbol. Keyset-paged: pass `nextBefore` back as `before` for the next page; `nextBefore` is null on the last one.

**The list covers the raw tape only**: the last few days the database keeps on these chains (about 3 on BNB Chain and Base, 7 on Avalanche today). `window.fromTs` is where it starts. Older days are counted in the wallet route named by `olderHistory`, as totals per token, not as a list. Say how far back the list goes when you show it.

- `wallet` on a trade is the address the tape attributed it to; a swap sent through a router that the tape could not attribute is not in the list.
- Trades under the chain's ingest floor are not in the tape (BNB Chain: $100).

Chain-keyed data for Avalanche C-Chain, Base and BNB Chain, served from Chord's rollup tables for the chain (every swap summed by hour, token and venue). Only the trade tape, the prints ticker and the wallet read raw rows, scoped to one token or one wallet and bounded.

- **Access.** No key needed while the chain is public (all three are today). A chain whose tape is off, or that is not public yet, answers `400 UNSUPPORTED_CHAIN` ("chain N is not served yet") unless the request carries an `X-API-Key`; those answers are sent `Cache-Control: private`.
- **Ingest floor.** Every count, volume and print covers trades at or above the chain's floor, returned as `ingestFloor`. BNB Chain runs at $100 today; Avalanche and Base at 0.
- **Readiness.** `503 NOT_READY` until the chain's rollup has run on this deployment; `503 CHAIN_DATA_UNAVAILABLE` when the store cannot be read. Never treat either as "no trades".

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `chain` | path | yes | `avalanche` · `base` · `bnb` · `arbitrum` · `ethereum` · `43114` · `8453` · `56` · `42161` · `1` | The chain, by key or id: `avalanche` or `43114`, `base` or `8453`, `bnb` or `56`, `arbitrum` or `42161`, `ethereum` or `1` (case-insensitive). Arc, Robinhood Chain and Monad are refused with `400 UNSUPPORTED_CHAIN` and a pointer to their own routes. |
| `address` | path | yes | string | Wallet address. |
| `limit` | query | no | integer (default `50`) | Newest rows. |
| `before` | query | no | string | Exclusive cursor: the previous page's `nextBefore` (`ts:block:logIndex`), or a Unix second. |

## Response 200

Example (captured from the live API):

```json
{
  "chain": 56,
  "wallet": "0x2cf971cb78b7a3cdc0b2044a11abd7392b796c2d",
  "window": {
    "fromTs": 1791417600,
    "toTs": 1791746566
  },
  "history": "raw",
  "trades": [
    {
      "ts": 1791746543,
      "tx": "0x330db50d0c397734e4d61fc2659b053527a9076f516b00050d4cceed47cf9c7e",
      "logIndex": 50,
      "block": 127074619,
      "token": "0x4fa7c69a7b69f8bc48233024d546bc299d6b03bf",
      "side": "sell",
      "tokenAmt": 950204.2671867504,
      "usd": 1519.2258102727808,
      "priceUsd": 0.0015988412836439056,
      "dex": "pancake_v3",
      "symbol": "quq"
    },
    {
      "ts": 1791746523,
      "tx": "0x4e1457e8bdc7d83db90ce6fed43a8092f71814c57834ecad38ec4746b47c11c1",
      "logIndex": 45,
      "block": 127074574,
      "token": "0x4fa7c69a7b69f8bc48233024d546bc299d6b03bf",
      "side": "buy",
      "tokenAmt": 855183.3425646495,
      "usd": 1367.5757736974172,
      "priceUsd": 0.0015991609116194076,
      "dex": "pancake_v3",
      "symbol": "quq"
    }
  ],
  "nextBefore": "1791746523:127074574:45",
  "olderHistory": "/v1/chains/bnb/wallet/0x2cf971cb78b7a3cdc0b2044a11abd7392b796c2d",
  "ingestFloor": {
    "minTradeUsd": 100,
    "history": [
      {
        "usd": 100,
        "fromTs": 1790789196
      }
    ]
  }
}
```

- **400**: `UNSUPPORTED_CHAIN` (unknown chain, a chain with its own routes, or a chain not served to this caller yet), or `BAD_ADDRESS` / `BAD_LIMIT` / `BAD_BEFORE`.
- **429**: Over the per-minute limit (`RATE_LIMIT_EXCEEDED`). Read `X-RateLimit-Reset` and back off.
- **503**: `NOT_READY` (the chain's rollup has not run on this deployment yet) or `CHAIN_DATA_UNAVAILABLE` (the store could not be read). Retry later; do not treat it as an empty answer.
