dune_query
Run a Dune Analytics query by ID to return live onchain rows for protocol revenue, user counts, or custom metrics. Set fast_only=True to get cached results or fail immediately.
Instructions
Run any Dune Analytics query and return live onchain results by query ID. Use fast_only=True for live bots — returns cached result instantly or raises immediately, never blocks.
Use when: You need deep onchain analytics from a specific Dune query — protocol revenue, user counts, custom metrics. Not for: you have no Dune query ID — the other tools cover prices, derivatives, TVL and security without one; you need sub-second answers — set fast_only=true or use a cached tool. Returns: rows[], columns[], row_count, generated_at from the Dune Analytics query result Example response: {"query_id": 3810512, "row_count": 2, "columns": ["protocol", "revenue_usd"], "rows": [{"protocol": "Uniswap V3", "revenue_usd": 1243800.0}, {"protocol": "Aave V3", "revenue_usd": 987200.0}], "generated_at": "2026-03-22T00:00:00Z", "source": "dune"}
Price: free. Read-only live public data; no API key, nothing signed or spent. Fails with an error message on an unknown symbol or an unreachable upstream source.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum rows to return (default 25) | |
| query_id | Yes | Dune Analytics query ID (visible in the query URL) | |
| fast_only | No | If True, return cached result immediately or raise — never execute a fresh query. Use for live bots where latency matters. Default: False. | |
| query_parameters | No | Optional named parameters to pass to the Dune query |