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 brings full Polymarket trading capability to OpenClaw — browse prediction markets, execute YES/NO positions on Polygon via split + CLOB execution, track your portfolio with live P&L, and surface hedging opportunities using LLM-powered logical implication analysis.

Quickstart

Install PolyClaw, configure your keys, and execute your first trade in minutes.

Configuration

Set up environment variables for trading, LLM hedge discovery, and proxy support.

Command Reference

Every CLI command, subcommand, and flag documented with real examples.

Concepts

Understand the split + CLOB trading flow and how LLM hedge discovery works.

What PolyClaw Does

PolyClaw is a Python CLI skill that integrates with OpenClaw (Claude-powered automation) to give you programmatic access to Polymarket — the leading on-chain prediction market platform on Polygon.

Market Browsing

Browse trending markets by 24h volume or search by keyword. Get full market details including YES/NO prices, liquidity, and resolution status.

On-Chain Trading

Buy YES or NO positions via Polymarket’s split + CLOB V2 mechanism. Your pUSD is split into outcome tokens; the unwanted side is sold back on the order book.

Position Tracking

All trades are recorded locally with entry price, current price, and P&L. Positions persist in ~/.openclaw/polyclaw/positions.json.

Hedge Discovery

The LLM scans market pairs for logically necessary implications. Coverage tiers (T1–T4) rank opportunities from near-arbitrage down to speculative.

Redemption

After markets resolve, redeem your winning positions directly from the CTF contract to recover pUSD collateral.

OpenClaw Integration

Use natural language prompts via Claude instead of CLI flags. “Find me hedging opportunities” triggers the full scan automatically.

Get Started

1

Install from ClawHub

Install the skill and sync Python dependencies with uv.
clawhub install polyclaw
cd ~/.openclaw/skills/polyclaw
uv sync
2

Configure environment variables

Add your Chainstack RPC node, private key, and OpenRouter API key to 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-..."
  }
}
3

Set contract approvals (one-time)

Before your first trade, grant Polymarket’s contracts permission to move your tokens. This costs ~0.01 POL in gas and only needs to be done once.
uv run python scripts/polyclaw.py wallet approve
4

Execute your first trade

Browse trending markets, then buy a position.
uv run python scripts/polyclaw.py markets trending
uv run python scripts/polyclaw.py buy <market_id> YES 25
PolyClaw is provided for educational and experimental purposes. Trading prediction markets involves risk of loss. Only use funds you can afford to lose. Keep only small amounts in the configured wallet — withdraw regularly to a secure wallet.

Build docs developers (and LLMs) love