首页龙虾技能列表 › Dune Analytics API — Dune 分析 API

Dune Analytics API — Dune 分析 API

v2.0.0

Dune Analytics API 工具。

2· 754·3 当前·3 累计
by @lz-web3 (LZ-Web3)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/12
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The skill's files, runtime instructions, and required credential (DUNE_API_KEY) are consistent with a Dune API client for querying, uploading, and managing queries/tables — nothing requested appears unrelated to the stated purpose.
评估建议
This skill appears to do what it claims: it uses your DUNE_API_KEY to query, create/update queries, and upload tables to your Dune account. Before installing or granting the API key: 1) Treat DUNE_API_KEY as sensitive — use a restricted/test Dune account or a key with least-privilege if possible. 2) Be aware the skill can overwrite or delete your Dune tables/queries — only allow it to run write operations after reviewing the SQL and confirming actions. 3) The skill requires pip installing the du...
详细分析 ▾
用途与能力
Name/description match the requested resources: python3 and DUNE_API_KEY are appropriate for a Python-based Dune API client. The scripts and references all relate to discovering tables, executing/updating queries, and uploading data to Dune.
指令范围
SKILL.md and the scripts restrict themselves to Dune API operations and documentation fetches. They read DUNE_API_KEY (declared) and repository reference files. The skill includes operations that modify the user's Dune account (create/update/delete queries/tables, upload/overwrite data); SKILL.md notes best practices (confirm before updating, prefer private queries), but these destructive actions are functionally part of the stated purpose and require user Dune API credentials.
安装机制
There is no automated install spec; SKILL.md instructs the user to pip install dune-client. Pulling a PyPI package is expected for a Python client but users should be aware that an external package is required and will be installed into the environment.
凭证需求
Only one credential is required: DUNE_API_KEY (declared as primary). No other secrets, config paths, or unrelated credentials are requested.
持久化与权限
always:false and no special system-wide privileges are requested. However, with the supplied DUNE_API_KEY the skill can perform destructive operations (upload/overwrite/delete tables, update queries) in the user's Dune account. Autonomous invocation is the platform default; consider requiring explicit user confirmation for write/delete actions.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv2.0.02026/2/21

v2.0.0: Add scripts/ (dune_query.py, dune_discover.py, dune_upload.py), evals/, improved description for better triggering, rewrite usage rules to best practices with explanatory style

● 无害

安装命令 点击复制

官方npx clawhub@latest install dune-analytics-api
镜像加速npx clawhub@latest install dune-analytics-api --registry https://cn.clawhub-mirror.com

技能文档

A skill for querying and analyzing blockchain data via the Dune Analytics API.

Setup

pip install dune-client

Set DUNE_API_KEY via environment variable, .env file, or agent config.

⚠️ Usage Rules

  • 读取 之前 writing SQL — Select 和 读取 relevant reference files (see Reference Selection) 之前 writing 任何 查询. 做 不 skip step.
  • Prefer 私有 Queries — Try is_private=真 第一个. Fall back 到 公开 如果 fails (free plan), 和 notify 用户.
  • Don't 创建 duplicates — Reuse/更新 existing queries unless explicitly asked 到 创建 新的 ones.
  • Confirm 之前 updating — Ask 用户 之前 modifying existing 查询.
  • Track credits — 举报 credits consumed 之后 每个 execution. See 查询-execution.md.

Reference Selection

之前 writing 任何 SQL, 路由 到 正确 reference file(s) based 在...上 task:

Task involves...Read this reference
Finding tables / inspecting schema / discovering protocolstable-discovery.md
Finding decoded tables by contract addresstable-discovery.md
Searching Dune documentation / guides / examplestable-discovery.md
Wallet / address tracking / router identificationwallet-analysis.md
Table selection / common table namescommon-tables.md
SQL performance / complex joins / array opssql-optimization.md
API calls / execution / caching / parametersquery-execution.md
Uploading CSV/NDJSON data to Dunedata-upload.md
If your task spans multiple categories, read all relevant files. Do not guess table names or query patterns — the references contain critical details (e.g., specialized tables, anti-patterns) that are not covered in this overview.

Quick 开始

from dune_client.client import DuneClient
from dune_client.query import QueryBase
import os

client = DuneClient(api_key=os.environ['DUNE_API_KEY'])

# Execute a query result = client.run_query(query=QueryBase(query_id=123456), performance='medium', ping_frequency=5) print(f"Rows: {len(result.result.rows)}")

# Get cached result (no re-execution) result = client.get_latest_result(query_id=123456)

# Get/update SQL sql = client.get_query(123456).sql client.update_query(query_id=123456, query_sql="SELECT ...")

# Upload CSV data (quick, overwrites existing) client.upload_csv( data="col1,col2\nval1,val2", description="My data", table_name="my_table", is_private=True )

# Create table + insert (supports append) client.create_table( namespace="my_user", table_name="my_table", schema=[{"name": "col1", "type": "varchar"}, {"name": "col2", "type": "double"}], is_private=True ) import io client.insert_data( namespace="my_user", table_name="my_table", data=io.BytesIO(b"col1,col2\nabc,1.5"), content_type="text/csv" )

Subscription Tiers

MethodDescriptionPlan
run_queryExecute saved query (supports {{param}})Free
run_sqlExecute SQL directly (no params)Plus

键 Concepts

dex.trades vs dex_aggregator.trades

TableUse CaseVolume
dex.tradesPer-pool analysis⚠️ Inflated ~30% (multi-hop counted multiple times)
dex_aggregator.tradesUser/wallet analysisAccurate
⚠️ For wallet/address analysis, use dex_aggregator.trades with tx_to matching router addresses from dune.lz_web3.dataset_crypto_wallet_router. Do not use labels.all for wallet router lookups. See wallet-analysis.md for full patterns.

Solana has no dex_aggregator_solana.trades. Dedupe by tx_id:

SELECT tx_id, MAX(amount_usd) as amount_usd
FROM dex_solana.trades
GROUP BY tx_id

Data Freshness

LayerDelayExample
Raw< 1 minethereum.transactions, solana.transactions
Decoded15-60 secuniswap_v3_ethereum.evt_Swap
Curated~1 hour+dex.trades, dex_solana.trades
Query previous day's data after UTC 12:00 for completeness.

References

Detailed documentation is organized in the references/ directory:

FileDescription
table-discovery.mdTable discovery: search tables by name, inspect schema/columns, list schemas and uploads
query-execution.mdAPI patterns: execute, update, cache, multi-day fetch, credits tracking, subqueries
common-tables.mdQuick reference of commonly used tables: raw, decoded, curated, community data
sql-optimization.mdSQL optimization: CTE, JOIN strategies, array ops, partition pruning
wallet-analysis.mdWallet tracking: Solana/EVM queries, multi-chain aggregation, fee analysis
data-upload.mdData upload: CSV/NDJSON upload, create table, insert data, manage tables, credits
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务