Top DEX pools by TVL
POST /api/dex-top-poolsTop DEX pools (Uniswap, Sushi, Curve, Aerodrome, etc.) ranked by current TVL - filterable by chain and project. Send POST /api/dex-top-pools with no required fields (3 optional) and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with source, chain, project, count and pools.
Sourced from an open DeFi analytics yields API (keyless). Each row carries chain, project slug, symbol pair, TVL in USD, current APY, and pool ID for follow-up queries.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
chain | string | no | Chain name as the source uses it (Ethereum, Base, Polygon, Arbitrum, Optimism, etc.). Case-insensitive. Omit for all chains. |
project | string | no | Project slug substring (uniswap-v3, aerodrome-v1, curve-dex, etc.). Case-insensitive substring match. Omit for all DEXes. |
limit | number | no | Max pools to return (1-50, default 10). |
Example request
curl -i -X POST https://agent402.tools/api/dex-top-pools \
-H "Content-Type: application/json" \
-d '{"chain":"Base","project":"uniswap-v3","limit":5}'
Without payment this returns HTTP 402 Payment Required with the exact price for dex-top-pools; any x402 v2 or MPP client pays it and retries.
Example response
{
"source": "defillama-yields",
"chain": "Base",
"project": "uniswap-v3",
"count": 5,
"pools": [
{
"pool": "abc123",
"chain": "Base",
"project": "uniswap-v3",
"symbol": "WETH-USDC",
"tvlUsd": 45000000,
"apy": 12.3
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
source | string | yes | defillama-yields |
chain | string | yes | Base |
project | string | yes | uniswap-v3 |
count | number | yes | 5 |
pools | array of objects | yes | 1 item in the example |
From an MCP client
catalog.call {
"slug": "dex-top-pools",
"params": {
"chain": "Base",
"project": "uniswap-v3",
"limit": 5
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for dex-top-pools; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y [email protected].
Errors and behavior
- Every field is optional. An input the tool rejects returns an HTTP 4xx whose body carries
error,tool,expected,requiredandexample. - A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/dex-top-pools returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.001" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/dex-top-pools", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chain": "Base",
"project": "uniswap-v3",
"limit": 5
}),
});
Related tools
DeFi yield screener
POST /api/defi-yieldsScreen DeFi yield pools (lending, LP, staking, vaults) across every chain from an open DeFi analytics yields dataset.
DeFi protocols ranked by TVL
POST /api/defi-protocolsDeFi protocols ranked by current TVL from an open DeFi analytics protocol list: filter by category (Lending, Dexs.
DeFi yield pool history
POST /api/defi-yield-historyDaily APY and TVL history for one DeFi yield pool (pool id from defi-yields): per-day total/base/reward APY and TVL.
DeFi chain TVL history
POST /api/defi-chain-tvl-historyDaily TVL history for one chain (Ethereum, Base, Solana, Arbitrum...) or for all of DeFi (chain "all") from an open DeFi.
DeFi TVL by chain
POST /api/defi-chainsBlockchains ranked by DeFi TVL from an open DeFi analytics chain list: name, TVL in USD, share of total DeFi TVL, native.
DEX volume by protocol
POST /api/defi-dex-volumeDecentralized exchanges ranked by 24h spot trading volume from an open DeFi analytics DEX overview: per-DEX.