polyclaw  by chainstacklabs

Automated prediction market trading and hedging

Created 2 months ago
298 stars

Top 89.1% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

PolyClaw is an OpenClaw skill enabling automated interaction with Polymarket prediction markets. It facilitates market browsing, on-chain trading via split + CLOB execution, position tracking, and LLM-powered hedge discovery. Aimed at technically savvy users, it offers advanced analysis for prediction market strategies.

How It Works

The core innovation lies in LLM-driven hedge discovery, employing contrapositive logic to identify strictly necessary market implications, categorized into coverage tiers (T1: ≥95%, T2: 90-95%, T3: 85-90%). Trading on Polygon uses a split mechanism (USDC.e to YES+NO tokens) followed by CLOB order book execution for the unwanted side, optimizing cost recovery and position establishment.

Quick Start & Requirements

Installation is recommended via clawhub install polyclaw, followed by cd ~/.openclaw/skills/polyclaw && uv sync. Key setup involves configuring environment variables: CHAINSTACK_NODE (Polygon RPC), POLYCLAW_PRIVATE_KEY (EVM private key), and OPENROUTER_API_KEY (for LLM features). A one-time wallet approval transaction (uv run python scripts/polyclaw.py wallet approve) is required before trading. Users need Chainstack and OpenRouter accounts.

Highlighted Details

  • Market Browsing: View trending markets, search by keyword, and inspect detailed market information.
  • On-Chain Trading: Execute buy orders using a split + CLOB flow on Polygon.
  • Position Management: Track open positions with live Profit & Loss (P&L).
  • Hedge Discovery: Leverage LLM analysis (hedge scan, hedge analyze) for hedging opportunities based on logical implications and coverage tiers.
  • Wallet Operations: Check balances and manage contract approvals.

Maintenance & Community

Credits include Chainstack (RPC), Polymarket (platform), and OpenRouter (LLM API). Based on polymarket-alpha-bot. No specific community channels or maintenance contributor details are provided.

Licensing & Compatibility

Released under the Apache 2.0 license, which is permissive for commercial use and integration into closed-source projects.

Limitations & Caveats

Provided "as-is for educational and experimental purposes," not financial advice, and un-audited. Users should risk only affordable funds and maintain minimal wallet balances. CLOB order execution may require specific proxy configurations (HTTPS_PROXY) due to Cloudflare protections. Hedge discovery quality depends on the LLM model.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
97 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.