Skip to content
Back to skills

Polymarket Api

ASecurity

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

  • 121 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 5, 2026
ai-agentspythonbashapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add aAAaqwq/AGI-Super-Skills --skill polymarket-api --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Polymarket Api?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Polymarket Api
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aaaaqwq-polymarket-api/badge)](https://www.skillsdirectory.com/skills/aaaaqwq-polymarket-api)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

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

# Polymarket API Trading Skill

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

## 脚本目录

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

## 命令

```bash
# === 交易 ===
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]
```

## 示例

```bash
# 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(仅脚本内部使用)

- `py-clob-client-v2@1.0.0` — 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 正常

Files in this skill

  • SKILL.md2.3 KB
  • references/data-sources.md2.7 KB
  • scripts/daily_market_monitor.py3.7 KB
  • scripts/trade.py15 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.