Autonomous DeFi trading agent for BNB Chain with multi-strategy engine, network switching, and reinforced learning.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install clawtrade-bnb或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install clawtrade-bnb⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/clawtrade-bnb/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: clawtrade-bnb version: 1.1.0 description: Autonomous DeFi trading agent for BNB Chain with multi-strategy engine, network switching, and reinforced learning. keywords: trading, defi, autonomous-agent, multi-strategy, reinforced-learning, bnb-chain ---
Production-ready autonomous trading agent for BNB Chain testnet & mainnet. Features 3 intelligent strategies, real-time performance analytics, on-chain event logging, and self-improving reinforced learning.
clawhub install clawtrade-bnb
cd ~/.openclaw/workspace/skills/clawtrade-bnb
npm install
# Copy example config
cp config.deployed.json config.live.json
# Edit with your settings
nano config.live.json
# Set RPC endpoint, contract addresses, wallet
# Option A: Environment variable (recommended)
export PRIVATE_KEY="your_testnet_private_key"
# Option B: .env file (git-ignored)
echo "PRIVATE_KEY=your_key" >> .env
# NOTE: Never commit private keys!
# Test connection and contracts
node agent-cli.js network status
# Check wallet balance
npm run verify
# Terminal 1: Run strategy engine (60-second cycles)
node strategy-scheduler.js
# Terminal 2: Real-time dashboard
npm run dev:dashboard
# → Open http://localhost:5173
# Terminal 3: Control panel
node agent-cli.js
# Example commands:
node agent-cli.js network testnet # Switch network
node agent-cli.js perf summary # See performance
node agent-cli.js learn now # Optimize strategies
DeFi Strategy Engine
├─ Compound Yield Strategy
│ └─ Harvest when pending > $25 → Re-deposit
├─ Rebalance Strategy
│ └─ Move 20% from low-APR to high-APR vault
└─ Dynamic Harvest Strategy
└─ Harvest only if pending > 2x gas cost
↓ (runs every 60 seconds)
Strategy Scheduler
├─ Read vault APRs & pending rewards
├─ Execute all 3 strategies
└─ Log actions + TX hashes
↓ (logs to blockchain)
On-Chain Logger
├─ execution-log.jsonl (append-only)
├─ performance-metrics.json (cumulative)
└─ learning-state.json (optimization history)
↓ (analyzes continuously)
Reinforced Learning System
├─ Tracks success rates per strategy
├─ Detects failure patterns
├─ Auto-adjusts thresholds
└─ Generates improvement reports
↓ (displays real-time)
Dashboard + Control Panel
├─ React dashboard (http://localhost:5173)
├─ Agent CLI (network, perf, learn commands)
└─ Performance API (/api/logs, /api/health)
config.deployed.json - Contract addresses & ABIs
{
"chainId": 97,
"network": "BNB Testnet",
"contracts": [
{
"vaultId": "vault_eth_staking_001",
"address": "0x588eD88A145144F1E368D624EeFC336577a4276b",
"strategy": "Ethereum 2.0 Staking",
"risk_score": 0.3
}
]
}
config.scheduler.json - Strategy thresholds
{
"scheduler": {
"execution_interval_seconds": 60,
"enabled": true
},
"agent": {
"harvest_threshold_usd": 25,
"rebalance_apr_delta": 2.0,
"max_allocation_percent": 0.35,
"min_confidence": 0.6
}
}
Each 60-second cycle:
- Check pending rewards per vault - If pending ≥ $25 → Harvest + Re-deposit - Log action with TX hash
- Compare APRs across all vaults - If top APR > bottom APR by ≥ 2% → Rebalance - Move 20% from worst to best vault - Log action with TX hash
- Estimate gas cost per harvest - Only harvest if pending > 2x gas cost - Maximize profitability per action - Log action with TX hash
Example Output:
Cycle #42 @ 2026-02-18T18:00:00Z
✓ vault_eth_staking_001: COMPOUND ($45.50 harvested)
✓ vault_high_risk_001: REBALANCE (2.1% APR delta)
✓ vault_link_oracle_001: HARVEST ($12.30 pending)
✅ Total Rewards: $57.80 | Compounded: $45.50
node agent-cli.js network status # Current network config
node agent-cli.js network testnet # Switch to testnet
node agent-cli.js network mainnet # Switch to mainnet (⚠️ production)
node agent-cli.js perf summary # Quick stats
node agent-cli.js perf report # Detailed analysis
node agent-cli.js perf vaults # Per-vault breakdown
node agent-cli.js perf strategies # Strategy effectiveness
node agent-cli.js learn now # Analyze & optimize
node agent-cli.js learn report # View improvements
node agent-cli.js learn reset # Reset learning state
| Network | Chain ID | Use Case | Harvest Min | Gas Multiplier | |---------|----------|----------|-------------|----------------| | BNB Testnet | 97 | Development | $25 | 1.2x | | BNB Mainnet | 56 | Production | $100 | 1.5x |
Switch instantly without restarting:
# Current config
node agent-cli.js network status
# → BNB Testnet
# Switch to production
node agent-cli.js network mainnet
# → Updated RPC, contract addresses, and thresholds
# All settings updated automatically
...
安装 Clawtrade Bnb 后,可以对 AI 说这些话来触发它
Help me get started with Clawtrade Bnb
Explains what Clawtrade Bnb does, walks through the setup, and runs a quick demo based on your current project
Use Clawtrade Bnb to autonomous DeFi trading agent for BNB Chain with multi-strategy eng...
Invokes Clawtrade Bnb with the right parameters and returns the result directly in the conversation
What can I do with Clawtrade Bnb in my finance & investment workflow?
Lists the top use cases for Clawtrade Bnb, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/clawtrade-bnb/ 目录(个人级,所有项目可用),或 .claude/skills/clawtrade-bnb/(项目级)。重启 AI 客户端后,用 /clawtrade-bnb 主动调用,或让 AI 根据上下文自动发现并使用。
Clawtrade Bnb 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Clawtrade Bnb 可免费安装使用。请查阅仓库了解许可证信息。
Autonomous DeFi trading agent for BNB Chain with multi-strategy engine, network switching, and reinforced learning.
Clawtrade Bnb 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my finance & investment tasks using Clawtrade Bnb
Identifies repetitive steps in your workflow and sets up Clawtrade Bnb to handle them automatically