Skip to content

Latest commit

 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polymarket Skill — search, read live odds, and trade Polymarket prediction markets from your AI agent, powered by the poly CLI

platform powered by markets type


In one line: drop this folder into your agent and ask "what are the odds Brazil wins?" or "buy $5 of YES at 0.42" — it drives the poly CLI for you, with JSON output, dry-run previews, and real-money guardrails baked into the instructions.

✨ Why you'll like it

  • 🔎 Market discovery — search markets, live odds, and order books. Public, no key required.
  • 💰 Trade — limit & market orders, batch posting, cancels. Every order can be previewed first.
  • 📊 Portfolio at a glance — positions, USDC balance, portfolio value, order & trade history.
  • 🤖 Agent-native — structured JSON, clean exit codes, {"error": …} on failure. Never blocks on a prompt.
  • 🛡️ Safe by design — dry-run before live orders, explicit new-wallet activation guidance, loud about real money.
  • 🔌 Portable — one folder, two homes: Claude Code and OpenClaw / clawhub.

💬 Talk to it

You say… It does…
"What are the odds Mexico reaches the Round of 16?" markets searchmarkets get, reads back the YES price
"How much USDC do I have on Polymarket?" clob balance --asset-type collateral
"Buy $5 of YES on <market> at 0.42." dry-run preview → submits with --yes
"Show my open positions and portfolio value." data positions · data value
"Cancel all my open orders." clob cancel-all
"Scan Polymarket for opportunities." runs the multi-agent scan → ranked opportunities, auto-fires structural arbs within limits, escalates the rest

🖥️ The dashboard

Ask "make me a Polymarket dashboard" — or run a scan — and the agent builds a self-contained, interactive HTML artifact: the hottest markets with live odds, candlesticks and order-book depth; the scan's gated recommendations; and your account. Everything is a frozen snapshot — regenerate for fresh data. how it's built →

Markets — the 50 most-traded markets in the last 24h, each with price history + order book:

Polymarket dashboard — Markets tab: stats strip, category filters, and market cards with YES/NO odds, candlestick price history, and order-book depth

Recommendations — the multi-agent scan's output, each tagged by the risk gate (executed / needs-approval / watch) with the strategy's rationale and the why behind every call:

Polymarket dashboard — Recommendations tab: three cards showing a risk-free-arb auto-executed, a momentum trade awaiting approval, and a mean-reversion watch item set aside by the gate

Account — cash, portfolio value, positions, open orders & trade history (when a wallet is configured)

Polymarket dashboard — Account tab: balance readout plus positions, open orders, and trade-history tables with P&L

📦 What's inside

File Purpose
🧠 SKILL.md The skill itself: trigger description, golden rules, command map, trading + wallet workflow, safety.
📖 reference/commands.md Full poly command catalog — flags, JSON shapes, read/write tags.
🍳 reference/recipes.md Copy-pasteable workflows: find→price→preview→submit, account checks, new-wallet activation.

It's instruction-only — no code of its own. poly is the single source of truth; this skill is the operating manual that teaches an agent to drive it well.

⚡ Quickstart

1. Install the poly CLI (needs uv):

curl -LsSf https://astral.sh/uv/install.sh | sh                          # install uv (macOS / Linux)
uv tool install git+https://github.com/NetMindAI-Open/polymarket_cli.git     # install poly globally
poly --help                                                              # verify

If poly isn't found, run uv tool update-shell and restart your terminal. Developing the CLI itself? Clone it, uv sync --extra dev, and run from the checkout with uv run poly ….

2. Configure a signer key (only for account reads & trading — market search needs none):

poly setup                     # hidden prompt → ~/.config/polymarket/config.json
# or: poly wallet import 0x<key>
# or: export POLYMARKET_PRIVATE_KEY=0x...

3. Load the Polymarket MCP (read-only market data — powers search, screening & the scanner):

claude mcp add --transport http --scope user polymarket \
  https://polymarket.mcp.askcloud.ai/mcp \
  --header "Authorization: Bearer <YOUR_BEARER_TOKEN>"
claude mcp get polymarket      # verify → Status: ✔ Connected

Swap in your own bearer token. The skill reaches the server through assets/poly-mcp.sh, which reads the URL + token from ~/.claude.json and never echoes it — more in reference/mcp.md.

4. Install the skill — just ask your agent. Open Claude Code in this folder and say:

"Install this folder as a Claude Code skill: put it at ~/.claude/skills/polymarket with SKILL.md at the root, then tell me to restart."

The agent does the copy for you. Restart Claude Code and the skill activates whenever you mention Polymarket, prediction-market odds, or placing a bet. Developing the skill? Ask it to symlink instead of copy so your edits stay live. OpenClaw / clawhub: the same folder installs as an OpenClaw skill — users just need poly on their PATH.

Prefer to run it yourself?
# copy it in — SKILL.md must sit at the installed folder's root
cp -R polymarket-skill ~/.claude/skills/polymarket

# …or symlink if you'll keep developing it (edits stay live, no re-copy):
ln -s "$(pwd)/polymarket-skill" ~/.claude/skills/polymarket

rm ~/.claude/skills/polymarket removes only the copy/symlink, never your repo.

🆕 New wallet? Activate it first

Importing or creating a key only configures signing. A wallet that has never been used on Polymarket can't trade until you activate it on the website:

polymarket.com → connect/log in with the wallet → deposit USDC → complete the on-screen "Enable Trading" approvals.

Until then, signing and --dry-run work, but live orders fail with InsufficientAllowanceError. The agent will walk you through this — full steps in the "Activate a brand-new wallet" recipe.

🔒 Safety

Trades spend real USDC on Polygon. The base buy/sell flow ships an autonomous posture — the agent may submit live orders with --yes without per-order approval — and does not enforce spending limits there (a deliberate, thin-by-design choice; the limits in SKILL.md are guidance). The multi-agent scanner is different: its risk gate enforces hard caps (per-order, per-run, liquidity, depth) and only auto-executes structural arbs — everything else escalates. Tune those caps in reference/config.md.

✅ Prefer a --dry-run preview before any live order  ·  ✅ Tell the agent your per-order / per-day limits if you want them honored  ·  ✅ A wallet must be funded and approved to fill.

Built on the poly CLI · type-3 deposit-wallet correct · Decimal-safe pricing

About

AI agent skill for querying and trading on Polymarket prediction markets — built on the poly CLI. Portable across Claude Code and OpenClaw/clawhub.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages