Axelrod
Execute Base-chain trading and on-chain queries using natural language through the AIxVC AI Automation.
Quick Start
First-Time Setup
- 1. Configure credentials in OpenClaw config under
skills.entries.axelrod.env:
CODEBLOCK0
- 2. Install dependencies:
CODEBLOCK1
- 3. Verify setup:
CODEBLOCK2
Core Usage
Simple Query
For straightforward requests that complete quickly:
CODEBLOCK3
JSON Debug Mode
For inspecting the full API response:
CODEBLOCK4
Mandatory Workflow
- 1. Check AK/SK — If
AIXVC_ACCESS_KEY or AIXVC_SECRET_KEY is missing, ask the user to configure them. Do not guess or fabricate credentials. - Run the script — Whenever the request needs real-time on-chain data or execution, always run the CLI. Do not answer from model memory alone.
- Return stdout — Capture the script's stdout and return it to the user. Light formatting is fine, but do not omit key results (amounts, tx hashes, confirm keys, error messages).
- Handle confirmation — If the response includes
confirmKey, guide the user to confirm or cancel (see Confirmation Flow below).
Capabilities Overview
Trading Operations
- - Spot Buy/Sell/Swap: Exchange tokens on Base chain
- DCA: Dollar-cost averaging automation (e.g. "DCA 20u into ETH every day")
- Limit/Trigger Orders: Execute at target prices or PnL rates
- RSI Strategy: Conditional trading based on RSI indicators (e.g. "if 1h RSI < 30, buy 100u BTC")
- Take-Profit / Stop-Loss: Automated risk management via INLINECODE4
Reference: references/api.md
Query Operations
- - Balance Query: Single token or all-asset portfolio
- Token Info & Analysis: Contract details, decimals, analytics
- Price Query: Real-time prices with 24h change
- Order Query: Active order list and details
- TP/SL Order Query: Take-profit/stop-loss order status
Blockchain Assistant
- - Crypto/DeFi domain Q&A and execution guidance
- Trading plan suggestions on Base chain
Confirmation Flow
Orders usually require risk-control confirmation; small orders (approximately ≤ $10) may skip confirmation. confirmKey is valid for about 10 minutes.
When the response includes confirmKey, ask the user to send one of:
CODEBLOCK5
If the key has expired, the user must submit the original request again.
Current Limitations
| Limitation | Details |
|---|
| Chain | Base only |
| Multiple trades |
One trade per message; ask user to split if needed |
| Not supported | Leverage/futures/options, lending, cross-chain, NFT, fiat on/off-ramp |
Common Patterns
Check Before Trading
CODEBLOCK6
Automated Strategies
CODEBLOCK7
Portfolio Review
CODEBLOCK8
Error Handling
Exit Codes
| Code | Meaning | Resolution |
|---|
| INLINECODE7 | Success | — |
| INLINECODE8 |
Missing AK/SK | Ask user to configure
AIXVC_ACCESS_KEY and
AIXVC_SECRET_KEY |
|
3 | HTTP failure or invalid/non-JSON response | Check network, verify endpoint is reachable |
|
4 | API business error (
code not in success set) | Read the error message, guide user to fix |
Common Issues
| Issue | Resolution |
|---|
| "Please login first" | AK/SK is incorrect — reconfigure credentials |
| Authentication error |
Verify AK/SK are correct and not expired |
| Insufficient balance | Reduce trade amount or add funds |
| Token not found | Check token symbol or contract address |
| confirmKey expired | Re-submit the original trade request |
| Multiple trades in one message | Split into separate requests |
Prompt Examples by Category
Trading
- - INLINECODE14
- INLINECODE15
- INLINECODE16
Automated Strategies
- - INLINECODE17
- INLINECODE18
- INLINECODE19
Portfolio & Queries
- - INLINECODE20
- INLINECODE21
- INLINECODE22
- INLINECODE23
- INLINECODE24
Blockchain Assistant
- - INLINECODE25
- INLINECODE26
Best Practices
Security
- 1. Never share your AK/SK credentials
- Start with small test amounts
- Verify token addresses before large trades
- Review confirmation details carefully before executing
Trading
- 1. Check balance before trades
- Specify amounts clearly (
50u, 50%, 0.1 ETH) - Start small, scale up after validation
- Use limit orders for better entry prices
- Set TP/SL for risk management
API Reference
For the full API contract, SigV4 signing protocol, request/response format, and response field details, see:
Reference: references/api.md
Implementation Notes
- - The script uses AK/SK with SigV4-style signing to call the AIxVC.
- Current endpoint:
https://api.aixvc.io/gw/openapi/v2/public/twa/agent/chat (chain-id=base). - If documentation conflicts with code behavior, follow the script implementation.
File Structure
- - SKILL.md — Agent instructions (this file). The agent reads this to understand how to use the skill.
- README.md — Human-facing setup and usage guide.
- scripts/axelrod_chat.py — CLI client. Always invoke with
python skills/axelrod/scripts/axelrod_chat.py --message "<instruction>". - references/api.md — Full API contract and signing reference.
- requirements.txt — Python dependencies (
requests).
Troubleshooting
Script Not Working
CODEBLOCK9
API Errors
See exit codes and common issues tables above. If an error persists:
- 1. Check the error message from stderr
- Use
--json mode to inspect the full API response - Verify AK/SK configuration
- Test with a simple query first (
"check my balance")
💡 Pro Tip: The most common issue is missing or incorrect AK/SK. Always verify credentials first when encountering errors.
⚠️ Security: Keep your AK/SK private. Never commit credentials to version control. Only trade amounts you can afford to lose.
🚀 Quick Win: Start by checking your balance to verify setup, then try a small trade like "buy 1u of ETH" to get familiar with the flow.
Axelrod
通过AIxVC AI自动化,使用自然语言执行Base链交易和链上查询。
快速开始
首次设置
- 1. 配置凭证 在OpenClaw配置文件的 skills.entries.axelrod.env 下:
json
{
skills: {
entries: {
axelrod: {
enabled: true,
env: {
AIXVCACCESSKEY: youraccesskey,
AIXVCSECRETKEY: yoursecretkey
}
}
}
}
}
- 2. 安装依赖:
bash
pip install -r skills/axelrod/requirements.txt
- 3. 验证设置:
bash
python skills/axelrod/scripts/axelrod_chat.py --message check my balance
核心用法
简单查询
适用于快速完成的简单请求:
bash
python skills/axelrod/scripts/axelrod_chat.py --message check my ETH balance
python skills/axelrod/scripts/axelrod_chat.py --message what is ETH price now
JSON调试模式
用于检查完整的API响应:
bash
python skills/axelrod/scripts/axelrod_chat.py --message check my balance --json
强制工作流程
- 1. 检查AK/SK — 如果缺少 AIXVCACCESSKEY 或 AIXVCSECRETKEY,请用户配置。不要猜测或伪造凭证。
- 运行脚本 — 当请求需要实时链上数据或执行时,始终运行CLI。不要仅依赖模型记忆回答。
- 返回标准输出 — 捕获脚本的标准输出并返回给用户。允许轻度格式化,但不要省略关键结果(金额、交易哈希、确认密钥、错误消息)。
- 处理确认 — 如果响应包含 confirmKey,引导用户确认或取消(参见下面的确认流程)。
功能概览
交易操作
- - 现货买入/卖出/兑换:在Base链上交换代币
- 定投:平均成本自动化(例如每天定投20u到ETH)
- 限价/触发订单:在目标价格或盈亏率执行
- RSI策略:基于RSI指标的条件交易(例如如果1小时RSI < 30,买入100u BTC)
- 止盈/止损:通过 QUERY_ALGO 实现自动化风险管理
参考:references/api.md
查询操作
- - 余额查询:单个代币或全资产组合
- 代币信息与分析:合约详情、精度、分析
- 价格查询:实时价格及24小时变化
- 订单查询:活跃订单列表及详情
- 止盈/止损订单查询:止盈/止损订单状态
区块链助手
- - 加密/DeFi领域问答与执行指导
- Base链交易计划建议
确认流程
订单通常需要风控确认;小额订单(约≤10美元)可能跳过确认。confirmKey 有效期约为10分钟。
当响应包含 confirmKey 时,请用户发送以下之一:
text
yes, please execute
no, please cancel
如果密钥已过期,用户必须重新提交原始请求。
当前限制
每条消息一笔交易;如有需要请用户拆分 |
| 不支持 | 杠杆/期货/期权、借贷、跨链、NFT、法币出入金 |
常见模式
交易前检查
bash
检查余额
python skills/axelrod/scripts/axelrod_chat.py --message check my ETH balance
检查价格
python skills/axelrod/scripts/axelrod_chat.py --message what is ETH price now
然后交易
python skills/axelrod/scripts/axelrod_chat.py --message buy 50u of ETH
自动化策略
bash
定投策略
python skills/axelrod/scripts/axelrod_chat.py --message DCA 20u into ETH every day
RSI条件策略
python skills/axelrod/scripts/axelrod_chat.py --message if 1h RSI < 30, buy 100u BTC
限价订单
python skills/axelrod/scripts/axelrod_chat.py --message buy ETH when price drops to 2500
投资组合审查
bash
完整投资组合
python skills/axelrod/scripts/axelrod_chat.py --message check my balance
代币分析
python skills/axelrod/scripts/axelrod_chat.py --message analyze AXR token for me
订单状态
python skills/axelrod/scripts/axelrod_chat.py --message show my recent orders
错误处理
退出码
缺少AK/SK | 请用户配置 AIXVC
ACCESSKEY 和 AIXVC
SECRETKEY |
| 3 | HTTP失败或无效/非JSON响应 | 检查网络,验证端点是否可达 |
| 4 | API业务错误(code不在成功集合中) | 读取错误消息,引导用户修复 |
常见问题
| 问题 | 解决方案 |
|---|
| 请先登录 | AK/SK错误 — 重新配置凭证 |
| 认证错误 |
验证AK/SK是否正确且未过期 |
| 余额不足 | 减少交易金额或添加资金 |
| 代币未找到 | 检查代币符号或合约地址 |
| confirmKey已过期 | 重新提交原始交易请求 |
| 一条消息中包含多笔交易 | 拆分为单独请求 |
按类别分类的提示示例
交易
- - 买入50u的AXR
- 卖出我50%的ETH
- 将10 SOL兑换为ETH
自动化策略
- - 每天定投20u到ETH
- 如果1小时RSI < 30,买入100u BTC
- 当ETH价格跌至2500时买入
投资组合与查询
- - 检查我的余额
- 显示AXR代币信息
- ETH现在价格是多少
- 显示我最近的订单
- 显示我的止盈/止损订单
区块链助手
- - 帮我分析AXR代币
- 帮我制定一个Base交易计划
最佳实践
安全
- 1. 切勿分享您的AK/SK凭证
- 从小额测试开始
- 大额交易前验证代币地址
- 执行前仔细审查确认详情
交易
- 1. 交易前检查余额
- 明确指定金额(50u、50%、0.1 ETH)
- 从小额开始,验证后逐步增加
- 使用限价订单获得更好的入场价格
- 设置止盈/止损进行风险管理
API参考
有关完整API合约、SigV4签名协议、请求/响应格式及响应字段详情,请参见:
参考:references/api.md
实现说明
- - 脚本使用AK/SK配合SigV4风格签名调用AIxVC。
- 当前端点:https://api.aixvc.io/gw/openapi/v2/public/twa/agent/chat(chain-id=base)。
- 如果文档与代码行为冲突,请遵循脚本实现。
文件结构
- - SKILL.md — 代理指令(本文件)。代理读取此文件以了解如何使用该技能。
- README.md — 面向人类的设置和使用指南。
- scripts/axelrodchat.py — CLI客户端。始终使用 python skills/axelrod/scripts/axelrodchat.py --message <指令> 调用。
- references/api.md — 完整API合约和签名参考。
- requirements.txt — Python依赖项(requests)。
故障排除
脚本无法工作
bash
确保Python 3可用
python --version
安装依赖
pip install -r skills/axelrod/requirements.txt
测试连接
curl -I https://api.aixvc.io
API错误
请参见上面的退出码和常见问题表格。如果错误持续存在:
- 1. 检查stderr中的错误消息
- 使用 --json 模式检查完整API响应
- 验证AK/SK配置
- 先用简单查询测试(check my balance)
💡 专业提示:最常见的问题是缺少或错误的AK/SK。遇到错误