Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/deniszidbaev-cmyk/polyclaw-cmyk/llms.txt

Use this file to discover all available pages before exploring further.

PolyClaw is designed as an OpenClaw skill, which means you can control all trading operations through natural language prompts in Claude instead of typing CLI commands.

What is OpenClaw?

OpenClaw is a Claude-based automation framework that routes natural language requests to registered skills. When PolyClaw is installed, it registers itself as the polyclaw skill with the 🦞 emoji, and Claude learns to translate your plain-English requests into the correct CLI invocations behind the scenes. Before using PolyClaw through OpenClaw, make sure you have:
  • uv binary installed and available on your PATH
  • CHAINSTACK_NODE environment variable set (Polygon RPC URL)
  • POLYCLAW_PRIVATE_KEY environment variable set (your EVM private key)

Example prompts

Ask Claude:
“Show me details for market <market_id>”
Returns full market info including the question text, current YES and NO prices, volume, and a direct link to the market on polymarket.com.
Ask Claude:
“What’s my PolyClaw wallet balance?”
Shows your wallet address, POL balance (used for gas), pUSD balance (trading collateral), and USDC.e balance. If you have USDC.e but no pUSD, you need to wrap it via the Collateral Onramp contract before trading.
Ask Claude:
“Buy $50 YES on market <market_id>”
PolyClaw executes the full split + CLOB flow: it splits $50 pUSD into YES and NO tokens via the CTF contract, then sells the NO tokens on the CLOB order book to recover partial cost. The resulting YES position is recorded in your local positions file.
Ask Claude:
“Find me some hedging opportunities on Polymarket”
or, more specifically:
“Run hedge scan limit 10”
This triggers the full LLM hedge scan, which fetches open markets and sends pairs to the language model for logical implication analysis. This takes a few minutes. Results are returned as a table of coverage tiers and market pairs:
  • T1 — ≥95% coverage (near-arbitrage)
  • T2 — 90–95% coverage (strong hedges)
  • T3 — 85–90% coverage (moderate risk)
Ask Claude:
“Show my PolyClaw positions”
Lists all open positions with entry price, current price, and unrealized P&L. Positions are read from ~/.openclaw/polyclaw/positions.json.
Ask Claude:
“Sell my YES position on market <market_id>”
Sells your tokens on the CLOB order book at the current market price, using a FOK (Fill or Kill) order placed 10% below the last price to match available buy orders.

Full example trading flow

1

Discover markets

Ask: “What’s trending on Polymarket?”Copy the market IDs from the response — you’ll need them for the next steps.
2

Run a hedge scan

Ask: “Run hedge scan limit 10”Wait a few minutes while the LLM analyzes pairs for logical implication relationships. When it finishes, you’ll see a ranked table of hedge opportunities with coverage tiers.
3

Review coverage tiers

Look for T1 (≥95%) and T2 (90–95%) opportunities. Each row shows the target market, the covering market, the combined cost, and the coverage percentage. Higher coverage means less residual risk.
4

Take the target position

Ask: “Buy $25 YES on market abc123”PolyClaw executes the split + CLOB trade and records the position.
5

Take the covering position

Ask: “Buy $25 NO on market xyz789”This is the hedge leg. Together, the two positions form a portfolio that is covered in most resolution scenarios.
6

Verify your entries

Ask: “Show my PolyClaw positions”Confirm both positions are recorded with the correct entry prices. Track P&L as the markets resolve.

Installation as an OpenClaw skill

Install PolyClaw from ClawHub and sync its Python dependencies:
clawhub install polyclaw
cd ~/.openclaw/skills/polyclaw
uv sync
Then add the skill configuration to your openclaw.json:
"polyclaw": {
  "enabled": true,
  "env": {
    "CHAINSTACK_NODE": "https://polygon-mainnet.core.chainstack.com/YOUR_KEY",
    "POLYCLAW_PRIVATE_KEY": "0x...",
    "OPENROUTER_API_KEY": "sk-or-v1-..."
  }
}
Where to get each key: Before your first trade, run the one-time approval setup (costs ~0.01 POL in gas):
uv run python scripts/polyclaw.py wallet approve

Skill metadata

PolyClaw’s SKILL.md manifest declares it to OpenClaw with the following metadata:
name: polyclaw
description: "Trade on Polymarket via split + CLOB execution. Browse markets, track positions with P&L, discover hedges via LLM. Polygon/Web3."
FieldValue
Emoji🦞
Homepagehttps://polymarket.com
Primary envPOLYCLAW_PRIVATE_KEY
Required binariesuv
Required env varsCHAINSTACK_NODE, POLYCLAW_PRIVATE_KEY
PolyClaw CLI also works independently without OpenClaw. Export the environment variables directly in your shell and run commands with uv run python scripts/polyclaw.py <command> — for example:
export POLYCLAW_PRIVATE_KEY="0x..."
export CHAINSTACK_NODE="https://polygon-mainnet.core.chainstack.com/YOUR_KEY"
uv run python scripts/polyclaw.py markets trending
uv run python scripts/polyclaw.py buy <market_id> YES 50

Build docs developers (and LLMs) love