K3 区块链代理:自动化链上数据与 AI 分析 - Openclaw Skills

作者:互联网

2026-03-30

AI教程

什么是 K3 区块链代理?

K3 区块链代理是一个专门设计的工具,旨在弥合复杂的链上数据与可操作见解之间的鸿沟。通过利用 Openclaw Skills,开发人员可以创建复杂的工作流,从智能合约、子图或市场 API 获取数据,使用高级 AI 模型分析该数据,并将格式化的报告发送到 Slack、T@elegrimm 或电子邮件等通信平台。它通过为工作流编排提供对话式界面,简化了构建 DeFi 坚控器、浅包追踪器和自动化交易信号的生命周期。

该技能对于需要坚控协议健康状况、追踪特定浅包变动或生成市场趋势定期报告的团队特别有价值。它与 K3 开发 MCP 直接集成,在自然语言意图与已部署运行的自动化程序之间提供无缝桥梁。无论您是坚控 Uniswap 流动性还是追踪 NFT 地板价,该代理都能简化从发现到交付的整个数据管道。

下载入口:https://github.com/openclaw/skills/tree/main/skills/alexgrankinukr-hash/k3-blockchain-agent

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install k3-blockchain-agent

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 k3-blockchain-agent。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

K3 区块链代理 应用场景

  • 自动坚控 Uniswap 流动性池和 WETH/USDC 成交量更新。
  • 针对特定浅包交易或大鲸鱼动向的实时 T@elegrimm 警报。
  • 通过电子邮件发送的每日定期 DeFi 性能报告和异常检测。
  • 跨多条链坚控智能合约事件和 NFT 地板价波动。
  • 根据预定义的市场状况 AI 分析触发自动化兑换或代币转账。
K3 区块链代理 工作原理
  1. 通过对话请求定义特定的数据目标、区块链网络和交付偏好。
  2. 使用 K3 功能(如读取智能合约、读取市场数据或读取图表)选择最佳数据源。
  3. 创建最小测试工作流,在全面部署前验证数据获取是否返回预期参数。
  4. 使用 generateWorkflow 工具构建包含 AI 分析逻辑和通知触发器的完整工作流。
  5. 部署工作流并执行手动运行,以验证端到端集成和交付链。

K3 区块链代理 配置指南

要使用此技能,您必须确保 K3 开发 MCP 已连接到您的环境。这为 Openclaw Skills 生态系统内的工作流生成和执行提供了必要的工具。

# 验证 K3 MCP 连接并检查可用的数据源集成
listTeamMcpServerIntegrations()

# 搜索现有工作流模板作为起点
findAgentByFunctionality(intent="monitor uniswap pools")

连接后,您可以通过用简洁的语言描述您的要求来开始构建工作流。

K3 区块链代理 数据架构与分类体系

K3 区块链代理通过结构化的元数据分类组织其操作,以确保可靠的执行和报告。

组件 描述
工作流 ID 用于更新和日志的已部署自动化的唯一标识符
触发器配置 定义执行计划 (cron) 或基于事件的触发器 (浅包活动)
数据节点 用于提取数据的 API、GraphQL 或智能合约查询规范
AI 分析提示词 LLM 用于处理获取的数据的自然语言指令
输出渠道 交付目的地的元数据,包括电子邮件、Slack、T@elegrimm 或 Google 表格
name: k3-blockchain-agent
description: >
  Build automated blockchain analysis workflows on K3 — from natural language
  requests to deployed, running automations that fetch on-chain data, analyze it
  with AI, and deliver insights via email, T@elegrimm, or Slack. Use this skill
  whenever the user mentions blockchain workflows, on-chain analytics, DeFi
  monitoring, token tracking, wallet alerts, pool analysis, protocol dashboards,
  NFT tracking, automated trading, smart contract monitoring, or wants to automate
  anything involving blockchain data. Also trigger when the user mentions K3,
  workflow builder, or wants scheduled crypto/DeFi reports. Even if they just say
  "monitor this wallet" or "track this token" — this skill applies.

K3 Blockchain Agent

Transform requests like "Send me daily updates about the WETH/USDC pool on Uniswap" into fully deployed workflows that fetch data, run AI analysis, and deliver reports automatically.

Setup

This skill requires the K3 Development MCP to be connected. The MCP provides tools like generateWorkflow, executeWorkflow, findAgentByFunctionality, and others that let you create and manage blockchain workflows programmatically.

If the K3 MCP isn't connected yet, tell the user they need to add it before proceeding. Once connected, verify by calling listTeamMcpServerIntegrations() — this confirms the connection and shows what data source integrations (TheGraph, CoinGecko, etc.) the user's team has wired up. Every team's integrations will be different — discover what's available rather than assuming.

How Workflow Building Works

The K3 orchestrator is conversational. You describe what you want in plain language, and the orchestrator asks clarifying questions, then builds and deploys the workflow. Your job is to show up with the right information so the conversation is productive.

The loop:

UNDERSTAND → what does the user actually want?
FIND DATA  → how do we get that information into the workflow?
TEST       → does the data actually come back correctly?
BUILD      → give the orchestrator everything it needs
DEPLOY     → launch it and verify it works

Skipping "test" is the most common mistake — you end up with a deployed workflow that returns empty data.

Step 1: Understand the Request

When a user asks for a workflow, figure out these parameters. Ask if anything is unclear — don't guess on addresses or emails.

Parameter What to find out Examples
Data target What blockchain data do they need? pool metrics, token price, wallet balance, NFT data
Protocol Which DeFi protocol or chain feature? Uniswap, Aave, SushiSwap, native transfers
Chain Which blockchain? Ethereum, Arbitrum, Polygon, Base, Stellar
Schedule How often / what triggers it? daily, hourly, on-demand, on wallet activity, on contract event, T@elegrimm ch@tbot
Analysis What kind of insights? performance summary, anomaly alerts, trend report, trade signal
Delivery How should results arrive? email, T@elegrimm, Slack, Google Sheets
Actions Should the workflow do anything? execute a swap, transfer tokens, write to a contract
Specifics Any addresses or IDs? pool address, token contract, wallet address

If the user is new to DeFi, briefly explain relevant concepts as you go (what TVL means, what a liquidity pool is, etc.). Don't assume they know the jargon.

Step 2: Find the Right Data

This is the critical step. K3 has many ways to get data into a workflow, and you need to figure out which approach works for the user's specific request.

K3 data functions

These are the built-in functions for getting data into a workflow. Read references/node-types.md for full details on each.

Function What it does
Read API Call any REST/GraphQL API — the most flexible option
Read Smart Contract Query any smart contract directly on-chain
Read Market Data Get token prices, volumes, market metrics
Read Wallet Wallet balances, transfers, transaction history
Read NFT NFT collections, floor prices, traits, holders
Read Graph Query TheGraph subgraphs with custom GraphQL
Read Deployment Pull output from your own deployed code on K3
AI Web Scraper Extract structured data from any web page
AI Agent with tools AI that dynamically decides what to fetch

How to find the data you need

The goal is to figure out the best way to get the specific data the user wants. Think of it as problem-solving — there are multiple valid approaches and you should explore them:

  1. Check what the team already has — call listTeamMcpServerIntegrations() to see what MCP data sources are connected. If they have TheGraph, CoinGecko, or other integrations set up, those are the easiest path.

  2. Search for existing templates — call findAgentByFunctionality() with the user's intent. If someone already built a similar workflow, use it as a starting point.

  3. Think about which K3 function fits:

    • Need on-chain contract data? → Read Smart Contract can query it directly
    • Need token prices or market data? → Read Market Data has it built in
    • Need complex DeFi metrics (TVL, volume, fees)? → Read Graph with the right subgraph, or Read API to a protocol's analytics endpoint
    • Need wallet info? → Read Wallet for balances and history
    • Need NFT data? → Read NFT for collections and metadata
    • Need data from any public API? → Read API can call anything
    • Need to scrape a website? → AI Web Scraper can extract and structure it
  4. Search the web for the right endpoint. If you need a specific protocol's data, look up {protocol name} API, {protocol name} subgraph, or {protocol name} GraphQL endpoint. Many protocols publish public APIs and subgraphs.

  5. Ask the user — they may know the API endpoint, have an API key, or know exactly which smart contract to read from.

The key insight: there's rarely just one way to get the data. A Uniswap pool's TVL could come from Read Graph (subgraph query), Read API (calling an analytics endpoint), or even Read Smart Contract (reading the pool contract directly). Pick whichever is most reliable and gives you the data format you need.

Test before you build

Before constructing the full workflow, verify the data source actually returns what you expect:

1. Create a minimal test workflow with generateWorkflow()
   — just a trigger + one data fetch step, nothing else
2. Deploy and run it with executeWorkflow()
3. Check the output with getWorkflowRunById() (set includeWorkflowData: true)
4. If the data looks right → proceed to full build
5. If empty or wrong → try a different approach and test again

This saves a lot of debugging later. A deployed workflow with bad data is worse than no workflow.

Step 3: Build the Workflow

Now give the K3 orchestrator everything it needs. Use generateWorkflow() with a detailed prompt that includes:

  • Trigger type and schedule (e.g., "runs daily" or "triggers on wallet activity")
  • Data source and how to query it (e.g., "use Read Graph to query pool X" or "use Read Smart Contract to get the pair's reserves")
  • What the AI should analyze (e.g., "highlight TVL changes over 5%")
  • Any actions to take (e.g., "execute a swap on Uniswap if condition is met")
  • How to deliver results (e.g., "send T@elegrimm alert" or "email the report")
  • Any MCP integration IDs the orchestrator needs (from team integrations)

Set deployWorkflow: false on the first call so you can review before deploying.

The orchestrator will likely ask follow-up questions — answer them using editGeneratedWorkflow() with the same generatedWorkflowId. This back-and-forth is normal; expect 2-4 rounds.

Once the configuration looks correct, call editGeneratedWorkflow() one final time with deployWorkflow: true.

For the full list of available functions, triggers, AI models, and output options, read references/node-types.md.

Step 4: Deploy and Verify

After deploying:

  1. Run it manually with executeWorkflow() to trigger an immediate test
  2. Check the run with getWorkflowRuns() or getWorkflowRunById()
  3. Verify the full chain: Did data fetch? Did AI analyze? Did notification send?

If something failed, use editGeneratedWorkflow() to fix it — you don't need to start over. See references/troubleshooting.md for common issues.

Tell the user what happened: "Your workflow is live and will run daily. I just ran a test — here's what the first report looks like: [summary]."

K3 MCP Tool Reference

Tool What it does
generateWorkflow Start building a workflow from natural language
editGeneratedWorkflow Continue the conversation with the orchestrator
executeWorkflow Run a workflow manually
getWorkflowById Get workflow details and config
getWorkflowRuns List execution history
getWorkflowRunById Get a specific run's details and output
updateWorkflow Pause/unpause a scheduled workflow
findAgentByFunctionality Search for existing workflow templates
listAgentTemplates Browse all available templates
getAgentTemplateById Get details on a specific template
listTeamMcpServerIntegrations See what data sources the team has connected
listMcpServerIntegrations Browse all available MCP data sources

Important Rules

  1. Always test data sources before building the full workflow. A quick test fetch saves a lot of debugging time.
  2. The orchestrator is conversational — expect multiple rounds of back-and-forth via editGeneratedWorkflow. That's how it's designed to work.
  3. Ask the user for anything you can't look up — never guess email addresses, T@elegrimm handles, or wallet addresses.
  4. Discover team integrations — call listTeamMcpServerIntegrations() to see what's available. Every team is different.
  5. Verify workflows work before telling the user it's done. Run it, check the output, confirm delivery.
  6. Be mindful of context — don't call many K3 MCP tools at once or dump large responses. Fetch what you need, check it, move on.
  7. Use web search to find API endpoints, subgraph URLs, and smart contract addresses when you don't know them. The web is your research tool.

Going Deeper

  • references/node-types.md — All trigger types, data functions, AI functions, DeFi/trading actions, and notification options
  • references/data-sources.md — How to discover and evaluate data sources for different blockchain data needs
  • references/workflow-patterns.md — Common workflow architectures and when to use each one
  • references/troubleshooting.md — Diagnosing and fixing common workflow issues