OpenClaw & Polymarket API Integration Guide

Integrate Polymarket API using the OpenClaw "skills" system to scan for market imbalances, execute logical arbitrage, and automate betting on prediction markets. This guide uses the **PolyClaw** skill as a foundation for combining Python scripts with LLM analysis.

⚠️ Experimental Project

This integration involves real financial risk. Start with small amounts and ensure compliance with local regulations. Never share your private keys.

1. Capabilities

By integrating the PolyClaw skill, OpenClaw can:

2. Prerequisites

3. Installation & Setup

3.1 Install OpenClaw Core

git clone https://github.com/openclaw/openclaw.git
cd openclaw
uv sync

3.2 Configure Environment

Create a .env file with the following variables:

CHAINSTACK_NODE="https://polygon-mainnet.core.chainstack.com/YOUR_API_KEY"
POLYCLAW_PRIVATE_KEY="0xYOUR_PRIVATE_KEY"
OPENROUTER_API_KEY="sk-or-YOUR_KEY"

4. PolyClaw Skill Integration

PolyClaw handles the specific logic for order signing and interaction with the CLOB (Central Limit Order Book) API.

git clone https://github.com/chainstacklabs/polyclaw
cd polyclaw
uv sync

Integrate the script into your OpenClaw skills directory and enable it via the TUI or chat interface.

5. Automated Arbitrage Workflow

5.1 Market Scanning

# Search for specific market themes
uv run python scripts/polyclaw.py markets search "election"

5.2 Arbitrage Analysis (Powered by LLM)

# Scan for logical inconsistencies and price spreads
uv run python scripts/polyclaw.py hedge scan --query "election" --limit 10

5.3 Execution

# Buy shares in a specific market
uv run python scripts/polyclaw.py buy  YES 50

6. Monitoring Positions

uv run python scripts/polyclaw.py positions

This command displays your current P&L, side (YES/NO), and entry prices.

7. Example Chat Commands

Final Security Checklist