skills/dune/SKILL.md
Dune CLI for querying blockchain and on-chain data via DuneSQL, searching decoded contract tables, managing saved queries, managing visualizations, managing dashboards, and monitoring credit usage on Dune. Use when user asks about blockchain data, on-chain analytics, token transfers, DEX trades, smart contract events, wallet balances, Ethereum/EVM chain queries, DuneSQL, visualizations, charts, dashboards, or says "query Dune", "search Dune datasets", "run a Dune query", "create a dashboard", or "manage dashboard".
npx skillsauth add duneanalytics/skills duneInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Assume the Dune CLI is already installed and authenticated. Do not run upfront install or auth checks. Just execute the requested dune command directly.
If a dune command fails, inspect the error to determine the cause and follow the recovery steps in install-and-recovery.md:
A command-line interface for Dune -- the leading blockchain data platform. Use it to write and execute DuneSQL queries against on-chain data, discover datasets, search documentation, and monitor credit usage.
All commands except docs search require authentication via a Dune API key. The key is resolved in this priority order:
# 1. Flag (highest priority -- overrides everything)
dune query run 12345 --api-key <key>
# 2. Environment variable
export DUNE_API_KEY=<key>
dune query run 12345
# 3. Saved config file (lowest priority)
dune auth --api-key <key> # saves to ~/.config/dune/config.yaml
dune query run 12345 # uses saved key
To save your key interactively (prompted from stdin):
dune auth
Config file location: ~/.config/dune/config.yaml
| Flag | Description |
|------|-------------|
| --api-key <KEY> | Dune API key (overrides DUNE_API_KEY env var and saved config) |
Most commands support -o, --output <FORMAT> with values text (default, human-readable tables) or json (machine-readable).
Always use
-o jsonon every command that supports it. JSON output contains more detail thantext(full API response objects vs. summarized tables) and is unambiguous to parse. Thetextformat is for human terminal use and drops fields.
Dune uses DuneSQL, a Trino-based SQL dialect, as its query engine. Key points:
--sql flags or saved queries must be valid DuneSQLdune docs search --query "DuneSQL functions" to look up syntax and functionsAvailable tiers: free, medium, large. Do not pass --performance by default — omit it and the API auto-selects. Only provide it when:
After submitting a query, the execution progresses through these states:
| State | Meaning | Action |
|-------|---------|--------|
| QUERY_STATE_PENDING | Queued for execution | Wait |
| QUERY_STATE_EXECUTING | Currently running | Wait |
| QUERY_STATE_COMPLETED | Results available | Fetch results |
| QUERY_STATE_FAILED | Execution failed | Check error message; fix SQL and retry |
| QUERY_STATE_CANCELLED | Cancelled by user or system | Re-execute if needed |
| Category | Description |
|----------|-------------|
| canonical | Core blockchain data (blocks, transactions, traces, logs) |
| decoded | ABI-decoded contract data (events and function calls) |
| spell | Dune Spellbook transformations (curated, higher-level tables like dex.trades) |
| community | Community-contributed datasets |
| Type | Description |
|------|-------------|
| dune_table | Core Dune-maintained tables |
| decoded_table | Contract ABI-decoded tables |
| spell | Spellbook transformation tables |
| uploaded_table | User-uploaded CSV/data tables |
| transformation_table | Materialized transformation tables |
| transformation_view | Virtual transformation views |
Parameters let you create reusable queries with variable inputs. Pass them as --param key=value (repeatable). The API auto-detects the type, but parameters support these types: text, number, datetime, enum.
dune query run 12345 --param wallet=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --param days=30 -o json
| Command | Description | Auth |
|---------|-------------|------|
| dune auth | Save API key to config file | No |
| dune query create | Create a new saved query | Yes |
| dune query get <id> | Fetch a saved query's SQL and metadata | Yes |
| dune query update <id> | Update an existing query | Yes |
| dune query archive <id> | Archive a saved query | Yes |
| dune query run <id> | Execute a saved query and wait for results | Yes |
| dune query run-sql | Execute raw DuneSQL directly (no saved query needed) | Yes |
| dune execution results <id> | Fetch results of a previous execution | Yes |
| dune dataset search | Search the Dune dataset catalog | Yes |
| dune dataset search-by-contract | Find decoded tables for a contract address | Yes |
| dune viz create | Create a visualization on a saved query | Yes |
| dune viz get <id> | Fetch visualization details and options | Yes |
| dune viz list | List all visualizations for a query | Yes |
| dune viz update <id> | Update an existing visualization | Yes |
| dune viz delete <id> | Permanently delete a visualization | Yes |
| dune docs search | Search Dune documentation | No |
| dune usage | Show credit and resource usage | Yes |
| dune dashboard create | Create a new dashboard | Yes |
| dune dashboard get <id> | Fetch a dashboard's metadata and widgets | Yes |
| dune dashboard update <id> | Update an existing dashboard | Yes |
| dune dashboard archive <id> | Archive a dashboard | Yes |
# Run a one-off query directly
dune query run-sql --sql "SELECT block_number, block_time FROM ethereum.blocks ORDER BY block_number DESC LIMIT 5" -o json
# 1. Find relevant tables with column schemas
dune dataset search --query "uniswap swaps" --categories decoded --include-schema -o json
# 2. Write and execute SQL using discovered table/column names
dune query run-sql --sql "SELECT * FROM uniswap_v3_ethereum.evt_Swap LIMIT 10" -o json
# 1. Find decoded tables for a specific contract
dune dataset search-by-contract --contract-address 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 --include-schema -o json
# 2. Query the discovered tables
dune query run-sql --sql "SELECT * FROM uniswap_v3_ethereum.evt_Transfer LIMIT 10" -o json
# 1. Create a saved query with parameters
dune query create --name "Top Wallets" --sql "SELECT address, balance FROM ethereum.balances WHERE balance > {{min_balance}} LIMIT {{row_limit}}" -o json
# 2. Run it with parameter values
dune query run <returned-id> --param min_balance=1000 --param row_limit=50 -o json
# 1. Submit without waiting
dune query run 12345 --no-wait --performance large -o json
# Output: {"execution_id": "01ABC...", "state": "QUERY_STATE_PENDING"}
# 2. Check results later
dune execution results 01ABC... -o json
# 1. Create queries for each section
QUERY_ID=$(dune query create --name "Daily Volume" --sql "SELECT date_trunc('day', block_time) AS day, SUM(amount) AS volume FROM trades GROUP BY 1 ORDER BY 1" -o json | jq -r '.query_id')
# 2. Execute to verify data
dune query run $QUERY_ID -o json
# 3. Create visualizations for each query
VIZ_ID=$(dune viz create --query-id $QUERY_ID --name "Daily Volume Chart" --type chart --options '{"globalSeriesType":"line","columnMapping":{"day":"x","volume":"y"}}' -o json | jq -r '.id')
# 4. Assemble the dashboard
dune dashboard create --name "Trading Dashboard" \
--text-widgets '[{"text":"# Trading Dashboard\nDaily volume and metrics"}]' \
--visualization-ids $VIZ_ID -o json
# 1. Fetch current state
dune dashboard get 12345 -o json > dashboard.json
# 2. Modify as needed (add a new visualization widget)
# 3. Pass the complete widget state back
dune dashboard update 12345 \
--visualization-widgets '[{"visualization_id":111},{"visualization_id":222},{"visualization_id":333}]' \
-o json
The following capabilities are available via the Dune MCP server or web UI but not via the CLI:
dune_, or values from DUNE_API_KEY). Redact them with [REDACTED].query create, query update, query archive, viz create, viz update, viz delete, dashboard create, dashboard update, dashboard archive)-o json on every command -- JSON output is more detailed and reliably parseable--temp when creating throwaway queries to avoid cluttering the user's saved queries--api-key on the command line when other users might see the terminal history. Prefer dune auth or the DUNE_API_KEY environment variable.Load the relevant reference when you need detailed command syntax and flags:
| Task | Reference | |------|-----------| | Create, get, update, or archive saved queries | query-management.md | | Execute queries (run, run-sql) or fetch execution results | query-execution.md | | Search datasets or find tables for a contract address | dataset-discovery.md | | Search documentation or check account usage | docs-and-usage.md | | DuneSQL types, functions, common patterns, and pitfalls | dunesql-cheatsheet.md | | Create, get, update, delete, or list visualizations on saved queries | visualization-management.md | | Create, get, update, or archive dashboards | dashboard-management.md | | CLI install, authentication, and version recovery | install-and-recovery.md |
development
Dune Sim API for real-time blockchain wallet and token lookups across EVM and SVM chains. Use when user asks about wallet balances, token prices, NFT holdings, DeFi positions, transaction history, wallet activity, token holders, stablecoins, or any real-time on-chain data for a specific address. Triggers: 'check wallet', 'token balance', 'NFT holdings', 'DeFi positions', 'transaction history', 'token holders', 'token price', 'stablecoin balance', 'wallet activity', or any request involving a blockchain address (0x... or Solana base58).
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------