{
  "schemaVersion": "1.0",
  "item": {
    "slug": "on-chain-analyitcs",
    "name": "on-chain analytics for evm contract",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/Ramitphi/on-chain-analyitcs",
    "canonicalUrl": "https://clawhub.ai/Ramitphi/on-chain-analyitcs",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/on-chain-analyitcs",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=on-chain-analyitcs",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/on-chain-analyitcs"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/on-chain-analyitcs",
    "agentPageUrl": "https://openagent3.xyz/skills/on-chain-analyitcs/agent",
    "manifestUrl": "https://openagent3.xyz/skills/on-chain-analyitcs/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/on-chain-analyitcs/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "On-Chain Analysis Skill",
        "body": "Analyze any verified EVM smart contract by pasting its address. The skill runs a full analysis pipeline:\n\nABI Fetching — Retrieves the verified ABI from Etherscan (or accepts a manual ABI)\nUsage Discovery — Queries Dune to find which methods are most called, by whom, and with what value\nDecoded Data Tables — AI generates DuneSQL queries using decode_evm_function_call() to build raw decoded data tables on Dune\nAnalytics Generation — A second AI pass generates 6-10 visualization queries (stats, time series, bar charts, pie charts) from the decoded tables\nExecution — All queries are executed on Dune and results returned as structured JSON"
      },
      {
        "title": "When to Use",
        "body": "User asks \"analyze this contract\" or \"what does this contract do\"\nUser wants on-chain analytics, usage stats, or dashboards for a smart contract\nUser provides a contract address and wants to understand its activity\nUser asks about transaction patterns, caller behavior, or function usage\nUser wants to compare function usage or identify top callers\nUser asks \"who uses this contract\" or \"how popular is this contract\""
      },
      {
        "title": "How to Call",
        "body": "POST https://esraarlhpxraucslsdle.supabase.co/functions/v1/onchain-analysis"
      },
      {
        "title": "Request Body",
        "body": "{\n  \"contractAddress\": \"0x00000000009726632680FB29d3F7A9734E3010E2\",\n  \"chain\": \"base\",\n  \"abi\": \"(optional — raw ABI JSON string if contract is unverified)\"\n}"
      },
      {
        "title": "Parameters",
        "body": "FieldTypeRequiredDescriptioncontractAddressstringYesThe EVM contract address (0x-prefixed, 42 chars including 0x)chainstringYesOne of: ethereum, polygon, bsc, arbitrum, optimism, base, avalancheabistring/arrayNoManual ABI if contract is not verified on Etherscan"
      },
      {
        "title": "Supported Chains",
        "body": "ChainExample Explorerethereumetherscan.iopolygonpolygonscan.combscbscscan.comarbitrumarbiscan.iooptimismoptimistic.etherscan.iobasebasescan.orgavalanchesnowtrace.io"
      },
      {
        "title": "Response",
        "body": "{\n  \"contractAddress\": \"0x...\",\n  \"chain\": \"base\",\n  \"tldr\": \"## TLDR\\n\\n- **Key insight 1** ...\\n- **Key insight 2** ...\",\n  \"abiSummary\": \"Events (5):\\n  - Transfer(...)\\nWrite Functions (8):\\n  - swap(...)\",\n  \"dashboardUrl\": \"https://onchainwizard.ai/shared/abc123-uuid\",\n  \"topMethods\": [\n    {\n      \"function_name\": \"swap\",\n      \"call_count\": 142000,\n      \"unique_callers\": 5200,\n      \"total_eth\": 1234.5678\n    }\n  ],\n  \"rawTables\": [\n    {\n      \"function_name\": \"swap\",\n      \"query_id\": 12345,\n      \"dune_url\": \"https://dune.com/queries/12345\",\n      \"execution_state\": \"QUERY_STATE_COMPLETED\"\n    }\n  ],\n  \"queryResults\": [\n    {\n      \"id\": \"total_swaps\",\n      \"title\": \"Total Swaps\",\n      \"type\": \"stat\",\n      \"sql\": \"SELECT COUNT(*) AS value FROM query_12345\",\n      \"rows\": [{ \"value\": 142000 }]\n    },\n    {\n      \"id\": \"daily_swaps\",\n      \"title\": \"Daily Swap Volume\",\n      \"type\": \"timeseries\",\n      \"sql\": \"SELECT DATE_TRUNC('day', block_time) AS date, COUNT(*) AS value FROM query_12345 GROUP BY 1 ORDER BY 1\",\n      \"rows\": [\n        { \"date\": \"2026-01-01\", \"value\": 500 },\n        { \"date\": \"2026-01-02\", \"value\": 620 }\n      ]\n    }\n  ]\n}"
      },
      {
        "title": "Query Result Types",
        "body": "TypeDescriptionKey FieldsstatSingle metricrows[0].value — the headline numbertimeseriesData over timerows[].date, rows[].valuebarCategory comparisonrows[].label, rows[].valuepieDistributionrows[].label, rows[].valuescatterCorrelationrows[].x, rows[].y"
      },
      {
        "title": "How to Present Results",
        "body": "Start with the TLDR — display it as markdown to give the user a quick overview\nDashboard link — always include the dashboardUrl so the user can view the full interactive dashboard: \"📊 View full dashboard\"\nStat queries (type: \"stat\") — show as headline metrics (e.g., \"Total Swaps: 142,000\")\nTime series (type: \"timeseries\") — describe trends (\"Daily swaps peaked at X on date Y\")\nBar/Pie charts (type: \"bar\" / type: \"pie\") — summarize distributions (\"Top 5 callers account for 60% of swaps\")\nLink to Dune — provide dune_url links for raw tables so users can explore further\nFailed queries — if a query has error instead of rows, mention it briefly but don't block the rest"
      },
      {
        "title": "Basic: \"Analyze this contract\"",
        "body": "User: Analyze 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D on ethereum\nAction: Call the skill with { \"contractAddress\": \"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\", \"chain\": \"ethereum\" }\nPresent: TLDR → Stats → Trends → Distributions → Dune links"
      },
      {
        "title": "Missing chain",
        "body": "User: What does 0xABC...DEF do?\nAction: Ask which chain before calling. \"Which chain is this contract on? I support Ethereum, Polygon, BSC, Arbitrum, Optimism, Base, and Avalanche.\""
      },
      {
        "title": "Unverified contract",
        "body": "User: Analyze 0xABC...DEF on base\nAPI returns: \"Could not fetch ABI\"\nAction: Ask user for the ABI JSON, then retry with { \"contractAddress\": \"...\", \"chain\": \"base\", \"abi\": \"<user-provided ABI>\" }"
      },
      {
        "title": "Follow-ups after analysis",
        "body": "\"Tell me more about the top callers\" → Expand on bar/pie data from queryResults\n\"What does the swap function do?\" → Use abiSummary to explain\n\"Can I see the raw data?\" → Link to rawTables[].dune_url"
      },
      {
        "title": "Important Notes",
        "body": "The analysis takes 2-5 minutes due to Dune query execution and materialization — set user expectations\nOnly works for contracts with verified ABIs (unless a manual ABI is provided)\nThe AI selects the most interesting functions automatically based on usage data\nRaw decoded tables are saved as named queries on Dune for future reference\nQuery results may be empty if the contract has very little on-chain activity"
      },
      {
        "title": "Error Handling",
        "body": "ErrorMeaningRecommended Action\"Could not fetch ABI\"Contract is not verifiedAsk user for the ABI\"No write functions found\"No state-changing functionsInform user; contract may be read-only or a proxy\"Unsupported chain\"Chain not in supported listList supported chains and ask again\"Missing required API keys\"Server-side config issueReport as a service errorTimeout / no responseAnalysis exceeded time limitSuggest retrying; Dune may be under load"
      }
    ],
    "body": "On-Chain Analysis Skill\n\nAnalyze any verified EVM smart contract by pasting its address. The skill runs a full analysis pipeline:\n\nABI Fetching — Retrieves the verified ABI from Etherscan (or accepts a manual ABI)\nUsage Discovery — Queries Dune to find which methods are most called, by whom, and with what value\nDecoded Data Tables — AI generates DuneSQL queries using decode_evm_function_call() to build raw decoded data tables on Dune\nAnalytics Generation — A second AI pass generates 6-10 visualization queries (stats, time series, bar charts, pie charts) from the decoded tables\nExecution — All queries are executed on Dune and results returned as structured JSON\nWhen to Use\nUser asks \"analyze this contract\" or \"what does this contract do\"\nUser wants on-chain analytics, usage stats, or dashboards for a smart contract\nUser provides a contract address and wants to understand its activity\nUser asks about transaction patterns, caller behavior, or function usage\nUser wants to compare function usage or identify top callers\nUser asks \"who uses this contract\" or \"how popular is this contract\"\nHow to Call\n\nPOST https://esraarlhpxraucslsdle.supabase.co/functions/v1/onchain-analysis\n\nRequest Body\n{\n  \"contractAddress\": \"0x00000000009726632680FB29d3F7A9734E3010E2\",\n  \"chain\": \"base\",\n  \"abi\": \"(optional — raw ABI JSON string if contract is unverified)\"\n}\n\nParameters\nField\tType\tRequired\tDescription\ncontractAddress\tstring\tYes\tThe EVM contract address (0x-prefixed, 42 chars including 0x)\nchain\tstring\tYes\tOne of: ethereum, polygon, bsc, arbitrum, optimism, base, avalanche\nabi\tstring/array\tNo\tManual ABI if contract is not verified on Etherscan\nSupported Chains\nChain\tExample Explorer\nethereum\tetherscan.io\npolygon\tpolygonscan.com\nbsc\tbscscan.com\narbitrum\tarbiscan.io\noptimism\toptimistic.etherscan.io\nbase\tbasescan.org\navalanche\tsnowtrace.io\nResponse\n{\n  \"contractAddress\": \"0x...\",\n  \"chain\": \"base\",\n  \"tldr\": \"## TLDR\\n\\n- **Key insight 1** ...\\n- **Key insight 2** ...\",\n  \"abiSummary\": \"Events (5):\\n  - Transfer(...)\\nWrite Functions (8):\\n  - swap(...)\",\n  \"dashboardUrl\": \"https://onchainwizard.ai/shared/abc123-uuid\",\n  \"topMethods\": [\n    {\n      \"function_name\": \"swap\",\n      \"call_count\": 142000,\n      \"unique_callers\": 5200,\n      \"total_eth\": 1234.5678\n    }\n  ],\n  \"rawTables\": [\n    {\n      \"function_name\": \"swap\",\n      \"query_id\": 12345,\n      \"dune_url\": \"https://dune.com/queries/12345\",\n      \"execution_state\": \"QUERY_STATE_COMPLETED\"\n    }\n  ],\n  \"queryResults\": [\n    {\n      \"id\": \"total_swaps\",\n      \"title\": \"Total Swaps\",\n      \"type\": \"stat\",\n      \"sql\": \"SELECT COUNT(*) AS value FROM query_12345\",\n      \"rows\": [{ \"value\": 142000 }]\n    },\n    {\n      \"id\": \"daily_swaps\",\n      \"title\": \"Daily Swap Volume\",\n      \"type\": \"timeseries\",\n      \"sql\": \"SELECT DATE_TRUNC('day', block_time) AS date, COUNT(*) AS value FROM query_12345 GROUP BY 1 ORDER BY 1\",\n      \"rows\": [\n        { \"date\": \"2026-01-01\", \"value\": 500 },\n        { \"date\": \"2026-01-02\", \"value\": 620 }\n      ]\n    }\n  ]\n}\n\nQuery Result Types\nType\tDescription\tKey Fields\nstat\tSingle metric\trows[0].value — the headline number\ntimeseries\tData over time\trows[].date, rows[].value\nbar\tCategory comparison\trows[].label, rows[].value\npie\tDistribution\trows[].label, rows[].value\nscatter\tCorrelation\trows[].x, rows[].y\nHow to Present Results\nStart with the TLDR — display it as markdown to give the user a quick overview\nDashboard link — always include the dashboardUrl so the user can view the full interactive dashboard: \"📊 View full dashboard\"\nStat queries (type: \"stat\") — show as headline metrics (e.g., \"Total Swaps: 142,000\")\nTime series (type: \"timeseries\") — describe trends (\"Daily swaps peaked at X on date Y\")\nBar/Pie charts (type: \"bar\" / type: \"pie\") — summarize distributions (\"Top 5 callers account for 60% of swaps\")\nLink to Dune — provide dune_url links for raw tables so users can explore further\nFailed queries — if a query has error instead of rows, mention it briefly but don't block the rest\nExample Conversations\nBasic: \"Analyze this contract\"\n\nUser: Analyze 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D on ethereum\nAction: Call the skill with { \"contractAddress\": \"0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\", \"chain\": \"ethereum\" }\nPresent: TLDR → Stats → Trends → Distributions → Dune links\n\nMissing chain\n\nUser: What does 0xABC...DEF do?\nAction: Ask which chain before calling. \"Which chain is this contract on? I support Ethereum, Polygon, BSC, Arbitrum, Optimism, Base, and Avalanche.\"\n\nUnverified contract\n\nUser: Analyze 0xABC...DEF on base\nAPI returns: \"Could not fetch ABI\"\nAction: Ask user for the ABI JSON, then retry with { \"contractAddress\": \"...\", \"chain\": \"base\", \"abi\": \"<user-provided ABI>\" }\n\nFollow-ups after analysis\n\"Tell me more about the top callers\" → Expand on bar/pie data from queryResults\n\"What does the swap function do?\" → Use abiSummary to explain\n\"Can I see the raw data?\" → Link to rawTables[].dune_url\nImportant Notes\nThe analysis takes 2-5 minutes due to Dune query execution and materialization — set user expectations\nOnly works for contracts with verified ABIs (unless a manual ABI is provided)\nThe AI selects the most interesting functions automatically based on usage data\nRaw decoded tables are saved as named queries on Dune for future reference\nQuery results may be empty if the contract has very little on-chain activity\nError Handling\nError\tMeaning\tRecommended Action\n\"Could not fetch ABI\"\tContract is not verified\tAsk user for the ABI\n\"No write functions found\"\tNo state-changing functions\tInform user; contract may be read-only or a proxy\n\"Unsupported chain\"\tChain not in supported list\tList supported chains and ask again\n\"Missing required API keys\"\tServer-side config issue\tReport as a service error\nTimeout / no response\tAnalysis exceeded time limit\tSuggest retrying; Dune may be under load"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Ramitphi/on-chain-analyitcs",
    "publisherUrl": "https://clawhub.ai/Ramitphi/on-chain-analyitcs",
    "owner": "Ramitphi",
    "version": "1.0.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/on-chain-analyitcs",
    "downloadUrl": "https://openagent3.xyz/downloads/on-chain-analyitcs",
    "agentUrl": "https://openagent3.xyz/skills/on-chain-analyitcs/agent",
    "manifestUrl": "https://openagent3.xyz/skills/on-chain-analyitcs/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/on-chain-analyitcs/agent.md"
  }
}