agentsclimarketplace

Polymarket api

Skill aAAaqwq/AGI-Super-Team/skills/polymarket-api

Polymarket交易操作。统一入口scripts/trade.py,slug驱动,零browser纯API。Triggers: 'polymarket交易', 'API下单', 'buy YES', 'sell NO', 'trade', 'price', '仓位'.From its SKILL.md

Install
npx -y skills add aAAaqwq/AGI-Super-Team --skill polymarket-api

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

2.3 KB, 761 tokens by cl100k_base, as published. Nobody here has run it

Polymarket API Trading Skill

⚠️ 强制使用 scripts/trade.py,禁止直接调用CLOB API。

脚本目录

skills/polymarket-api/scripts/
└── trade.py    # 统一交易入口(买/卖/查价/查仓位)

命令

# === 交易 ===
python3 "$SKILL_DIR/scripts/trade.py" buy <slug> <YES/NO/UP/DOWN> <金额> [--threshold N] [price]
python3 "$SKILL_DIR/scripts/trade.py" sell <slug> <YES/NO> <金额> [--threshold N] [price]

# === 查询 ===
python3 "$SKILL_DIR/scripts/trade.py" price <slug> <YES/NO> [--threshold N]
python3 "$SKILL_DIR/scripts/trade.py" info <slug> [--threshold N]

示例

# BTC>$68k Mar28 买NO $10
python3 "$SKILL_DIR/scripts/trade.py" buy bitcoin-above-on-march-28 NO 10 --threshold 68000

# BTC涨跌盘 买DOWN $8
python3 "$SKILL_DIR/scripts/trade.py" buy btc-up-or-down-on-march-27-2026 DOWN 8

# 查价
python3 "$SKILL_DIR/scripts/trade.py" price ethereum-above-on-april-21 YES --threshold 2300

参数说明

参数必填说明
slug✅Gamma slug (e.g. bitcoin-above-on-march-28)
side✅YES/NO/UP/DOWN
金额buy必填 / sell可选USDC金额,sell默认全部
--threshold N多market时Above盘阈值,如68000
price可选默认自动定价(MID+1¢买/BID-1¢卖)

Slug格式

类型格式示例
Above盘{coin}-above-on-{month}-{day}bitcoin-above-on-march-28
涨跌盘{ticker}-up-or-down-on-{month}-{day}-{year}btc-up-or-down-on-march-27-2026

底层SDK(仅脚本内部使用)

  • [email protected] — CLOB V2订单簿 (2026-04-28上线,V1已弃用)
  • py-builder-relayer-client — Relayer链上操作 (redeem/approve)
  • 凭证: .env.poly (POLY_PRIVATE_KEY + POLY_PROXY_WALLET + POLY_API_KEY/SECRET/PASSPHRASE)

V2迁移记录 (2026-05-02)

  • OrderArgs 移除 fee_rate_bps, V2自动计算
  • OrderArgs 移除 nonce, V2用 timestamp
  • 下单默认 FOK (Fill or Kill)
  • Cloudflare 对 create_or_derive_api_key 有403干扰,但 fallback 正常

What ships with it: 3 files

21.4 KB alongside SKILL.md, 2 of them executable

references/

scripts/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.