execute_sql
Run custom SQL queries on blockchain data from Dune Analytics to analyze transactions, trades, and wallet activity across multiple chains.
Instructions
Execute a raw SQL query against Dune's data engine.
This is the primary tool for running custom SQL queries on blockchain data. Returns an execution_id that can be used to check status and retrieve results.
Args: sql: The SQL query to execute. Use DuneSQL (Trino) syntax. Read dune://guide/sql-syntax for syntax reference. performance: Performance tier - "medium" (default) or "large" for complex queries.
Returns: Execution details including execution_id and initial state.
Example SQL queries: - SELECT * FROM dex.trades WHERE block_time > now() - interval '1' day LIMIT 10 - SELECT blockchain, SUM(amount_usd) as volume FROM dex.trades GROUP BY 1
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| performance | No | medium |