Index of every page on this site: llms.txt
All skills
Run it yourself

Expert assistant for querying and analyzing on-chain blockchain data using Dune Analytics. Use whenever the user wants to: analyze blockchain/on-chain data, write SQL for Dune, find wallet activity, track DeFi protocol metrics, analyze NFT trades, monitor token transfers, investigate smart contract events, check token prices on-chain, find top holders, measure DEX volume, or explore any crypto/web3 data. Trigger even if the user doesn't mention "Dune" explicitly — if they want blockchain data insights or on-chain analysis, this skill applies. Also trigger when the user provides a contract address and wants data for it. Enforces credit budget rules (500 warn / 700 block) and free-vs-paid key separation.

Use this Skill: https://skilld.dev/gh/vo1ganin/crypto-claude-skills/dune

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespaid-endpoints.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Dune Direct HTTP API (for bulk downloads with PAID key)

The MCP server handles most workflows. For bulk downloads exceeding MCP result limits, use the direct HTTP API with the PAID key.

When to use direct HTTP instead of MCP

  • Need > 30k rows of results (MCP/server will clamp large limit)
  • Need paginated CSV export
  • Running an ETL script outside Claude
  • Plan-specific enterprise features (queries endpoint on Plus+, data transformations on Enterprise)

Authentication

export DUNE_API_KEY_PAID="dkey_..."

Header: X-DUNE-API-KEY: $DUNE_API_KEY_PAID Or query param: ?api_key=$DUNE_API_KEY_PAID

Always announce in chat before switching to PAID key:

"Switching to PAID key. Reason: exporting ~N MB of results."

Base URL

https://api.dune.com/api/v1

Core endpoints

Execute query

POST /query/{query_id}/execute

Body:

{
  "performance": "medium",
  "query_parameters": { "wallet": "0x...", "days": 30 }
}

Response: { "execution_id": "01HKZJ...", "state": "QUERY_STATE_PENDING" }

Poll execution status

GET /execution/{execution_id}/status

States: QUERY_STATE_PENDING → QUERY_STATE_EXECUTING → QUERY_STATE_COMPLETED (or FAILED). Poll every 5–15s. Hard timeout 30 min.

Get results (JSON)

GET /execution/{execution_id}/results?limit=10000&offset=0

Response:

{
  "result": {
    "rows": [...],
    "metadata": {
      "row_count": 10000,
      "total_row_count": 128400,
      "result_set_bytes": 2450000,
      "total_result_set_bytes": 31_400_000,
      "datapoint_count": 80000,
      "next_offset": 10000,
      "next_uri": "https://api.dune.com/..."
    }
  }
}

Get results (CSV) — for big exports

GET /execution/{execution_id}/results/csv?limit=32000&offset=0

Pagination via response headers:

  • X-Dune-Next-Offset: 32000
  • X-Dune-Next-Uri: https://api.dune.com/...

Get latest query result (cached)

GET /query/{query_id}/results

Returns the most recent execution's results — does NOT trigger a new run. Fast, cheap (still charges datapoints for the fetch, but no execution cost).

Useful query params on results endpoints

Param Purpose
limit Max rows this page (server may clamp)
offset Starting row (0-indexed)
columns=a,b,c Return only these columns — reduces datapoints billed
filters WHERE-like expression
sort_by ORDER BY-like expression
sample_count Uniform sample instead of full (mutually exclusive with limit/offset/filters)
allow_partial_results=true Enable for results > 32 GB

Pagination pattern (CSV, Python)

import requests, os

API = "https://api.dune.com/api/v1"
KEY = os.environ["DUNE_API_KEY_PAID"]
headers = {"X-DUNE-API-KEY": KEY}

exec_id = "01HKZJ..."
url = f"{API}/execution/{exec_id}/results/csv?limit=32000&offset=0"
page = 0

while url:
    r = requests.get(url, headers=headers)
    r.raise_for_status()
    with open(f"page_{page}.csv", "wb") as f:
        f.write(r.content)
    # Pagination via headers on CSV endpoint
    next_uri = r.headers.get("X-Dune-Next-Uri")
    url = next_uri  # None when done
    page += 1

Pagination pattern (JSON, Python)

url = f"{API}/execution/{exec_id}/results?limit=10000&offset=0"
all_rows = []
while url:
    r = requests.get(url, headers=headers).json()
    all_rows.extend(r["result"]["rows"])
    url = r["result"]["metadata"].get("next_uri")

Gotchas

  • Invalid offset → empty response, no error. Always check total_row_count against accumulated rows to detect gaps.
  • Server may clamp limit. If you pass 500000, server might return 30000 with a next_offset of 30000. Trust the server's next-offset.
  • Failed executions are charged. Validate SQL before executeQueryById.
  • 32 GB total result ceiling. Bigger → allow_partial_results=true or narrow the query.
  • Datapoints default cap 250,000 per fetch — explicit pagination needed for larger.

Cost reminder

Every row you download costs credits_per_MB × size_MB (see credits.md). Before starting a paginated export:

  1. Note total_row_count and total_result_set_bytes from the first page
  2. Compute total_MB × plan_rate → total export credits
  3. If > 700 credits → STOP and report to user before continuing

SDKs (alternative)

  • Python: pip install dune-client — has auto-pagination
  • TypeScript: @duneanalytics/client-sdk

Both handle polling and pagination automatically but give less control over per-page cost.

Source

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides an expert interface for querying blockchain data via Dune Analytics, incorporating detailed SQL templates and optimization strategies. It includes robust defensive mechanisms such as credit budget thresholds (500/700 credits) and multi-key rotation to manage costs. The primary security consideration is the risk of indirect prompt injection from processing attacker-controlled blockchain data, which is handled through standard agent execution flows with budget-aware safeguards.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 8100600. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago
Other metadata
compatibility
{
  "tools": [
    "mcp__dune__searchTables",
    "mcp__dune__searchTablesByContractAddress",
    "mcp__dune__createDuneQuery",
    "mcp__dune__executeQueryById",
    "mcp__dune__getExecutionResults",
    "mcp__dune__getDuneQuery",
    "mcp__dune__updateDuneQuery",
    "mcp__dune__generateVisualization",
    "mcp__dune__listBlockchains",
    "mcp__dune__searchDocs",
    "mcp__dune__getTableSize",
    "mcp__dune__getUsage"
  ]
}

README badge

README badge for vo1ganin/crypto-claude-skills/dune