chainstacklabs/polyclaw
Overview
This skill enables trading on Polymarket via a split + CLOB execution flow, integrated into OpenClaw. It lets you browse markets, manage a Polygon wallet, execute buy orders by splitting USDC.e into YES/NO tokens and selling the unwanted side, and track positions with entry prices and P&L. An LLM-powered hedge discovery feature helps uncover covering portfolios across markets.
How this skill works
The skill splits USDC.e into YES and NO conditional tokens using the CTF contract, then attempts to sell the unwanted side through Polymarket's CLOB order book to recover cost. It tracks entry prices, current market prices, and P&L for positions. Hedge discovery uses an LLM to search and analyze logical relationships between markets and propose pairs that provide coverage and near-arbitrage opportunities.
When to use it
- When you want to buy a single-side position on Polymarket while recovering part of the cost via CLOB sales
- When you need to browse and search Polymarket markets programmatically
- When tracking open positions, entry prices, and real-time P&L across markets
- When exploring hedging or near-arbitrage relationships between markets using LLM assistance
- When automating trades on Polygon with an env-var configured wallet
Best practices
- Store only small balances in the trading wallet and withdraw profits regularly
- Run the one-time contract approval step before trading to avoid failed transactions
- Use a rotating residential HTTPS proxy for reliable CLOB POST requests to avoid Cloudflare blocks
- Set CLOB_MAX_RETRIES to a higher value when using proxies to allow automatic IP rotation
- Validate hedges by checking coverage, cost, and liquidity before executing both legs
Example use cases
- Buy YES on a trending political market: split USDC.e, sell NO on the CLOB, and record entry for P&L tracking
- Scan trending markets for Tier 1 or Tier 2 hedges and construct a covering portfolio with minimal net cost
- Automate position reporting for multiple markets and export JSON for analytics
- Debug a failed CLOB sell by following the tool's retry logs and then manually selling remaining tokens on polymarket.com
- Search markets by keyword and fetch full market JSON for custom off-chain analysis
FAQ
Run the one-time wallet approve command to submit required contract approvals on Polygon; it costs a small ~0.01 POL gas total.
Why did my CLOB sell fail?
Failures usually stem from Cloudflare blocking POSTs or insufficient liquidity. Use a rotating residential HTTPS proxy and increase CLOB_MAX_RETRIES, or use --skip-sell and sell manually.
How is the hedge discovery powered?
An LLM analyzes logical implications across market questions to propose covering portfolios; model choice affects quality, so override with --model if needed.