# PayAI DEX Swap History & Buy/Sell Flow (Base)

> PayAI DEX Swap History & Buy/Sell Flow (Base) is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Returns recent DEX swap history and aggregated buy/sell flow for a token or pool on Base, decoded from Aerodrome/Uniswap-V3 Swap event logs.

## Facts

- Endpoint: GET https://payai.agentstools.dev/dex/swaps
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/payai-dex-swap-history-buy-sell-flow-base-b96c5fa3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FPx7Yj-Yr2GJkq3JfXlit

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability payai-dex-swap-history-buy-sell-flow-base-b96c5fa3
```

Example prompt: Show me the last hour of swap activity for WETH on Base — I want to see the individual trades plus a summary of total buy and sell volume and net flow, with up to 200 swaps.

## When to prefer this

Use this endpoint when you need decoded, human-readable DEX swap history specifically on the Base blockchain from Aerodrome or Uniswap V3 pools, including both per-trade granularity and aggregated buy/sell flow summaries. Prefer over raw RPC calls or block explorers when you want structured, pre-decoded swap data without indexing yourself.

## Known failure modes

- Token symbol not recognized or not tracked — returns empty or error
- Pool address invalid or not indexed — returns no data
- Window exceeds ~6h maximum — capped or rejected
- Limit exceeds 500 — capped at 500
- No swaps in the requested window — empty swap list with zero-summary
- Payment not provided (x402) — 402 Payment Required response

## How this service works

Recent DEX swap history + buy/sell flow for a token or pool on Base: per-swap trader/side/amount/price plus a summary (count, buy/sell volume, net flow, largest swaps), decoded by us from public Aerodrome/Uniswap-V3 Swap event logs.

## Output

Returns a list of individual swaps (trader address, buy/sell side, amount, price) within the requested window, plus a summary object containing total swap count, aggregate buy volume, sell volume, net flow direction, and the largest swaps — all decoded from Aerodrome/Uniswap-V3 event logs on Base.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "pool": {
       "type": "string",
       "description": "Explicit pool address (0x..) instead of a token symbol"
      },
      "limit": {
       "type": "integer",
       "maximum": 500,
       "minimum": 1,
       "description": "Max swaps to return (default/cap 500; summary covers the full window)"
      },
      "token": {
       "type": "string",
       "description": "Base token symbol (e.g. WETH/AERO); aggregates all its tracked pools"
      },
      "window": {
       "type": "string",
       "description": "Look-back window, e.g. 30m / 1h / 6h (default 1h, max ~6h)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/payai-dex-swap-history-buy-sell-flow-base-b96c5fa3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
