闲社服务运行正常AI智能体自动化平台
p

BSC预测交易

技能标识:probable-skill

0xProbable prediction market trading skills on BSC mainnet. Trade outcome shares (YES/NO) on real-world events via CLOB order book using @prob/clob SDK. Supports event search, orderbook queries, limit/market orders, position tracking with PnL, and Gnosis Safe proxy wallet withdrawals.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 0.1.1
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

BSC预测交易

0xProbable Markets CLOB 技能

基于 bun 运行时的 0xProbable CLOB 交易工具集(BSC 链)。

环境检查(首次使用必读)

在执行任何脚本之前,请先检查 scripts/ 目录是否存在:

bash
ls scripts/config.ts 2>/dev/null && echo scripts 目录已就绪 || echo scripts 目录缺失,请执行下方 clone 命令

如果 scripts/ 目录不存在或缺失关键文件,请克隆仓库:

bash
git clone git@github.com:user/0xprobableskills.git && cd 0xprobableskills

注意:所有命令均需在仓库根目录(包含 scripts/ 和 package.json 的目录)下执行。

前置条件

  1. 1. 安装 bun(如已安装则跳过):
bash command -v bun >/dev/null 2>&1 && echo bun 已安装: $(bun --version) || { curl -fsSL https://bun.sh/install | bash && source ~/.bashrc; }
  1. 2. 创建 .env 文件:

PRIVATE_KEY=<你的钱包私钥>

bun 具备 auto-install 能力,无需手动 bun add / bun install,依赖版本由 package.json 和 bun.lock 锁定。

安全提醒:PRIVATE_KEY 拥有钱包完全控制权,切勿泄露。确保 .env 已加入 .gitignore。

网站前置步骤

使用前必须在 0xProbable Markets 网站上完成:

  1. 1. 注册账户 — 前往 0xProbable Markets 注册登录
  2. 启用交易 — 链上创建代理钱包(Gnosis Safe),完成 USDT 授权
  3. 充值 USDT — 向代理钱包充值(BSC 链 USDT)

完成后获得 PRIVATE_KEY,填入 .env 即可。

入门流程

  1. 1. 填写 .env(PRIVATEKEY)
  2. bun run scripts/check-balance.ts — 确认 USDT 余额充足
  3. bun run scripts/search.ts <关键词> — 搜索感兴趣的市场
  4. bun run scripts/get-event.ts id> — 获取事件详情和 tokenId
  5. 开始交易

命令速查

bash
bun run scripts/check-balance.ts # 检查余额(USDT + BNB)
bun run scripts/search.ts <关键词> [--limit ] [--json] # 搜索市场
bun run scripts/list-events.ts [--limit ] [--offset ] [--json] # 浏览事件列表
bun run scripts/list-tags.ts [--json] # 获取事件标签
bun run scripts/get-event.ts id
or_slug> [--json] # 获取事件详情
bun run scripts/get-market.ts [--json] # 获取市场详情
bun run scripts/price-info.ts [--json] # 获取价格信息
bun run scripts/price-history.ts [--interval ] # 历史价格
bun run scripts/orderbook.ts [--json] # 查看订单簿
bun run scripts/buy.ts --token --price

--size # 限价买入
bun run scripts/sell.ts --token --price

--size # 限价卖出
bun run scripts/check-orders.ts [--event ] # 查看挂单
bun run scripts/cancel-orders.ts --order # 取消订单
bun run scripts/positions.ts [--event ] [--token ] [--pnl] # 查看持仓
bun run scripts/withdraw.ts [--amount ] # 从代理钱包提取 USDT

脚本用法详解

1. 检查余额 — check-balance.ts

查询 EOA 和代理钱包的 USDT 余额,以及 EOA 的 BNB 余额(Gas 费用)。

bash
bun run scripts/check-balance.ts

输出:EOA 地址、代理钱包地址、两者的 USDT 余额、USDT 合计、BNB 余额。

注意:BSC 上 USDT 使用 18 位小数(与 ETH 主网 6 位小数不同)。

2. 搜索市场 — search.ts

bash
bun run scripts/search.ts <关键词> [--limit ] [--json]

参数说明
<关键词>搜索关键词(必填)
--limit <n>
返回数量 | | --json | 输出原始 JSON |

示例:

  • - bun run scripts/search.ts bitcoin
  • bun run scripts/search.ts 美国大选 --limit 5
  • bun run scripts/search.ts trump --json

3. 浏览事件 — list-events.ts

bash
bun run scripts/list-events.ts [--limit ] [--offset ] [--json]

参数说明
--limit <n>返回数量(默认 20)
--offset <n>
跳过前 n 条(分页用) | | --json | 输出原始 JSON |

示例:

  • - bun run scripts/list-events.ts — 默认列出 20 条事件
  • bun run scripts/list-events.ts --limit 10 --offset 20 — 第三页

4. 获取事件标签 — list-tags.ts

bash
bun run scripts/list-tags.ts [--json]

参数说明
<event_id>事件 ID(必填)
--json
输出原始 JSON |

示例:

  • - bun run scripts/list-tags.ts 752

5. 获取事件详情 — get-event.ts

bash
bun run scripts/get-event.ts idor_slug> [--json]

先尝试按 ID 查询,失败则按 slug 查询。输出事件标题、ID、状态、描述、市场列表及 tokenId。

示例:

  • - bun run scripts/get-event.ts 752
  • bun run scripts/get-event.ts bitcoin-price --json

6. 获取市场详情 — get-market.ts

bash
bun run scripts/get-market.ts [--json]

7. 获取价格 — price-info.ts

bash
bun run scripts/price-info.ts [--json]

8. 历史价格 — price-history.ts

bash
bun run scripts/price-history.ts [--interval ]

参数说明
--interval时间窗口

9. 订单簿 — orderbook.ts

bash
bun run scripts/orderbook.ts [--json]

获取完整 bids + asks,计算价差和中间价。

10. 买入 — buy.ts

bash
bun run scripts/buy.ts --token --price

--size

参数说明
--token <ID>Token ID(从 get-event 获取)
--price <P>
限价价格(0-1 之间) | | --size | 份额数量 |

下单自动设置 feeRateBps=175(最低手续费),订单类型 GTC(限价单)。

11. 卖出 — sell.ts

bash
bun run scripts/sell.ts --token --price

--size

参数同买入。

12. 查看挂单 — check-orders.ts

bash
bun run scripts/check-orders.ts [--event ]

13. 取消订单 — cancel-orders.ts

bash
bun run scripts/cancel-orders.ts --order

14. 查看持仓 — positions.ts

bash
bun run scripts/positions.ts --event [--pnl] [--trades] [--json]

参数说明
--event <ID>事件 ID(必填)
--pnl
显示盈亏信息 | | --trades |

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 probable-skill-1776274414 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 probable-skill-1776274414 技能

通过命令行安装

skillhub install probable-skill-1776274414

下载

⬇ 下载 probable-skill v0.1.1(免费)

文件大小: 25.63 KB | 发布时间: 2026-4-16 16:55

v0.1.1 最新 2026-4-16 16:55
- Updated skill description to clarify trading of outcome shares (YES/NO) on real-world events and add more detail on feature coverage.
- Added more explicit references to prediction markets and outcome trading in the intro.
- No changes to functionality, code, or examples; documentation only.