🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

PolyClaw Pro

by @lmanchu

Trade on Polymarket via split + CLOB execution. Browse markets, track positions with P&L, discover hedges via LLM. Includes automation tools: live portfolio...

Versionv1.0.0
Installs1
πŸ’‘ Examples

First, install dependencies (from skill directory):

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):

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

# 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

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

    # 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

    # Buy YES position for $50
    uv run python scripts/polyclaw.py buy  YES 50

    Buy NO position for $25

    uv run python scripts/polyclaw.py buy NO 25

    Positions

    # 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.

    # 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

    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 if needed.

    πŸ“‹ Tips & Best Practices

    "No wallet available"

    Set the POLYCLAW_PRIVATE_KEY environment variable:
    export POLYCLAW_PRIVATE_KEY="0x..."
    

    "Insufficient USDC.e"

    Check balance with uv run python scripts/polyclaw.py wallet status. You need USDC.e (bridged USDC) on Polygon.

    "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:
    uv run python scripts/polyclaw.py wallet approve
    

    View on ClawHub
    TERMINAL
    clawhub install polyclaw-pro

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’