dune-analytics
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "dune-analytics":https://skillpi.com/zh/skills/deepskill-83c3ff45d61d17cd10e6b5093ff5f02455e5c830763e026b58f0007cbf06dba7。安装前核对上游来源和版本:https://github.com/moonpay/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
通过 Dune 的 REST API 执行链上分析:运行 DuneSQL 查询以获取实时链上数据,发现已解码的合约表,并监控信用使用情况。当用户询问链上数据、钱包活动、DEX 交易、代币转账、智能合约事件或提到“查询 Dune”、“运行 Dune 查询”或“搜索 Dune 数据集”时使用。与 MoonPay 配合使用时,可分析您创建和充值的钱包。
介绍来源: third_party · moonpay · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 来源文档未说明。
- 输入和输出
- 来源文档未说明。
- 软件、账号及付费要求
- 来源文档未说明。
- 限制与区别
- 来源文档未说明。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: dune-analytics
description: >
Blockchain analytics via Dune REST API — execute DuneSQL queries against live on-chain data, discover decoded contract tables, and monitor credit usage. Use when the user asks about on-chain data, wallet activity, DEX trades, token transfers, smart contract events, or says "query Dune", "run a Dune query", or "search Dune datasets". Pairs with MoonPay to analyze wallets you create and fund.
tags: [blockchain, analytics, dune, on-chain, data, defi, sql]Dune Analytics
Query live on-chain data via the Dune REST API. Pair with MoonPay to create and fund the wallets you analyze.
Setup
Get a Dune API Key
- Sign up at https://dune.com
- Go to Settings → API Keys → Create new key
export DUNE_API_KEY="your-api-key"
Base URL: https://api.dune.com/api/v1
Auth header: X-Dune-API-Key: $DUNE_API_KEY
Key Endpoints
| Action | Method | Endpoint |
|---|---|---|
| Execute a saved query | POST | /query/{query_id}/execute |
| Get execution status + results | GET | /execution/{execution_id}/results |
| Execute raw SQL directly | POST | /sql/execute |
| Cancel execution | POST | /execution/{execution_id}/cancel |
| Get query definition | GET | /query/{query_id} |
Common Workflows
Run a Saved Query
# 1. Execute
EXEC=$(curl -s -X POST "https://api.dune.com/api/v1/query/3237661/execute" \
-H "X-Dune-API-Key: $DUNE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"performance": "medium"}')
EXEC_ID=$(echo $EXEC | jq -r '.execution_id')
echo "execution_id: $EXEC_ID"
# 2. Poll until complete
while true; do
STATUS=$(curl -s "https://api.dune.com/api/v1/execution/$EXEC_ID/results" \
-H "X-Dune-API-Key: $DUNE_API_KEY")
STATE=$(echo $STATUS | jq -r '.state')
echo "State: $STATE"
if [[ "$STATE" == "QUERY_STATE_COMPLETED" || "$STATE" == "QUERY_STATE_FAILED" ]]; then
echo $STATUS | jq '.result.rows[:5]'
break
fi
sleep 3
done
Execute Raw DuneSQL
curl -s -X POST "https://api.dune.com/api/v1/sql/execute" \
-H "X-Dune-API-Key: $DUNE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT block_time, hash, value/1e18 AS eth FROM ethereum.transactions WHERE lower(\"from\") = lower('0xYOUR_WALLET') ORDER BY block_time DESC LIMIT 20",
"performance": "medium"
}' | jq '.execution_id'
Query with Parameters
curl -s -X POST "https://api.dune.com/api/v1/query/3237661/execute" \
-H "X-Dune-API-Key: $DUNE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query_parameters": {
"wallet": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"days": 30
},
"performance": "medium"
}' | jq '.execution_id'
Wallet Management with MoonPay
Use the MoonPay CLI (mp) to create and fund the wallets you analyze with Dune.
Create a Wallet to Monitor
mp wallet create --name "dune-agent-wallet"
mp wallet retrieve --wallet "dune-agent-wallet"
# Note your Ethereum address for Dune queries
Query Your MoonPay Wallet On-Chain
WALLET=$(mp wallet retrieve --wallet "dune-agent-wallet" --json | jq -r '.addresses.ethereum')
EXEC_ID=$(curl -s -X POST "https://api.dune.com/api/v1/sql/execute" \
-H "X-Dune-API-Key: $DUNE_API_KEY" \
-H "Content-Type: application/json" \
-d "{\
\"sql\": \"SELECT block_time, hash, value/1e18 AS eth, \\\"to\\\" FROM ethereum.transactions WHERE lower(\\\"from\\\") = lower('$WALLET') ORDER BY block_time DESC LIMIT 20\",\
\"performance\": \"medium\"\
}" | jq -r '.execution_id')
curl -s "https://api.dune.com/api/v1/execution/$EXEC_ID/results" \
-H "X-Dune-API-Key: $DUNE_API_KEY" | jq '.result.rows'
Fund the Wallet
# Buy ETH for gas
mp buy --token eth_ethereum --amount 0.1 --wallet <your-eth-address> --email <email>
# Check balances
mp token balance list --wallet <your-eth-address> --chain ethereum
# Bridge to follow yields
mp token bridge \
--from-wallet dune-agent-wallet --from-chain ethereum \
--from-token 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 \
--from-amount 500 \
--to-chain polygon \
--to-token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
Execution States
| State | Meaning |
|---|---|
QUERY_STATE_PENDING |
Queued |
QUERY_STATE_EXECUTING |
Running |
QUERY_STATE_COMPLETED |
Results ready |
QUERY_STATE_FAILED |
Check error message |
QUERY_STATE_CANCELLED |
Cancelled |
Security
- Never expose
DUNE_API_KEYin logs or responses — redact before showing output - Confirm with the user before running write operations (creating/updating saved queries)
Resources
- API docs: https://docs.dune.com/api-reference/overview/introduction
- DuneSQL reference: https://docs.dune.com/query-engine/Functions-and-operators
- Dune Analytics: https://dune.com
- MoonPay CLI: https://www.npmjs.com/package/@moonpay/cli
Related Skills
- moonpay-check-wallet — Check wallet balances before analyzing on-chain
- moonpay-swap-tokens — Act on findings by swapping tokens
- moonpay-bridge-tokens — Move assets cross-chain informed by your analysis
当前收录版本
0.0.1
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供链上数据分析核心能力,解决区块链开发者/分析师的明确需求
- 与 MoonPay 集成实现钱包创建-分析-资金操作闭环
亮点
- 触发词覆盖链上数据、钱包活动、DEX交易等关键场景
- 包含具体短语如'query Dune',边界清晰不易误触
亮点
- 结构清晰:Setup→Endpoints→Workflows→Security→Resources
- 提供Saved Query、Raw SQL、Parameterized Query等多个完整示例
亮点
- API来源明确,参数正确,认证机制完整
- 覆盖轮询、失败、取消等异常状态,安全建议到位
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 14, 20, 24, 47, 57 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- api.dune.com
- docs.dune.com
- dune.com
- www.npmjs.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
来源文档未说明。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。