storyclaw-polymarket-trading

Self-evolving Polymarket trading bot. Design strategy with user, run paper trading, auto-improve until edge target met, then ask to switch to live.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "storyclaw-polymarket-trading" with this command: npx skills add storyclaw-polymarket-trading

Polymarket Trading - Self-Evolving Trading Bot

Design a trading strategy with the user, run automated paper trading (dry-run), auto-improve parameters when underperforming, and ask permission to switch to live trading when edge target met.

Supports any market type: politics, sports, crypto prices, science, entertainment, etc.

Critical Rules

  1. NEVER default to any specific market — always ask user what they want to trade
  2. NEVER show made-up prices or signals — only real script output
  3. DRY RUN always on by default — only switch to live after explicit user confirmation
  4. Auto-improve silently — adjust params and notify user
  5. NEVER create a strategy or set up crons without explicit user confirmation

Multi-User Support

Each user has their own credentials/{USER_ID}.json:

{
  "private_key": "0x...",
  "funder_address": "0x...",
  "dry_run": true
}

Set USER_ID or TELEGRAM_USER_ID env var when calling scripts.

Or set POLYMARKET_PRIVATE_KEY env var.

First-Time User Flow

1. Check credentials

USER_ID=$TELEGRAM_USER_ID python3 {baseDir}/scripts/polymarket.py check

If not configured, run interactive setup:

USER_ID=$TELEGRAM_USER_ID python3 {baseDir}/scripts/polymarket.py setup

2. Ask what they want to trade

Do NOT assume. Ask:

  • What market type? (politics, sports, crypto, tech, etc.)
  • Any specific keywords to focus on?

3. Propose strategy — WAIT FOR CONFIRMATION

Based on the conversation, derive and propose concrete values. Stop and wait for user to confirm before executing anything.

4. Create strategy (only after confirmation)

USER_ID=$TELEGRAM_USER_ID python3 {baseDir}/scripts/strategy_manager.py create --json '{
  "name": "<strategy name>",
  "market_filter": {
    "keywords": ["<keywords>"],
    "min_liquidity_usdc": 1000,
    "max_days_to_expiry": 30,
    "min_days_to_expiry": 1
  },
  "signal": {
    "method": "orderbook_imbalance",
    "params": { "threshold": 0.15, "max_entry_price": 0.60 }
  },
  "sizing": { "max_size_usdc": 5 },
  "targets": { "min_sample_size": 30, "min_edge": 0.05 }
}'

5. Set up crons

SKILL_PATH={baseDir}
STRATEGY_ID=<id from step 4>

# Signal scan: every 15 minutes
(crontab -l 2>/dev/null; echo "*/15 * * * * USER_ID=$TELEGRAM_USER_ID python3 $SKILL_PATH/scripts/signal_cron.py $STRATEGY_ID >> $SKILL_PATH/state/$TELEGRAM_USER_ID.$STRATEGY_ID.log 2>&1") | crontab -

# Performance review: daily at 09:00 UTC
(crontab -l 2>/dev/null; echo "0 9 * * * USER_ID=$TELEGRAM_USER_ID python3 $SKILL_PATH/scripts/review_cron.py $STRATEGY_ID >> $SKILL_PATH/state/$TELEGRAM_USER_ID.review.log 2>&1") | crontab -

Strategy Lifecycle

dry_run → improving → pending_live → live

Go-live condition: edge = win_rate - avg_entry_price >= min_edge AND total_pnl > 0

Strategy Management

USER_ID=$TELEGRAM_USER_ID python3 {baseDir}/scripts/strategy_manager.py status
USER_ID=$TELEGRAM_USER_ID python3 {baseDir}/scripts/strategy_manager.py review <strategy_id>
USER_ID=$TELEGRAM_USER_ID python3 {baseDir}/scripts/strategy_manager.py activate-live <strategy_id>

Auto-Improvement Rules

ConditionAction
edge < min_edge - 10%Raise threshold (fewer but stronger signals)
edge < min_edge - 3%Lower max_entry_price (cheaper entries)
3+ adjustments still failingNotify user to reconsider
edge >= min_edge AND pnl > 0Mark pending_live, notify user

Signal Methods

MethodBest for
orderbook_imbalanceAny liquid market with active orderbook

New methods can be added to scripts/signals.py.

Troubleshooting

ErrorSolution
py-clob-client not installedpip3 install py-clob-client
USER_ID not setAdd USER_ID=xxx prefix
No config foundRun python3 {baseDir}/scripts/polymarket.py setup
API Error 401Re-run setup to re-derive keys
No markets foundBroaden keywords or lower min_liquidity_usdc

File Structure

polymarket-trading/
├── SKILL.md
├── scripts/
│   ├── strategy_manager.py   # Lifecycle: create/review/status/activate-live
│   ├── signal_cron.py        # Cron: scan markets, run signals, record trades
│   ├── review_cron.py        # Cron: daily review + auto-improve
│   ├── signals.py            # Pluggable signal methods
│   ├── market_scanner.py     # Gamma API market discovery
│   └── polymarket.py         # CLOB API primitives
├── credentials/
│   └── {USER_ID}.json
├── strategies/
│   └── {USER_ID}/{strategy_id}.json
└── state/
    └── {USER_ID}.{strategy_id}.perf.json

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Research

Blog Writer Pro

博客写作助手。完整文章生成(Markdown输出)、多角度大纲、SEO优化诊断、开头段落、系列文章规划、风格改写、CTA文案。Blog writer with full articles, outlines, SEO analysis, hooks, series planning, rewriting, CTA...

Registry SourceRecently Updated
Research

aliyun-domain

通过阿里云 OpenAPI 管理域名资产,支持域名查询、续费、转移、注册、信息修改等操作。涉及资金操作时需要用户二次确认。同时提供阿里云国内站域名优惠政策咨询,包括注册活动价格、批量注册优惠、转入优惠、续费折扣、优惠口令等。新增域名、建站、备案行业咨询能力,基于 RAG 检索本地知识库(knowledge/ali...

Registry SourceRecently Updated
Research

Meme Coin Scanner

Scan new meme coins for risks and opportunities — honeypot detection, liquidity analysis, holder concentration, and rug pull indicators using DexScreener and...

Registry SourceRecently Updated
Research

Web Search Plus 2.8.6

Unified search skill with Intelligent Auto-Routing. Uses multi-signal analysis to automatically select between Serper (Google), Tavily (Research), Exa (Neura...

Registry SourceRecently Updated