# DEX Pair Discovery (Uniswap V2/V3 on Base/Optimism/Mainnet)

> DEX Pair Discovery (Uniswap V2/V3 on Base/Optimism/Mainnet) is a paid API for AI agents from x402-audit.tatschluizguilherme.workers.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-14).

Discovers all Uniswap V2 and V3 liquidity pools for any ERC-20 token across Base, Optimism, and Ethereum Mainnet, returning per-pool pricing, liquidity, and reserve data computed directly on-chain.

## Facts

- Endpoint: GET https://x402-audit.tatschluizguilherme.workers.dev/pairs
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/dex-pair-discovery-uniswap-v2-v3-on-base-optimism-mainnet-e2aafe47
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_56R842BsZ7jORxAKRhIHz

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 dex-pair-discovery-uniswap-v2-v3-on-base-optimism-mainnet-e2aafe47
```

Example prompt: Find all Uniswap V2 and V3 pools for the token at address 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on Base, and tell me which pool has the deepest liquidity and what the current USD price is.

## When to prefer this

Use this endpoint when you need comprehensive, on-chain DEX liquidity discovery for an ERC-20 token without relying on any indexer or off-chain market data API. Ideal when you need to enumerate all available Uniswap V2/V3 fee tiers, compare liquidity depth across pools, or get a trustless spot price derived directly from contract state on Base, Optimism, or Ethereum Mainnet.

## Known failure modes

- Invalid or non-ERC-20 token address returns empty pool list or error
- Unsupported chain value returns validation error
- Token with no liquidity on any pool returns empty array
- RPC timeout or on-chain call failure returns 5xx error
- Malformed bases= parameter may result in no pools found

## How this service works

Pay-per-call on-chain API for AI agents and developers: wallet audits, token safety audits (honeypot detection), live gas prices, token prices, transaction receipts, balances, ENS resolution, block data, ERC-20 allowances, transaction simulation, swap quotes and multicall batches — all computed on-chain via public RPCs (no external market API). Pay per request in USDC on Base via the x402 exact scheme (EIP-3009 transferWithAuthorization). No API key, no signup, no subscription.

## Output

Returns an array of pool objects sorted by liquidityUsd descending. Each object includes: venue (UniswapV2/V3), pool address, feeTier, feePct, token0 and token1 (symbol + decimals), tokenIsToken0 flag, quote token, priceInQuote, priceUsd, liquidityUsd, and either reserves (V2) or sqrtPriceX96+liquidity (V3). Also returns total pool count and a truncated flag. Pools with zero reserves are excluded.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 10,
  "pairs": [
   {
    "quote": {
     "symbol": "WETH",
     "address": "0x4200000000000000000000000000000000000006",
     "decimals": 18
    },
    "venue": "uniswap-v3",
    "feePct": 0.3,
    "token0": {
     "symbol": "WETH",
     "address": "0x4200000000000000000000000000000000000006",
     "decimals": 18
    },
    "token1": {
     "symbol": "AERO",
     "address": "0x940181a94a35a4569e4529a3cdfb74e38fd98631",
     "decimals": 18
    },
    "address": "0x3d5d143381916280ff91407febeb52f2b60f33cf",
    "feeTier": 3000,
    "priceUsd": 0.4153275295,
    "liquidity": "778276117698…",
    "liquidityUsd": 4342823,
    "priceInQuote": 0.000221597351,
    "sqrtPriceX96": "532227488789210…",
    "quotePriceUsd": 1874.1,
    "tokenIsToken0": false
   }
  ],
  "token": {
   "symbol": "AERO",
   "address": "0x940181a94a35a4569e4529a3cdfb74e38fd98631",
   "decimals": 18
  },
  "network": "base",
  "truncated": true,
  "requestedAt": "2026-08-05T04:00:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/dex-pair-discovery-uniswap-v2-v3-on-base-optimism-mainnet-e2aafe47/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-audit.tatschluizguilherme.workers.dev](https://www.zero.xyz/host/x402-audit.tatschluizguilherme.workers.dev/llms.txt)
