This page walks you through the complete PolyClaw onboarding flow: installing the skill, gathering the three keys you need, wiring them into your configuration, running the one-time contract approval step, and placing your first Polymarket trade. The whole process takes under ten minutes if you already have an EVM wallet.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.
Install PolyClaw
PolyClaw is distributed via ClawHub and managed with uv. Make sure Option A — ClawHub install (recommended)Option B — Manual install
uv is available on your system before proceeding.uv sync resolves and installs all Python dependencies declared in pyproject.toml (including web3, py-clob-client-v2, rich, and python-dotenv) into an isolated virtual environment.Get Your Three Required Keys
PolyClaw needs three credentials to function. Collect them all before moving on.Chainstack Polygon node (required for trading)PolyClaw sends all on-chain transactions through a dedicated Polygon mainnet RPC node.
- Sign up at console.chainstack.com — free tier available, sign up with GitHub, X, or Google.
- Create a new project and deploy a Polygon mainnet node.
- Copy the HTTPS endpoint URL (format:
https://polygon-mainnet.core.chainstack.com/YOUR_KEY).
- Create a key at openrouter.ai/settings/keys.
- A free tier is available; no credit card required to start.
- Use a dedicated wallet — do not reuse a wallet that holds significant funds.
- Export the private key in hex format (with or without the
0xprefix). - Fund it with a small amount of POL (for gas) and pUSD (for collateral).
Configure Environment Variables
PolyClaw is configured entirely through environment variables. Choose the approach that matches how you are running it.OpenClaw users — Standalone users — export directlyAlternatively, create a
openclaw.jsonAdd the following block under skills.entries in your openclaw.json:.env file in the skill root directory (~/.openclaw/skills/polyclaw/.env). PolyClaw loads it automatically via python-dotenv on every invocation.See the Configuration page for the full list of optional variables, including proxy settings (
HTTPS_PROXY, CLOB_MAX_RETRIES) and the optional POLY_BUILDER_CODE for order attribution.Set Contract Approvals (One-Time)
Before your first trade, you must authorize Polymarket’s smart contracts to move tokens on your behalf. This is a one-time step per wallet.This submits 6 approval transactions to Polygon mainnet contracts (CTF, CTF Exchange V2, Neg Risk CTF Exchange V2, and related contracts). Each transaction costs a small amount of POL in gas — the total is roughly ~0.01 POL.
Browse Markets and Place Your First Trade
With approvals set, you are ready to trade. The typical flow looks like this:1. Check your wallet balancesDisplays your wallet address, POL balance (for gas), pUSD balance (trading collateral), and USDC.e balance. Trades require pUSD — if you only have USDC.e, wrap it 1:1 via the Collateral Onramp.2. Discover trending marketsReturns the top markets by 24-hour volume, including market IDs, questions, current YES/NO prices, and volume figures.3. Buy a positionReplace Lists all open positions with entry price, current market price, and live P&L.Full example flow
<market_id> with the ID from the trending output above. This command:- Splits
$25pUSD into 25 YES + 25 NO tokens via the CTF contract - Sells the 25 NO tokens on the CLOB order book at the current market price
- Records the resulting YES position locally with entry price and token count
What’s Next
Configuration
Full reference for all environment variables, including proxy settings and optional builder code attribution.
Browse Markets
Detailed reference for
markets trending, markets search, and market <id> commands.Trading Reference
Full reference for the
buy command, split + CLOB execution flow, and the --skip-sell flag.Trading Flow Concepts
Understand how the split mechanism and CLOB order book work together to produce a directional position.
Hedge Discovery
Use
hedge scan and hedge analyze to find LLM-validated covering portfolio opportunities.Troubleshooting
Solutions for common issues: Cloudflare CLOB blocks, insufficient pUSD, approval errors, and more.