Clawearn:预测市场自动交易 - Openclaw Skills

作者:互联网

2026-03-30

AI教程

什么是 Clawearn?

Clawearn 是一款精密的模块化交易基础设施,专为 Openclaw Skills 生态系统内的 AI 智能体设计。它在智能体推理与区块链执行之间建立了稳健的桥梁,使开发者能够为其机器人配备导航预测市场(如 Polymarket)、处理 Arbitrum 网络上的 USDC 交易以及自主执行复杂交易策略的能力。

该技能侧重于可扩展性和安全性,提供了一系列用于钱包生成、市场发现和订单管理的工具。通过将 Clawearn 集成到您的工作流程中,您可以让 AI 智能体作为独立的金融参与者运行,能够根据实时数据监控仓位并实时调整风险敞口。

下载入口:https://github.com/openclaw/skills/tree/main/skills/stonega/clawearn

安装与下载

1. ClawHub CLI

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

npx clawhub@latest install clawearn

2. 手动安装

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

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

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

3. 提示词安装

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

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

Clawearn 应用场景

  • 基于实时 AI 市场分析在 Polymarket 上执行自动交易。
  • 管理多个智能体身份下的加密钱包和 USDC 余额。
  • 在 Arbitrum 网络上自动化去中心化金融交易。
  • 无需人工干预即可监控预测市场仓位并查询余额。
  • 实施具有预设限制和警报的自动化风险管理策略。
Clawearn 工作原理
  1. Openclaw Skills 智能体初始化 Clawearn 环境并建立与 Arbitrum 网络连接。
  2. 通过 CLI 生成或导入安全钱包,用于处理交易签名和资产存储。
  3. 智能体利用搜索命令根据特定查询或市场 ID 识别相关的预测市场。
  4. 利用交易模块,智能体直接与市场智能合约交互,下达买入或卖出订单。
  5. 系统持续监控订单状态和投资组合风险,以确保符合定义的风险限制。

Clawearn 配置指南

安装 CLI 并使用以下命令初始化环境:

# 安装 Clawearn CLI
curl -fsSL https://clawearn.xyz/install.sh | bash

# 创建必要的技能目录结构
mkdir -p ~/.openclaw/skills/clawearn

# 获取并安装核心技能定义
curl -s https://clawearn.xyz/skills/SKILL.md > ~/.openclaw/skills/clawearn/SKILL.md

# 初始化您的第一个智能体钱包以开始交易
clawearn wallet create

Clawearn 数据架构与分类体系

Clawearn 使用结构化目录和 JSON 架构组织其配置和运行数据,以确保与各种 Openclaw Skills 的兼容性。

组件 路径 用途
全局配置 ~/.clawearn/config.json 存储已启用的市场、默认网络和风险限制参数。
核心技能 ~/.openclaw/skills/clawearn/core/ 包含钱包管理和安全协议的逻辑。
市场驱动器 ~/.openclaw/skills/clawearn/markets/ 针对 Polymarket 等特定平台的模块化驱动器。
状态追踪 HEARTBEAT.md 定义智能体的日常维护任务和健康检查。
name: clawearn
version: 1.1.0
description: Modular prediction market trading platform for OpenClaw bots. Trade on Polymarket, manage wallets, transfer USDC, and automate trading strategies.
homepage: https://clawearn.xyz
documentation: https://docs.clawearn.xyz
repository: https://github.com/stonega/moltearn
support: https://discord.gg/clawearn
metadata: 
  category: trading
  type: prediction-markets
  platforms: ["polymarket"]
  features: ["wallet-management", "market-trading", "usdc-transfers", "multi-market", "modular"]
  requires: ["bun", "ethers.js"]

Clawearn - Modular Trading Platform for OpenClaw ??

Trade prediction markets directly from your OpenClaw bot.

Clawearn enables your AI agent to:

  • ?? Trade on Polymarket prediction markets
  • ?? Create and manage crypto wallets
  • ?? Send USDC to any Ethereum address on Arbitrum
  • ?? Monitor balances and positions across markets
  • ?? Execute trading strategies autonomously

Quick Start (3 steps)

Step 1: Install clawearn CLI

curl -fsSL https://clawearn.xyz/install.sh | bash
# or: bun link (if in repo)

Step 2: Create your first wallet

clawearn wallet create

You'll see your wallet address. Save it — you'll need to fund it next.

Step 3: Fund your wallet and start trading

Option A: Send USDC from another wallet

clawearn wallet send --to YOUR_AGENT_ADDRESS --amount 100

Option B: Bridge USDC to Arbitrum yourself

  • Send USDC to Arbitrum network
  • Send to the address from clawearn wallet show

Then search for markets:

clawearn polymarket market search --query "bitcoin price 2025"

Installation for OpenClaw Bots

Install all skill files

# Create skill directory
mkdir -p ~/.openclaw/skills/clawearn

# Install main files
curl -s https://clawearn.xyz/skills/SKILL.md > ~/.openclaw/skills/clawearn/SKILL.md
curl -s https://clawearn.xyz/skills/HEARTBEAT.md > ~/.openclaw/skills/clawearn/HEARTBEAT.md

# Install core skills
mkdir -p ~/.openclaw/skills/clawearn/core/{wallet,security}
curl -s https://clawearn.xyz/skills/core/wallet/SKILL.md > ~/.openclaw/skills/clawearn/core/wallet/SKILL.md
curl -s https://clawearn.xyz/skills/core/security/SKILL.md > ~/.openclaw/skills/clawearn/core/security/SKILL.md

# Install market skills
mkdir -p ~/.openclaw/skills/clawearn/markets/polymarket
curl -s https://clawearn.xyz/skills/markets/polymarket/SKILL.md > ~/.openclaw/skills/clawearn/markets/polymarket/SKILL.md
curl -s https://clawearn.xyz/skills/markets/polymarket/HEARTBEAT.md > ~/.openclaw/skills/clawearn/markets/polymarket/HEARTBEAT.md

Supported Markets

Market Status Features Installation
Polymarket ? Production Full trading, order management, market discovery See above

Core Commands

Wallet Management

# Create a new wallet
clawearn wallet create

# Show your wallet address
clawearn wallet show

# Send USDC to another address (on Arbitrum)
clawearn wallet send --to 0x... --amount 100

Polymarket Trading

# Search for markets
clawearn polymarket market search --query "bitcoin price 2025"

# Get market details
clawearn polymarket market info --market-id MARKET_ID

# Check your balance
clawearn polymarket balance check

# Place a buy order
clawearn polymarket order buy --token-id TOKEN_ID --price 0.50 --size 10

# View open orders
clawearn polymarket order list-open

# Cancel an order
clawearn polymarket order cancel --order-id ORDER_ID

Configuration

Create an optional config file to track settings:

~/.clawearn/config.json (optional)

{
  "version": "1.1.0",
  "enabled_markets": ["polymarket"],
  "default_network": "arbitrum",
  "wallet": {
    "network": "arbitrum",
    "auto_fund_threshold": 50
  },
  "trading": {
    "signature_type": 0,
    "default_slippage_pct": 0.5
  },
  "risk_limits": {
    "max_position_size_pct": 20,
    "max_total_exposure_pct": 50,
    "min_balance_alert": 10,
    "daily_loss_limit": 100
  }
}

Quick Reference

Check installed markets

ls ~/.clawearn/skills/markets/

Update all skills

# Update core
curl -s http://localhost:3000/skills/SKILL.md > ~/.clawearn/skills/SKILL.md

# Update each enabled market
for market in $(cat ~/.clawearn/config.json | grep -o '"polymarket"'); do
  curl -s http://localhost:3000/skills/markets/$market/SKILL.md > ~/.clawearn/skills/markets/$market/SKILL.md
done

Add a new market

# 1. Install the skill files
mkdir -p ~/.clawearn/skills/markets/NEW_MARKET
curl -s http://localhost:3000/skills/markets/NEW_MARKET/SKILL.md > ~/.clawearn/skills/markets/NEW_MARKET/SKILL.md

# 2. Update your config.json to add "NEW_MARKET" to enabled_markets

# 3. Set up credentials following the market's SETUP.md

Security Best Practices

?? CRITICAL:

  • Read core/SECURITY.md before trading
  • Never share private keys
  • Store credentials securely
  • Use separate wallets for different markets
  • Enable 2FA where available

Getting Help

  • Core wallet issues: See core/WALLET.md
  • Security questions: See core/SECURITY.md
  • Market-specific help: See markets/{market}/README.md
  • General trading: See HEARTBEAT.md for routine checks

Check for updates: Re-fetch this file anytime to see newly supported markets!

curl -s https://clawearn.xyz/skills/SKILL.md | grep '^version:'

Ready to start? Install the core skills, choose your markets, and begin trading! ??