โ† Back to skills
extension
Category: Data & AnalyticsNo API key required

Polymarket Optimizer

Automatic parameter optimizer for polymarket-executor. Reads performance_metrics.json every 6 hours, analyzes win rates and P&L per strategy, adjusts learned...

personAuthor: georges91560hubclawhub

Polymarket Optimizer โ€” Adaptive Parameter Tuner

๐Ÿง  WHAT IT DOES

Reads trading performance from polymarket-executor, analyzes what works, and adjusts parameters automatically.

Runs every 6 hours via OpenClaw cron job. Zero manual intervention required.

Input files (written by executor):

  • performance_metrics.json โ€” per-strategy win rates, P&L, trade counts
  • paper_trades.json โ€” all simulated trade records
  • portfolio.json โ€” capital, positions, daily P&L

Output files (read by executor at next startup):

  • learned_config.json โ€” updated thresholds, Kelly fraction, allocations
  • optimizer_log.jsonl โ€” full history of every optimization run

โšก QUICK START

cd /data/.openclaw/workspace/skills/polymarket-optimizer
python3 polymarket_optimizer.py

Expected output:

============================================================
POLYMARKET OPTIMIZER v1.0.0
Run time: 2026-03-05 14:00:00 UTC
============================================================
[CONFIG] Loaded. Optimization #1
[PORTFOLIO] Health: HEALTHY
[PORTFOLIO] Capital: $102.34 | Return: 2.3%
[ANALYSIS] parity_arbitrage: EXCELLENT | WR=100.0% | Trades=8 | P&L=+0.523
[ANALYSIS] tail_end: GOOD | WR=75.0% | Trades=12 | P&L=+0.312
[OPTIMIZER] 2 adjustments made:
  ๐Ÿš€ parity_arb excellent โ†’ min_profit 0.020 โ†’ 0.015
  ๐Ÿ“ˆ parity_arb allocation 30% โ†’ 40%
[READINESS] Resolved trades: 8/30
[READINESS] Win rate: 84.6% (need 55%+)
[TELEGRAM] Report sent.
============================================================
OPTIMIZER COMPLETE
============================================================

๐Ÿ”ง WHAT IT ADJUSTS

Strategy Thresholds

| If strategy is... | Action | |---|---| | Poor (WR < 50%) | Raise threshold โ†’ trade only best opportunities | | Underperforming (WR 50โ€“65%) | Slight threshold increase | | Average (WR 65โ€“80%) | No change | | Good (WR 65โ€“80%, positive P&L) | No change | | Excellent (WR > 80%) | Lower threshold โ†’ capture more volume |

Capital Allocation

| If strategy is... | Action | |---|---| | Poor | Reduce allocation (min 5โ€“10%) | | Excellent | Increase allocation (max 50โ€“70%) |

Allocations always normalized to sum to 100%.

Kelly Fraction

| Portfolio health | Action | |---|---| | Critical (return < -10%) | Reduce Kelly โ†’ smaller positions | | Excellent (return > 10%, WR > 65%) | Increase Kelly โ†’ larger positions |

Scan Frequency

| Condition | Action | |---|---| | WR > 80% + 20+ trades | Scan faster (min 120s) | | Portfolio warning/critical | Scan slower (max 600s) |


๐Ÿ“Š LIVE READINESS ASSESSMENT

Every run evaluates whether paper trading results justify going live.

4 criteria must ALL pass:

| Criterion | Threshold | |---|---| | Resolved trades | โ‰ฅ 30 | | Win rate | โ‰ฅ 55% | | Total P&L | Positive | | Circuit breaker | Not active |

Telegram report includes readiness status automatically.


๐Ÿ“ฑ TELEGRAM REPORT

๐Ÿง  POLYMARKET OPTIMIZER REPORT
๐Ÿ• 2026-03-05 14:00 UTC
๐Ÿ”„ Optimization #4

Portfolio Health: ๐ŸŸข HEALTHY
๐Ÿ’ฐ Capital: $108.45
๐Ÿ“ˆ Return: 8.5%
๐ŸŽฏ Win Rate: 76.9%
๐Ÿ“Š Total Trades: 20

Strategy Performance:
  ๐Ÿš€ parity_arbitrage: 100.0% WR | 8 trades | P&L: +0.523
  โœ… tail_end: 75.0% WR | 12 trades | P&L: +0.312

Adjustments Made:
  ๐Ÿš€ parity_arb excellent โ†’ min_profit 0.020 โ†’ 0.015
  ๐Ÿ“ˆ parity_arb allocation 30% โ†’ 40%
  โš–๏ธ Allocations renormalized

Live Trading Readiness:
๐Ÿ”ด NOT YET READY
  โŒ Need 30+ resolved trades
  ๐Ÿ“Š Progress: 20/30 trades
  ๐ŸŽฏ Win rate: 76.9% (need 55%+) โœ…

๐Ÿ“ FILES

| File | Location | Description | |---|---|---| | polymarket_optimizer.py | skills/polymarket-optimizer/ | Main optimizer script | | learned_config.json | WORKSPACE/ | Output โ€” read by executor | | optimizer_log.jsonl | WORKSPACE/ | Full optimization history |


โฐ CRON JOB

Add to OpenClaw cron configuration:

# Run optimizer every 6 hours
0 */6 * * * docker exec openclaw-yyvg-openclaw-1 python3 /data/.openclaw/workspace/skills/polymarket-optimizer/polymarket_optimizer.py

Version: 1.0.0 | License: MIT | Author: Georges Andronescu (Wesley Armando)