list_dex_volumes
List top decentralized exchanges ranked by 24-hour trading volume, with 1d/7d/30d change percentages to identify momentum and compare protocols like Uniswap vs PancakeSwap.
Instructions
List DEXes ranked by 24-hour trading volume.
Use for "biggest DEXes by volume", "Uniswap vs PancakeSwap volume", or to
see momentum (each entry includes 1d/7d/30d change percentages). Pair with
CCXT's get_exchange_ticker for centralized-exchange volumes.
Args: limit: Number of DEXes to return (1..200).
Returns:
Object with a summary (totals across all DEXes: total24h,
total7d, total30d, change_1d, change_7d, change_1m) and
protocols — an array of name, displayName, slug, category,
chains, total24h, total7d, total30d, total1y, totalAllTime,
change_1d, change_7d, change_1m.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Implementation Reference
- coin_mcp/defillama.py:469-521 (handler)The actual tool handler for 'list_dex_volumes'. Fetches DEX overview data from DefiLlama API, sorts by 24h volume, and returns a summary + trimmed protocol list.
@mcp.tool() async def list_dex_volumes(limit: int = 30) -> Any: """List DEXes ranked by 24-hour trading volume. Use for "biggest DEXes by volume", "Uniswap vs PancakeSwap volume", or to see momentum (each entry includes 1d/7d/30d change percentages). Pair with CCXT's `get_exchange_ticker` for centralized-exchange volumes. Args: limit: Number of DEXes to return (1..200). Returns: Object with a `summary` (totals across all DEXes: `total24h`, `total7d`, `total30d`, `change_1d`, `change_7d`, `change_1m`) and `protocols` — an array of `name`, `displayName`, `slug`, `category`, `chains`, `total24h`, `total7d`, `total30d`, `total1y`, `totalAllTime`, `change_1d`, `change_7d`, `change_1m`. """ data = await _http_get( f"{DEFILLAMA_BASE}/overview/dexs", params={ "excludeTotalDataChart": "true", "excludeTotalDataChartBreakdown": "true", }, ) if is_error(data): return data if not isinstance(data, dict): return {"error": "unexpected response", "type": type(data).__name__} protocols = data.get("protocols") or [] if not isinstance(protocols, list): return {"error": "unexpected protocols shape"} protocols = sorted(protocols, key=lambda p: _sort_key(p.get("total24h"))) limit = max(1, min(limit, 200)) keep = ( "name", "displayName", "slug", "category", "chains", "total24h", "total7d", "total30d", "total1y", "totalAllTime", "change_1d", "change_7d", "change_1m", ) return { "summary": { "total24h": data.get("total24h"), "total7d": data.get("total7d"), "total30d": data.get("total30d"), "change_1d": data.get("change_1d"), "change_7d": data.get("change_7d"), "change_1m": data.get("change_1m"), }, "protocols": [{k: p.get(k) for k in keep} for p in protocols[:limit]], } - coin_mcp/defillama.py:469-469 (registration)The @mcp.tool() decorator registers the async function as an MCP tool named 'list_dex_volumes'.
@mcp.tool() - coin_mcp/defillama.py:470-486 (schema)Function signature and docstring define the schema: accepts optional 'limit' (int, default 30, range 1-200) and returns an object with 'summary' and 'protocols' fields.
async def list_dex_volumes(limit: int = 30) -> Any: """List DEXes ranked by 24-hour trading volume. Use for "biggest DEXes by volume", "Uniswap vs PancakeSwap volume", or to see momentum (each entry includes 1d/7d/30d change percentages). Pair with CCXT's `get_exchange_ticker` for centralized-exchange volumes. Args: limit: Number of DEXes to return (1..200). Returns: Object with a `summary` (totals across all DEXes: `total24h`, `total7d`, `total30d`, `change_1d`, `change_7d`, `change_1m`) and `protocols` — an array of `name`, `displayName`, `slug`, `category`, `chains`, `total24h`, `total7d`, `total30d`, `total1y`, `totalAllTime`, `change_1d`, `change_7d`, `change_1m`. """ - coin_mcp/core.py:117-117 (helper)Registration/listing of the tool in the core catalog. Maps description 'DEX 24h volume rankings' to tool name 'list_dex_volumes'.
| DEX 24h volume rankings | list_dex_volumes |