DEX volume by protocol
POST /api/defi-dex-volumeDecentralized exchanges ranked by 24h spot trading volume from DefiLlama's free DEX overview: per-DEX 24h/7d/30d/1y/all-time volume with 1d/7d/30d change, category and chains; optional chain scope (Ethereum, Base, Solana, Arbitrum...), category filter and name search; sector totals and the list of chains with DEX volume. limit up to 100. Send POST /api/defi-dex-volume with no required fields (5 optional) and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with source, fetchedAt, cached, unit, chain and 4 more.
Keyless public data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
chain | string | no | Optional chain scope as DefiLlama names it (Ethereum, Base, Solana, Arbitrum, BSC, OP Mainnet...). Case-insensitive; common aliases accepted. Omit for all chains. |
category | string | no | Optional category filter (Dexs, Lending, Derivatives, Liquid Staking, ...). Case-insensitive exact match. |
search | string | no | Optional name/slug substring filter (case-insensitive). |
type | string | no | Row type: "protocol" (default), "chain" (chain-level rows such as network gas fees), or "all". |
limit | number | no | Rows to return (default 25, max 100). |
Example request
curl -i -X POST https://agent402.tools/api/defi-dex-volume \
-H "Content-Type: application/json" \
-d '{"chain":"Base","limit":5}'
Without payment this returns HTTP 402 Payment Required with the exact price for defi-dex-volume; any x402 v2 or MPP client pays it and retries.
Example response
{
"source": "defillama-dexs",
"fetchedAt": "2026-08-22T12:00:00.000Z",
"cached": true,
"unit": "USD",
"chain": "Base",
"totals": {
"total24hUsd": 1200000000,
"total7dUsd": 9000000000,
"total30dUsd": 40000000000,
"change1dPct": -3.1,
"change7dPct": 4.2,
"change1mPct": 11
},
"matched": 60,
"count": 1,
"dexs": [
{
"rank": 1,
"name": "Aerodrome Slipstream",
"slug": "aerodrome-slipstream",
"category": "Dexs",
"protocolType": "protocol",
"chains": [
"Base"
],
"chainCount": 1,
"total24hUsd": 600000000,
"total7dUsd": 4500000000,
"total30dUsd": 20000000000,
"total1yUsd": 250000000000,
"totalAllTimeUsd": 400000000000,
"change1dPct": -2.5,
"change7dPct": 3.9,
"change1mPct": 9.8
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
source | string | yes | defillama-dexs |
fetchedAt | string | yes | 2026-08-22T12:00:00.000Z |
cached | boolean | yes | true |
unit | string | yes | USD |
chain | string | yes | Base |
totals | object | yes | 6 fields: total24hUsd, total7dUsd, total30dUsd, change1dPct, change7dPct, cha... |
matched | number | yes | 60 |
count | number | yes | 1 |
dexs | array of objects | yes | 1 item in the example |
From an MCP client
catalog.call {
"slug": "defi-dex-volume",
"params": {
"chain": "Base",
"limit": 5
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for defi-dex-volume; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
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 is cancelled when the tool fails. 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/defi-dex-volume 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?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/defi-dex-volume", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chain": "Base",
"limit": 5
}),
});
Related tools
DeFi protocols ranked by TVL
POST /api/defi-protocolsDeFi protocols ranked by current TVL from DefiLlama's free protocol list: filter by category (Lending, Dexs, Liquid Stak…
Onchain options volume by protocol
POST /api/options-volumeOnchain options protocols ranked by 24h notional volume from DefiLlama's options overview: per-protocol 24h, 7d and 30d …
DeFi TVL by chain
POST /api/defi-chainsBlockchains ranked by DeFi TVL from DefiLlama's free chain list: name, TVL in USD, share of total DeFi TVL, native token…
DeFi protocol fees and revenue
POST /api/defi-feesProtocols ranked by fees paid by users (or by protocol revenue with metric "revenue") over the last 24h from DefiLlama's…
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 DefiLlama's …
DeFi protocol profile
POST /api/defi-protocolProfile of one DeFi protocol by DefiLlama slug (aave-v3, uniswap-v3, lido, morpho-v1...): TVL rank among all protocols, …