Agent skill

Polyclaw

by chainstacklabs in chainstacklabs/polyclaw

Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.

Apache-2.0Auto-check passedBusiness, Finance & HR

Install Polyclaw

skills CLI
$ npx skills add chainstacklabs/polyclaw --skill polyclaw -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install chainstacklabs/polyclaw polyclaw --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
polyclaw
GitHub stars
360
Used in
1 other repo
Token cost
~2k tokens
SKILL.md length
757 words
Files
20 (incl. scripts)
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.

  • Works in 3 steps: Split Position - pUSD is split into YES… → Sell Unwanted - The unwanted side is… → Result - You hold the wanted position,…
  • Tasks that involve Trading and backtesting
  • SKILL.md covers Features, Quick Start, Security and Environment Variables, plus 6 more sections
  • Runs Python scripts from its folder; calls uv; reaches geo.iproyal.com; needs POLYCLAW_PRIVATE_KEY and OPENROUTER_API_KEY

What it does

Polyclaw is an agent skill from chainstacklabs/polyclaw. Trade on Polymarket via split + CLOB execution. Browse markets, track positions with P&L, discover hedges via LLM. Polygon/Web3.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 21 other files, including scripts (for example `README.md`, `lib/__init__.py` and `lib/clob_client.py`).

It sits in Business, Finance & HR, covering Trading and backtesting and Crypto and DeFi analysis. It works with Polymarket. The repository describes itself as: Trading-enabled Polymarket skill for OpenClaw - browse markets, execute trades, track positions, discover hedges. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Trading and backtesting
  • Tasks that involve Crypto and DeFi analysis

Example prompts

  • “/polyclaw”

Requirements

  • Python 3
  • A credential in POLYCLAW_PRIVATE_KEY
  • A credential in OPENROUTER_API_KEY

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Split Position - pUSD is split into YES + NO tokens via CTF contract
  2. Sell Unwanted - The unwanted side is sold via CLOB order book (V2)
  3. Result - You hold the wanted position, recovered partial cost from selling unwanted

What it can do on your machine

Read from SKILL.md and the folder at commit 1f5a8ab. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 6 files in scripts/ (Python, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • geo.iproyal.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • POLYCLAW_PRIVATE_KEY
    • OPENROUTER_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Polyclaw loads about 2k tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 757 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from chainstacklabs/polyclaw at commit 1f5a8ab, republished under its Apache-2.0 licence (© chainstacklabs). 757 words, ~2,015 tokens.

Download SKILL.mdSave it as .claude/skills/polyclaw/SKILL.md (or your agent's skills folder). This skill also uses 19 other files; get the full folder from GitHub.
name
polyclaw
description
Trade on Polymarket via split + CLOB execution. Browse markets, track positions with P&L, discover hedges via LLM. Polygon/Web3.

PolyClaw

Trading-enabled Polymarket skill for OpenClaw. Browse markets, manage wallets, execute trades, and track positions.

Features

  • Market Browsing - Search and browse Polymarket prediction markets
  • Wallet Management - Env-var based wallet configuration
  • Trading - Buy YES/NO positions via split + CLOB execution
  • Position Tracking - Track entry prices, current prices, and P&L
  • Hedge Discovery - LLM-powered covering portfolio discovery via logical implications

Quick Start

First, install dependencies (from skill directory):

bash
cd {baseDir}
uv sync
First-Time Setup (Required for Trading)

Before your first trade, set Polymarket contract approvals (one-time, costs ~0.01 POL in gas):

bash
uv run python scripts/polyclaw.py wallet approve

This submits 6 approval transactions to Polygon. You only need to do this once per wallet.

Browse Markets
bash
# Trending markets by volume
uv run python scripts/polyclaw.py markets trending

# Search markets
uv run python scripts/polyclaw.py markets search "election"

# Market details (returns full JSON with all fields)
uv run python scripts/polyclaw.py market <market_id>

Output options:

  • Default output is a formatted table (good for display)
  • Use --full flag for full question text without truncation
  • Use --json flag via scripts/markets.py --json trending for structured JSON output
Wallet Management
bash
# Check wallet status (address, balances)
uv run python scripts/polyclaw.py wallet status

# Set contract approvals (one-time)
uv run python scripts/polyclaw.py wallet approve

The wallet is configured via the POLYCLAW_PRIVATE_KEY environment variable.

Trading
bash
# Buy YES position for $50
uv run python scripts/polyclaw.py buy <market_id> YES 50

# Buy NO position for $25
uv run python scripts/polyclaw.py buy <market_id> NO 25
Positions
bash
# List all positions with P&L
uv run python scripts/polyclaw.py positions
Hedge Discovery

Find covering portfolios - pairs of market positions that hedge each other via contrapositive logic.

bash
# Scan trending markets for hedges
uv run python scripts/polyclaw.py hedge scan

# Scan markets matching a query
uv run python scripts/polyclaw.py hedge scan --query "election"

# Analyze specific markets for hedging relationship
uv run python scripts/polyclaw.py hedge analyze <market_id_1> <market_id_2>

Output options:

  • Default output is a formatted table showing Tier, Coverage, Cost, Target, and Cover
  • Use --json flag for structured JSON output
  • Use --min-coverage 0.90 to filter by minimum coverage (default 0.85)
  • Use --tier 1 to filter by tier (1=best, default 2)

Coverage tiers:

  • Tier 1 (HIGH): >=95% coverage - near-arbitrage opportunities
  • Tier 2 (GOOD): 90-95% - strong hedges
  • Tier 3 (MODERATE): 85-90% - decent but noticeable risk
  • Tier 4 (LOW): <85% - speculative (filtered by default)

LLM model: Uses nvidia/nemotron-nano-9b-v2:free via OpenRouter. Model selection matters — some models find spurious correlations while others (like DeepSeek R1) have output format issues. Override with --model <model_id> if needed.

Security

For the MVP, the private key is stored in an environment variable for simplicity and Claude Code compatibility.

Security Warning: Keep only small amounts in this wallet. Withdraw regularly to a secure wallet.

Environment Variables

VariableRequiredDescription
CHAINSTACK_NODEYes (trading)Polygon RPC URL
OPENROUTER_API_KEYYes (hedge)OpenRouter API key for LLM hedge discovery
POLYCLAW_PRIVATE_KEYYes (trading)EVM private key (hex, with or without 0x prefix)
HTTPS_PROXYRecommendedRotating residential proxy for CLOB (e.g., IPRoyal)
CLOB_MAX_RETRIESNoMax CLOB retries with IP rotation (default: 5)
POLY_BUILDER_CODENoBytes32 builder code for attribution (from polymarket.com/settings?tab=builder). Attached to every order when set.

Security Warning: Keep only small amounts in this wallet. Withdraw regularly to a secure wallet. The private key in an env var is convenient for automation but less secure than encrypted storage.

Trading Flow

  1. Split Position - pUSD is split into YES + NO tokens via CTF contract
  2. Sell Unwanted - The unwanted side is sold via CLOB order book (V2)
  3. Result - You hold the wanted position, recovered partial cost from selling unwanted

Example: Buy YES at $0.70

  • Split $100 pUSD → 100 YES + 100 NO tokens
  • Sell 100 NO tokens at ~$0.30 → recover ~$27 pUSD
  • Net cost: ~$73 for 100 YES tokens (entry: $0.73)

If you only have USDC.e, wrap it 1:1 into pUSD via the Collateral Onramp's wrap() function before trading.

Show full SKILL.md (271 more words)Show less

Polymarket Contracts (Polygon Mainnet, CLOB V2)

  • pUSD (collateral): 0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB
  • USDC.e (onramp input): 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
  • Collateral Onramp: 0x93070a847efEf7F70739046A929D47a521F5B8ee
  • CTF (Conditional Tokens): 0x4D97DCd97eC945f40cF65F87097ACe5EA0476045
  • CTF Exchange (V2): 0xE111180000d2663C0091e4f400237545B87B996B
  • Neg Risk CTF Exchange (V2): 0xe2222d279d744050d28e00520010520000310F59

Dependencies

Install with uv (from skill directory):

bash
cd {baseDir}
uv sync

Limitations

  • Trading requires wallet approval setup (one-time)
  • CLOB sells may fail if liquidity is insufficient
CLOB Cloudflare Blocking

Polymarket's CLOB API uses Cloudflare protection that blocks POST requests from many IPs, including datacenter IPs and some residential ISPs. This affects the "sell unwanted tokens" step.

Solution: Residential proxy with retry logic

The recommended setup uses a rotating residential proxy (e.g., IPRoyal, BrightData). The CLOB client automatically retries with new IPs until one works:

bash
export HTTPS_PROXY="http://user:pass@geo.iproyal.com:12321"
export CLOB_MAX_RETRIES=10  # Default is 5

With this setup, CLOB orders typically succeed within 5-10 retries as the proxy rotates through IPs until finding an unblocked one.

Alternative workarounds:

  1. Use --skip-sell — Keep both YES and NO tokens, sell manually on polymarket.com
  2. No proxy — Split still works; only CLOB sell is affected

If CLOB fails after all retries, your split still succeeded. The output tells you how many tokens to sell manually.

Troubleshooting

"No wallet available"

Set the POLYCLAW_PRIVATE_KEY environment variable:

bash
export POLYCLAW_PRIVATE_KEY="0x..."
"Insufficient pUSD"

Check balance with uv run python scripts/polyclaw.py wallet status. Trades require pUSD (Polymarket USD). If you have USDC.e, wrap it 1:1 via the Collateral Onramp (0x9307...B8ee) — the polymarket.com UI does this automatically; API users wrap manually.

"CLOB order failed"

The CLOB sell may fail due to:

  • Insufficient liquidity at the sell price
  • IP blocked by Cloudflare (try proxy)

Your split still succeeded - you have the tokens, just couldn't sell unwanted side.

"Approvals not set"

First trade requires contract approvals. Run:

bash
uv run python scripts/polyclaw.py wallet approve

License

Apache 2.0

© chainstacklabs, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 19 other files (scripts) in the repository root of chainstacklabs/polyclaw.

  • SKILL.md
  • .gitignore
  • LICENSE
  • README.md
  • lib/__init__.py
  • lib/clob_client.py
  • lib/contracts.py
  • lib/coverage.py
  • lib/gamma_client.py
  • lib/llm_client.py
  • lib/position_storage.py
  • lib/wallet_manager.py
  • pyproject.toml
  • scripts/hedge.py
  • scripts/markets.py
  • scripts/polyclaw.py
  • scripts/positions.py
  • scripts/redeem.py
  • scripts/trade.py
  • … and 1 more

Open the folder on GitHubat commit 1f5a8ab

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in chainstacklabs/polyclaw, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Polyclaw next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Polyclaw compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Polyclaw this skillchainstacklabs/polyclaw3601 repos~2kAutomated safety check: PassApache-2.0
Crypto Hftalsk1992/CloddsBot2.9k—~1.9kAutomated safety check: PassMIT
Bankrmajiayu000/claude-skill-registry6663 repos~7kAutomated safety check: NotesMIT
Polymarket TradingBlockRunAI/blockrun-mcp392—~1.8kAutomated safety check: PassMIT
Digital Oraclekomako-workshop/digital-oracle867—~5.9kAutomated safety check: PassMIT
Web3 PolymarketPolymarket/agent-skills1912 repos~2kAutomated safety check: PassNone

Similar skills

  • Crypto Hft

    alsk1992/CloddsBot

    Trade crypto binary markets on Polymarket with 4 automated strategies.

    2.9k GitHub stars~1.9k tokensUpdated 4 days ago
    Business, Finance & HRAuto-check passed
  • Bankr

    majiayu000/claude-skill-registry

    AI-powered crypto trading agent and LLM gateway via natural language.

    666 GitHub starsUsed in 3 repos~7k tokens
    Business, Finance & HRAuto-check: notes
  • Polymarket Trading

    BlockRunAI/blockrun-mcp

    Lets the agent place, manage and redeem real-money Polymarket bets through ClawRouter, with a dry-run preview and your confirmation before any order.

    392 GitHub stars~1.8k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Digital Oracle

    komako-workshop/digital-oracle

    Answer prediction questions using market trading data, not opinions.

    867 GitHub stars~5.9k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • Web3 Polymarket

    Polymarket/agent-skills

    Polymarket integration for prediction market trading on Polygon.

    191 GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Polymarket Trading

    BlockRunAI/ClawRouter

    A skill your agent uses when the user wants to actually PLACE, manage, or redeem bets on Polymarket (not just read odds — that's the blockrunpredexon data tools).

    6.6k GitHub stars~1.4k tokensUpdated 2 days ago
    Business, Finance & HRAuto-check passed

Works with

Questions about Polyclaw

What does Polyclaw do?

Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw. Polyclaw is an agent skill from chainstacklabs/polyclaw. Trade on Polymarket via split + CLOB execution.

When should I use Polyclaw?

Polyclaw fits situations like: tasks that involve Trading and backtesting; tasks that involve Crypto and DeFi analysis.

How do I install Polyclaw in Claude Code?

Run `npx skills add chainstacklabs/polyclaw --skill polyclaw -a claude-code`. Or copy the skill folder (the chainstacklabs/polyclaw repository) into .claude/skills/polyclaw in your project. Claude Code loads it when a task matches its description.

How do I install Polyclaw in Codex?

Run `npx skills add chainstacklabs/polyclaw --skill polyclaw -a codex`. Or copy the skill folder (the chainstacklabs/polyclaw repository) into .agents/skills/polyclaw in your project. Codex loads it when a task matches its description.

Can I use Polyclaw in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add chainstacklabs/polyclaw --skill polyclaw -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/polyclaw, .gemini/skills/polyclaw, .github/skills/polyclaw and .opencode/skills/polyclaw in your project.

What does Polyclaw need to run?

Going by SKILL.md and its folder, Polyclaw needs Python for the scripts in its folder, the command-line tools its instructions call (uv) and credentials named POLYCLAW_PRIVATE_KEY and OPENROUTER_API_KEY. Our summary lists: Python 3; A credential in POLYCLAW_PRIVATE_KEY; A credential in OPENROUTER_API_KEY.

Does Polyclaw access the network?

SKILL.md names 1 domain. In commands or code: geo.iproyal.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Polyclaw safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Polyclaw use?

Polyclaw is published under the Apache-2.0 licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Polyclaw use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Polyclaw?

Skills that share tags, products or a category with Polyclaw: Crypto Hft (alsk1992/CloddsBot, 2.9k stars), Bankr (majiayu000/claude-skill-registry, 666 stars), Polymarket Trading (BlockRunAI/blockrun-mcp, 392 stars) and Digital Oracle (komako-workshop/digital-oracle, 867 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Polyclaw?

chainstacklabs (a GitHub organization) maintains it in chainstacklabs/polyclaw, which has 360 GitHub stars. The repository was last updated on April 28, 2026.

Source: chainstacklabs/polyclaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.