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

# Transactions API: Pool Swap and Liquidity Event History

> Use GET /networks/{network}/pools/{address}/transactions to retrieve swap, add-liquidity, and remove-liquidity events with USD amounts and trade direction.

The Transactions API streams swap, add-liquidity, and remove-liquidity events for any pool indexed by DexUtils. Every record is enriched with USD-denominated amounts computed at the time of the transaction, making it straightforward to filter trades by dollar value, track specific wallets, and build real-time trade feeds without running your own on-chain indexer.

## Get Pool Transactions

```http theme={null}
GET /networks/{network}/pools/{address}/transactions
```

Returns a list of transactions for a specific liquidity pool, with support for filtering by event type, time window, USD size, and maker wallet address.

### Path Parameters

<ParamField path="network" type="string" required>
  The network the pool is deployed on (e.g. `ethereum`, `bsc`). Retrieve valid network IDs from `GET /networks`.
</ParamField>

<ParamField path="address" type="string" required>
  The pool contract address to fetch transactions for.
</ParamField>

### Query Parameters

<ParamField query="type" type="string" default="all">
  Filter by transaction type. Accepted values:

  * `swap` — token swap events only
  * `add` — add-liquidity events only
  * `remove` — remove-liquidity events only
  * `all` — return all event types
</ParamField>

<ParamField query="limit" type="integer" default="50">
  Maximum number of transactions to return. The ceiling is `200`. Use timestamp-based pagination for larger datasets.
</ParamField>

<ParamField query="from_timestamp" type="integer">
  Return only transactions that occurred **at or after** this Unix timestamp (seconds). Use this to start a time-windowed query or resume from the last record in a previous response.
</ParamField>

<ParamField query="to_timestamp" type="integer">
  Return only transactions that occurred **at or before** this Unix timestamp (seconds). Combine with `from_timestamp` to define an exact time window.
</ParamField>

<ParamField query="min_amount_usd" type="number">
  Return only transactions with a USD value greater than or equal to this amount. Useful for filtering out dust trades and focusing on meaningful swaps.
</ParamField>

<ParamField query="maker" type="string">
  Filter transactions to a specific wallet address. Enables per-wallet trade history for any pool DexUtils indexes.
</ParamField>

### Code Examples

The examples below fetch the last 50 swap transactions on the Uniswap V3 USDC/WETH pool.

<CodeGroup>
  ```bash cURL theme={null}
  # Replace the token below with your actual API key from the DexUtils dashboard
  curl "https://api.dexutils.io/v1/networks/ethereum/pools/0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640/transactions?type=swap&limit=50" \
    -H "Authorization: Bearer dxu_sk_live_4f8a2bcd9e1f3a7056c8d2e94b0f1c63"
  ```

  ```python Python theme={null}
  import requests

  # Replace with your actual API key from the DexUtils dashboard
  network = "ethereum"
  pool_address = "0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640"
  url = f"https://api.dexutils.io/v1/networks/{network}/pools/{pool_address}/transactions"

  headers = {"Authorization": "Bearer dxu_sk_live_4f8a2bcd9e1f3a7056c8d2e94b0f1c63"}
  params = {
      "type": "swap",
      "limit": 50,
  }

  response = requests.get(url, headers=headers, params=params)
  data = response.json()

  for tx in data["transactions"]:
      side = tx["side"].upper()
      print(f"[{side}] ${tx['amount_usd']} — tx: {tx['tx_hash']}")

  print(f"Total transactions: {data['total']}")
  ```

  ```javascript JavaScript theme={null}
  // Replace with your actual API key from the DexUtils dashboard
  const network = "ethereum";
  const poolAddress = "0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640";

  const params = new URLSearchParams({
    type: "swap",
    limit: 50,
  });

  const response = await fetch(
    `https://api.dexutils.io/v1/networks/${network}/pools/${poolAddress}/transactions?${params}`,
    {
      headers: {
        Authorization: "Bearer dxu_sk_live_4f8a2bcd9e1f3a7056c8d2e94b0f1c63",
      },
    }
  );

  const data = await response.json();

  data.transactions.forEach((tx) => {
    const side = tx.side.toUpperCase();
    console.log(`[${side}] $${tx.amount_usd} — tx: ${tx.tx_hash}`);
  });

  console.log(`Total transactions: ${data.total}`);
  ```
</CodeGroup>

### Response Fields

<ResponseField name="transactions" type="array" required>
  Ordered array of transaction objects, newest first.

  <Expandable title="Transaction object">
    <ResponseField name="tx_hash" type="string" required>
      On-chain transaction hash. Combine with the network's `explorer_url` (from `GET /networks`) to build a block explorer deep-link.
    </ResponseField>

    <ResponseField name="type" type="string" required>
      Event type: `swap`, `add`, or `remove`.
    </ResponseField>

    <ResponseField name="timestamp" type="integer" required>
      Unix timestamp (seconds) of the block in which this transaction was confirmed.
    </ResponseField>

    <ResponseField name="maker" type="string" required>
      Wallet address that initiated the transaction.
    </ResponseField>

    <ResponseField name="amount0" type="string" required>
      Amount of `token0` involved in the transaction, adjusted for token decimals and expressed as a decimal string.
    </ResponseField>

    <ResponseField name="amount1" type="string" required>
      Amount of `token1` involved in the transaction, adjusted for token decimals and expressed as a decimal string.
    </ResponseField>

    <ResponseField name="amount_usd" type="string" required>
      Total USD value of the transaction computed at the block timestamp. Returned as a string to preserve precision.
    </ResponseField>

    <ResponseField name="price_usd" type="string" required>
      Price of the base token in USD at the time of this transaction, as implied by the swap ratio.
    </ResponseField>

    <ResponseField name="side" type="string | null" required>
      Trade direction for `swap` events: `buy` (token1 was sold to acquire token0) or `sell` (token0 was sold to acquire token1). This field is `null` for `add` and `remove` events.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="total" type="integer" required>
  Total number of transactions matching your query parameters. Use this with `limit` and timestamp filters to calculate how many pages remain.
</ResponseField>

### Example Response

```json Example Response theme={null}
{
  "transactions": [
    {
      "tx_hash": "0x3f8a1b2c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a",
      "type": "swap",
      "timestamp": 1718294821,
      "maker": "0x47ac0Fb4F2D84898e4D9E7b4DaB3C24507a6D503",
      "amount0": "1500.00",
      "amount1": "0.4382",
      "amount_usd": "1499.87",
      "price_usd": "3422.10",
      "side": "buy"
    }
  ],
  "total": 14203
}
```

<Tip>
  Set `min_amount_usd` to a large value (e.g. `100000`) to track whale swaps in real time. Pair this with a polling loop and the `from_timestamp` of your last seen transaction to build a low-latency large-trade alert feed without missing any events.
</Tip>

<Note>
  This endpoint does not support traditional offset-based pagination beyond `limit=200`. For large historical datasets, use **timestamp-based pagination**: record the `timestamp` of the oldest transaction in each response and pass it as `to_timestamp` in your next request to retrieve the preceding batch.
</Note>
