dune-analytics

Blockchain analysis via the Dune REST API: run DuneSQL queries against real‑time on‑chain data, discover decoded contract tables, and monitor credit usage. Use when users ask about on‑chain data, wallet activity, DEX trades, token transfers, smart contract events, or mention “query Dune,” “run Dune query,” or “search Dune datasets.” When used with MoonPay, can analyze wallets you created and funded.

Last repository push
GitHub Stars
112
Forks
31
Issues / PRs
4

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "dune-analytics" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-83c3ff45d61d17cd10e6b5093ff5f02455e5c830763e026b58f0007cbf06dba7. Verify the upstream source and version against https://github.com/moonpay/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Blockchain analysis via the Dune REST API: run DuneSQL queries against real‑time on‑chain data, discover decoded contract tables, and monitor credit usage. Use when users ask about on‑chain data, wallet activity, DEX trades, token transfers, smart contract events, or mention “query Dune,” “run Dune query,” or “search Dune datasets.” When used with MoonPay, can analyze wallets you created and funded.

0 Downloads

Introduction source: third_party · moonpay · 0.0.1 Reference

SkillPi interpretation

Tasks
Query live on-chain data via the Dune REST API. Pair with MoonPay to create and fund the wallets you analyze.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
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

  1. Sign up at https://dune.com
  2. 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_KEY in logs or responses — redact before showing output
  • Confirm with the user before running write operations (creating/updating saved queries)

Resources

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

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供链上数据分析核心能力,解决区块链开发者/分析师的明确需求
  • 与 MoonPay 集成实现钱包创建-分析-资金操作闭环
Trigger Precision90/100

Highlights

  • 触发词覆盖链上数据、钱包活动、DEX交易等关键场景
  • 包含具体短语如'query Dune',边界清晰不易误触
Structure and Standards95/100

Highlights

  • 结构清晰:Setup→Endpoints→Workflows→Security→Resources
  • 提供Saved Query、Raw SQL、Parameterized Query等多个完整示例
Execution Reliability90/100

Highlights

  • API来源明确,参数正确,认证机制完整
  • 覆盖轮询、失败、取消等异常状态,安全建议到位
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • api.dune.com
  • docs.dune.com
  • dune.com
  • www.npmjs.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.