# A DEX pool's swaps, newest first

[Open the pool in TraceFast →](https://tracefast.xyz/defi/dex/pools/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640)

Every swap of the pool, newest first — the block, time and transaction, the sender and recipient as the pool's event states them, the token sold in and bought out with their raw amounts, decimals and declared symbols, and an estimated USD value at the hour of the swap (the bought leg at that hour's price, else the sold one; a leg larger than its price can vouch for is left unvalued, never capped). The swaps are those of the pools TraceFast decodes. `{pool}` is the pool's address, or the pool's own 32-byte id (a Uniswap v4 PoolId, or a Balancer v2 poolId). Paged by an opaque cursor: pass `nextCursor` back as `cursor` until it is absent.

```
GET https://tracefast.xyz/api/v1/chains/1/pools/{pool}/swaps
```

| Parameter | In | Type | Notes |
|---|---|---|---|
| `pool` | path | string | The pool's address (`0x` + 40 hex), or its own 32-byte id (`0x` + 64 hex: a Uniswap v4 PoolId, or a Balancer v2 poolId); any case. |
| `limit` | query | integer, optional | 1 to 100, default 25. |
| `cursor` | query | string, optional | `nextCursor` of the previous page. Opaque; valid only for this method and pool. |

**Access** — an [API key](/api/authentication) on the **Investigation** plan or higher ([plans](/api/authentication#plans)), or no key at all: pay per call with [x402](/api/x402) at the same path on `https://mpp.tracefast.xyz/api/v1`, at the price its `402` states. As a tool for AI agents: `get_pool_swaps` on the [MCP server](/api/mcp-server). **Stable** — see [stability](/api/conventions#stability).

`chains/1` is a literal: other chain ids answer `404 chain_not_supported`. An unknown query parameter is refused rather than ignored.

## Response

`200 application/json`, the Uniswap v3 USDC/WETH 0.05% pool. Lists in the example are cut to two entries.

```json
{
  "data": {
    "chainId": 1,
    "pool": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
    "protocol": "uniswap",
    "protocolVersion": "v3",
    "swaps": [
      {
        "blockNumber": 26434660,
        "timestamp": 1794917231,
        "txHash": "0xcc83ba8b3df7b5cd0c60d2ea1dae3ff393ecec1ba21426de43dc4b9f1622b7ac",
        "txIndex": 231,
        "logIndex": 556,
        "sender": "0x07964f135f276412b3182a3b2407b8dd45000000",
        "recipient": "0x67795402b93860d11a6521876d22d5f36d50ef56",
        "tokenIn": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "amountInRaw": "4386800000000000000",
        "tokenInDecimals": 18,
        "tokenInSymbol": "WETH",
        "tokenOut": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "amountOutRaw": "7957658734",
        "tokenOutDecimals": 6,
        "tokenOutSymbol": "USDC",
        "valueUsd": 7957.658734,
        "valuedLeg": "out",
        "priceCarried": false
      },
      {
        "blockNumber": 26434659,
        "timestamp": 1794917219,
        "txHash": "0xc8409afd532e9b8451486e39b8cb3ca615d6b4c476eaba09ec849f2984ab7a6a",
        "txIndex": 75,
        "logIndex": 81,
        "sender": "0x51c72848c68a965f66fa7a88855f9f7784502a7f",
        "recipient": "0x51c72848c68a965f66fa7a88855f9f7784502a7f",
        "tokenIn": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "amountInRaw": "6397973491832738816",
        "tokenInDecimals": 18,
        "tokenInSymbol": "WETH",
        "tokenOut": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "amountOutRaw": "11607057983",
        "tokenOutDecimals": 6,
        "tokenOutSymbol": "USDC",
        "valueUsd": 11607.057983,
        "valuedLeg": "out",
        "priceCarried": false
      }
    ],
    "nextCursor": "AVsyNjQzNDY1OSw4MV2XNxnNYa1GLbJNcgR8UVIk"
  },
  "meta": {
    "chain": "ethereum",
    "timestamp": 1794918375035,
    "cached": false,
    "docs": "https://docs.tracefast.xyz/api/pool-swaps"
  }
}
```

### `data`

| Field | Meaning |
|---|---|
| `chainId` | Chain id. `1` is Ethereum mainnet. |
| `nextCursor` | Pass back as `cursor` for the next page; absent on the last one. |
| `pool` | The pool contract; absent for a Uniswap v4 pool, which is named by `poolId`. |
| `poolId` | The pool's own 32-byte id (the Uniswap v4 PoolId), `0x`-prefixed, where it has one. |
| `protocol` | The protocol (`uniswap`, `curve`, …), from the swaps. Absent when the page has none. |
| `protocolVersion` | The protocol's version (`v3`, …), from the swaps. Absent when the page has none. |
| `swaps` | The swaps of this page, newest first. |

### `data.swaps[]`

| Field | Meaning |
|---|---|
| `amountInRaw` | The amount sold, in the token's smallest unit, as a decimal string. Absent where it could not be determined. |
| `amountOutRaw` | The amount bought, in the token's smallest unit, as a decimal string. Absent where it could not be determined. |
| `blockNumber` | Block of the swap. |
| `logIndex` | The swap event's index in the block. |
| `priceCarried` | `true` when the price behind `valueUsd` was carried from an earlier hour. |
| `recipient` | The swap's recipient as the pool's event states it. Absent where the venue states none. |
| `sender` | The swap's sender as the pool's event states it — often a router. Absent where the event names none. |
| `timestamp` | Block time, Unix seconds. |
| `tokenIn` | The token sold into the pool, lowercase and `0x`-prefixed. Absent where it could not be determined. |
| `tokenInDecimals` | Decimals of the sold token, as its contract declares them. Absent when unknown. |
| `tokenInSymbol` | Symbol the sold token's contract declares — verbatim, not verified. Absent when unknown. Absent when longer than 64 characters — left out whole, never shortened. |
| `tokenOut` | The token bought from the pool, lowercase and `0x`-prefixed. Absent where it could not be determined. |
| `tokenOutDecimals` | Decimals of the bought token, as its contract declares them. Absent when unknown. |
| `tokenOutSymbol` | Symbol the bought token's contract declares — verbatim, not verified. Absent when unknown. Absent when longer than 64 characters — left out whole, never shortened. |
| `txHash` | Hash of the transaction, lowercase and `0x`-prefixed. |
| `txIndex` | Position of the transaction within its block, from `0`. |
| `valueUsd` | Estimated USD value at the hour of the swap, as on getEntityDexTrades: the bought leg at that hour's price, else the sold leg; absent when neither can be valued (a leg larger than its price can vouch for is left unvalued, never capped). |
| `valuedLeg` | Which leg `valueUsd` is of: `out` (bought) or `in` (sold). |

`meta` is the same envelope on every method — see [conventions](/api/conventions#meta).

## Errors

| Status | When |
|---|---|
| 400 | `bad_request`: `pool` is neither an address nor a PoolId (`pool_invalid`), `limit` outside 1 to 100, an unknown query parameter; `invalid_cursor`: the cursor is not valid for this request — restart from the first page |
| 404 | `not_found`: no Uniswap v4 pool with that id is known; `chain_not_supported`, or an unknown path |

Malformed input, unknown parameters and the key check's `401`/`403`/`429`/`503` are the same for every method — see [conventions](/api/conventions#errors) and [API keys](/api/authentication#when-a-key-is-refused).

## Related pages

* [One pool](/api/pool)
* [Pool reserves](/api/pool-reserves)
* [Pool volume](/api/pool-volume)
* [Pool liquidity events](/api/pool-liquidity-events)
* [All API methods](/api/methods) — every method on one page
* [Conventions](/api/conventions) — requests, responses, errors and pagination
