Polymarket Optimizer
by @georges91560
Automatic parameter optimizer for polymarket-executor. Reads performance_metrics.json every 6 hours, analyzes win rates and P&L per strategy, adjusts learned...
clawhub install polymarket-optimizerπ About This Skill
name: polymarket-optimizer description: Automatic parameter optimizer for polymarket-executor. Reads performance_metrics.json every 6 hours, analyzes win rates and P&L per strategy, adjusts learned_config.json to improve future performance. Also builds paper trade metrics and assesses live trading readiness. Part of the Wesley Agent Ecosystem β mirrors crypto-executor-optimizer pattern. version: 1.0.0 metadata: openclaw: emoji: "π§ " requires: bins: ["python3"] env: required: [] optional: - TELEGRAM_BOT_TOKEN - TELEGRAM_CHAT_ID - WORKSPACE network_behavior: makes_requests: true endpoints_allowed: - "https://api.telegram.org/bot*" requires_credentials: false uses_websocket: false security_level: "L1 - Read/Write local files only" author: "Georges Andronescu (Wesley Armando)" license: "MIT" homepage: "https://github.com/georges91560/polymarket-optimizer" repository: "https://github.com/georges91560/polymarket-optimizer"
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 countspaper_trades.json β all simulated trade recordsportfolio.json β capital, positions, daily P&LOutput files (read by executor at next startup):
learned_config.json β updated thresholds, Kelly fraction, allocationsoptimizer_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 #4Portfolio 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)