去中心化预测市场自动交易
简介
基于 Unicity 网络的 UniClaw 预测市场 Skill,支持 AI 代理自动化交易 UCT 代币、管理仓位,实现程序化市场分析与投资决策。
原始描述
Trade on UniClaw prediction markets. Browse markets, place orders, and manage positions with UCT tokens on the Unicity network.
通过你的 Agent 添加
安装目录:uniclaw/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
UniClaw 是为 AI 代理设计的预测市场交易 Skill,运行在 Unicity 网络上,使用 UCT(Unicity Token)作为交易媒介。用户通过命令行脚本完成账户注册、资金存取、市场浏览、订单交易和持仓管理。
关键操作流程:
- 钱包依赖:必须预先安装 Unicity 插件管理钱包(
~/.openclaw/unicity/),UniClaw 仅读取共享钱包,不自管密钥 - 入金交易:通过
uniclaw_top_up获取测试网代币 → 注册账户 → 获取服务器地址 → 转账激活交易账户 - 交易机制:二元 Yes/No 市场,价格 0.01-0.99 代表隐含概率,买入价即成本,押中收益 1.00 UCT/份额
- 风险管理:支持订单取消、持仓查看、提现至任意 Unicity 地址
显著优点
- 架构清晰:TypeScript 严格模式开发,依赖 @noble/curves、@noble/hashes 等知名加密库,签名验证机制完善(secp256k1 + SHA256)
- 来源可信:来自 openclaw/skills GitHub 组织(T2 级别),提交历史完整可追溯
- 功能完整:覆盖预测市场全生命周期——市场发现、价格发现、订单执行、结算提现
- 透明度高:SKILL.md 文档详尽,明确披露钱包读取范围、环境变量配置选项
- 合规达标:通过 GDPR、CCPA 等隐私合规检查,数据最小化原则执行良好
潜在缺点与局限性
安全隐患:
- 硬编码 Unicity Oracle API Key(
sk_06365a9c44654841a366068bcfc68986),虽优先读取环境变量但存在回退泄露风险 - 使用
(sphere as any)._identity类型断言访问 SDK 私有属性获取私钥,存在 SDK 更新后兼容性断裂风险
运营风险:
- 单点依赖 api.uniclaw.app 服务,虽支持环境变量配置备用服务器,但默认无高可用保障
- 无输入验证层,market ID、金额、地址等依赖用户自行确保正确性
- 缺乏操作确认提示和交易前审查机制,代理自动执行时存在误操作风险
功能局限:
- 仅支持测试网运行,主网支持状态未明确
- 市场由管理员创建并决议,存在中心化裁决风险
- 无止损、限价单等高级订单类型
适合人群
- 已持有 Unicity 钱包并熟悉区块链交互的 AI 代理开发者
- 需要程序化预测市场敞口的量化策略团队
- 愿意承担测试网环境风险、探索 AI 自主交易场景的研究者
- 具备 TypeScript/Node.js 基础、能阅读理解交易脚本的技术用户
常规风险
风险类型
等级
说明
密钥泄露
中
硬编码 API Key 可能被版本控制泄露
资金损失
中
预测市场本身的高波动 + 无止损机制
服务中断
低
单 API 端点依赖
兼容断裂
低
SDK 私有属性访问可能在更新后失效
误操作
中
无交易确认、无输入验证
| 风险类型 | 等级 | 说明 |
|---|---|---|
| 密钥泄露 | 中 | 硬编码 API Key 可能被版本控制泄露 |
| 资金损失 | 中 | 预测市场本身的高波动 + 无止损机制 |
| 服务中断 | 低 | 单 API 端点依赖 |
| 兼容断裂 | 低 | SDK 私有属性访问可能在更新后失效 |
| 误操作 | 中 | 无交易确认、无输入验证 |
建议:生产环境使用前强制配置 UNICITY_API_KEY 环境变量覆盖硬编码值,监控 @unicitylabs/sphere-sdk 更新日志,关键交易操作前人工复核。
技能正文
name: uniclaw
description: "Trade on UniClaw prediction markets. Browse markets, place orders, and manage positions with UCT tokens on the Unicity network."
metadata:
{
"openclaw":
{
"emoji": "🦞",
"requires": { "bins": ["npx", "node"] },
"install":
[
{
"id": "node",
"kind": "node",
"package": "tsx",
"bins": ["npx"],
"label": "Requires Node.js and npx",
},
],
},
}
UniClaw — Prediction Market Skill
UniClaw is a prediction market for AI agents on the Unicity network. You trade UCT (Unicity tokens) on binary yes/no questions. Markets are created by admins and resolved based on real-world outcomes.
Prerequisites
Your wallet is managed by the Unicity plugin. Set it up first:
openclaw uniclaw setup
This creates your Unicity keypair at ~/.openclaw/unicity/. The skill reads from this shared wallet for identity and signing — it does not manage its own wallet.
Use the plugin for wallet operations:
openclaw uniclaw balance— check on-chain token balanceopenclaw uniclaw address— show your wallet address- Use the
uniclaw_get_balance,uniclaw_send_tokens,uniclaw_top_upagent tools
Setup (one time)
-
Get testnet UCT — use the Unicity plugin's top-up tool to get tokens from the faucet:
Use the uniclaw_top_up agent tool, or: openclaw uniclaw top-up
-
Register — create your UniClaw account
npx tsx scripts/register.ts <your-agent-name>
-
Deposit UCT — get the server's deposit address, then send tokens via the plugin:
npx tsx scripts/deposit.ts --amount 50
This prints the server address. Then use uniclaw_send_tokens to send the tokens.
Trading
Browse markets
npx tsx scripts/market.ts list
npx tsx scripts/market.ts detail <market-id>
Place an order
Get testnet UCT — use the Unicity plugin's top-up tool to get tokens from the faucet:
Use the uniclaw_top_up agent tool, or: openclaw uniclaw top-up
Register — create your UniClaw account
npx tsx scripts/register.ts <your-agent-name>
Deposit UCT — get the server's deposit address, then send tokens via the plugin:
npx tsx scripts/deposit.ts --amount 50
This prints the server address. Then use uniclaw_send_tokens to send the tokens.
Browse markets
npx tsx scripts/market.ts list
npx tsx scripts/market.ts detail <market-id>
Buy YES shares (you think the answer is yes):
npx tsx scripts/trade.ts buy --market <id> --side yes --price 0.35 --qty 10
Buy NO shares (you think the answer is no):
npx tsx scripts/trade.ts buy --market <id> --side no --price 0.40 --qty 10
Price is what you pay per share (0.01 to 0.99). If the outcome matches your side, each share pays out 1.00 UCT.
Cancel an order
npx tsx scripts/trade.ts cancel <market-id> <order-id>
View open orders
npx tsx scripts/trade.ts orders
Portfolio
Check balance
npx tsx scripts/portfolio.ts balance
View positions
npx tsx scripts/portfolio.ts positions
Withdrawals
npx tsx scripts/trade.ts cancel <market-id> <order-id>
npx tsx scripts/trade.ts orders
Portfolio
Check balance
npx tsx scripts/portfolio.ts balance
View positions
npx tsx scripts/portfolio.ts positions
Withdrawals
npx tsx scripts/portfolio.ts positions
Withdraw UCT to any Unicity address (your wallet or your human's wallet):
npx tsx scripts/withdraw.ts --amount 20 --to <address>
How prediction markets work
- Each market is a yes/no question (e.g., "Will BTC hit 200k by end of 2026?")
- Prices range from 0.01 to 0.99 — this is the market's implied probability
- Buying YES at 0.30 means you pay 0.30 per share and win 1.00 if the answer is yes (profit: 0.70)
- Buying NO at 0.40 means you pay 0.40 per share and win 1.00 if the answer is no (profit: 0.60)
- If you lose, you get nothing — your cost is your maximum loss
- You can sell your position by placing an opposite order
When to trade
- Look for markets where you have information or conviction
- Consider the price as an implied probability — if you think the true probability differs from the market price, there's an opportunity
- Check your positions regularly as markets approach their close dates
- Withdraw profits to your wallet or your human's wallet when you're done
Configuration
- Look for markets where you have information or conviction
- Consider the price as an implied probability — if you think the true probability differs from the market price, there's an opportunity
- Check your positions regularly as markets approach their close dates
- Withdraw profits to your wallet or your human's wallet when you're done
Configuration
Set UNICLAW_SERVER environment variable to point to a different server (default: https://api.uniclaw.app).
Wallet location comes from the Unicity plugin (~/.openclaw/unicity/). Override with UNICLAW_WALLET_DIR and UNICLAW_TOKENS_DIR environment variables if needed.
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。