AI Prediction Market Automation: Why Manual Trading Doesn't Scale
Prediction markets like Polymarket move fast. Dozens of markets open and close daily across politics, economics, science, and sports. A developer who wants to test a hypothesis — "does sentiment analysis on news headlines predict market resolution better than pure probability tracking?" — can't validate it by watching markets manually for three months.
The Polymarket Autopilot agent automates this. It ingests market data, applies a configurable prediction strategy, executes paper trades (no real funds at risk), logs every decision with reasoning, and delivers a daily performance report. Backtesting against historical resolved markets lets you validate a strategy before running it forward in time.
This is one of the more technically involved OpenClaw use cases in the Finance & Trading category — and one of the most useful for developers who want to build a systematic edge before committing real capital.
⚠️ Not investment advice. This tutorial is for educational and research purposes only. Paper trading and backtesting do not guarantee future results.
By the end of this tutorial you'll have a paper trading agent monitoring Polymarket, applying a strategy you configure, logging every position with reasoning, and reporting daily P&L — all without touching real funds. Test the prediction prompt at wisgate.ai/studio/image before activating the agent. Get your key at wisgate.ai/hall/tokens.
What the Polymarket Autopilot Agent Does
Three operational modes, all configurable from the same OpenClaw setup:
| Mode | Trigger | Output |
|---|---|---|
| Paper trading | Scheduled cron (e.g., every 4 hours) | Simulated positions with entry rationale logged |
| Backtesting | Manual run against historical data | Accuracy report on resolved markets |
| Daily report | Cron, once per day | P&L summary, win rate, open positions, strategy notes |
The agent never executes real trades. All positions are logged to a local portfolio.json file. The backtesting mode reads a historical dataset of resolved Polymarket markets and scores the agent's predicted outcomes against actual resolutions.
OpenClaw + WisGate Configuration
Step 1 — Open the configuration file
nano ~/.openclaw/openclaw.json
Step 2 — Add the WisGate provider
This agent uses Claude Opus 4.6 for prediction reasoning — assessing market probability, news signals, and base rates requires the deeper context synthesis that Opus handles well. Paste into your models section:
"models": {
"mode": "merge",
"providers": {
"moonshot": {
"baseUrl": "https://api.wisgate.ai/v1",
"apiKey": "WISGATE-API-KEY",
"api": "openai-completions",
"models": [
{
"id": "claude-opus-4-6",
"name": "Claude Opus 4.6",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 256000,
"maxTokens": 8192
}
]
}
}
}
Replace WISGATE-API-KEY with your key from wisgate.ai/hall/tokens. Confirm claude-opus-4-6 pricing at wisgate.ai/models.
Step 3 — Save and restart
Ctrl + O→Enter→Ctrl + Xto save and exitCtrl + Cto stop, then runopenclaw tui
Note: OpenClaw was previously known as ClawdBot and MoltBot. These steps apply to all versions.
Polymarket Data Ingestion
The agent fetches market data from Polymarket's public API before each prediction cycle.
Market fetch configuration (polymarket-config.yaml):
data_sources:
polymarket_api:
endpoint: "https://clob.polymarket.com/markets"
filters:
min_liquidity: 5000 # USD — skip illiquid markets
max_days_to_resolution: 30 # Focus on near-term markets
categories: # Filter by category
- politics
- economics
- science
max_markets_per_run: 20 # Evaluate top 20 by liquidity
news_headlines:
sources:
- rss: "https://feeds.reuters.com/reuters/topNews"
- rss: "https://feeds.bbci.co.uk/news/rss.xml"
lookback_hours: 24 # Headlines from the last 24 hours only
The agent fetches up to 20 markets per run, filtered by liquidity and resolution horizon. News headlines are pulled from RSS feeds and passed alongside market data to the prediction prompt — the model can weigh news signals against the current market odds.
OpenClaw API Trading Agent Configuration: The Prediction System Prompt
The prediction prompt is the agent's core strategy. Customize it to test different approaches — pure probability analysis, sentiment-weighted, news-driven, or base-rate anchored.
You are a prediction market analyst. You are not a financial advisor.
This is a paper trading exercise for research purposes only.
INPUT: a list of Polymarket markets with current odds, liquidity, and
recent news headlines relevant to each market.
FOR EACH MARKET, produce a structured assessment:
{
"market_id": "[ID]",
"question": "[MARKET QUESTION]",
"current_yes_price": [FLOAT — current probability as decimal],
"predicted_outcome": "YES" | "NO" | "SKIP",
"confidence": [1-10],
"reasoning": "2–3 sentences: key signal, base rate consideration, news factor",
"edge": "POSITIVE" | "NEUTRAL" | "NEGATIVE",
"paper_position_size": [0-100 — simulated USD, scaled by confidence]
}
Strategy rules:
- Only take positions where confidence >= 6
- Maximum paper position: $100 simulated USD per market
- Skip markets where news is ambiguous or contradictory
- Edge is POSITIVE if your predicted probability differs from market
price by more than 0.08 in your favor
- Never fabricate citations. If you cite a news item, it must appear
in the provided headlines. Flag uncertain claims.
Return a JSON array. No preamble.
The 256,000-token context window in Opus means the agent can evaluate all 20 markets plus their associated news headlines in a single call — no batching required.
LLM Backtesting Agent: Scoring Against Resolved Markets
The backtesting mode reads a local file of resolved Polymarket markets and scores the agent's predicted outcomes against actual resolutions.
Historical data format (historical_markets.json):
[
{
"market_id": "polymarket-12345",
"question": "Will X happen before Y date?",
"resolution": "YES",
"resolved_at": "2025-11-15",
"closing_price": 0.82
}
]
Backtest cron entry (run once to score historical performance):
openclaw run --agent polymarket-autopilot --mode backtest \
--data historical_markets.json \
--output backtest_results.json
The backtest report calculates: overall accuracy (predicted vs resolved), calibration (was confidence 8 actually right ~80% of the time?), and edge identification (which market categories showed the most predictive signal). Calibration is the most useful metric — a well-calibrated agent that knows when it doesn't know is more valuable than a high-confidence agent that is systematically wrong.
Daily Performance Report and Cron Schedule
Four-stage cron — data fetch, prediction, paper trade, report:
0 6 * * * openclaw run --agent polymarket-autopilot --mode fetch
30 6 * * * openclaw run --agent polymarket-autopilot --mode predict
0 7 * * * openclaw run --agent polymarket-autopilot --mode paper-trade
0 20 * * * openclaw run --agent polymarket-autopilot --mode report
Daily report format (daily_report.md):
=== POLYMARKET AUTOPILOT — DAILY REPORT [DATE] ===
PAPER PORTFOLIO SUMMARY
Open positions: [N] | Total simulated exposure: $[X]
Today's P&L: +/- $[X] (simulated)
Cumulative P&L: +/- $[X] (simulated)
POSITIONS OPENED TODAY
[Market question] | YES/NO @ $[price] | Size: $[X] | Confidence: [N]/10
POSITIONS RESOLVED TODAY
[Market question] | Predicted: YES | Resolved: YES ✓ | P&L: +$[X]
WIN RATE (last 30 days): [X]% | Calibration score: [X]
STRATEGY NOTES
[Agent's 2-sentence observation on today's market conditions]
Generated by OpenClaw via WisGate — paper trading only, not investment advice
All figures are simulated. The portfolio.json file maintains running state across runs — positions opened in previous cycles are tracked until resolution.
OpenClaw Use Cases: Token Cost Per Day
Daily token estimate:
| Operation | Model | Calls/day | Tokens/call | Daily tokens |
|---|---|---|---|---|
| Market prediction (20 markets) | Opus | 1 | ~8,000 | ~8,000 |
| Daily report generation | Opus | 1 | ~2,000 | ~2,000 |
| Daily total | Opus | 2 | — | ~10,000 |
Confirm claude-opus-4-6 pricing from wisgate.ai/models before projecting monthly cost. At two Opus calls per day, the daily token consumption is predictable — the prediction call is the largest, driven by the number of markets evaluated.
The paper trading constraint matters here beyond just risk management: it lets you run the agent continuously for 30–60 days to build a statistically meaningful backtest record before ever considering real positions. The cost of that research period is two Opus API calls per day.
OpenClaw Use Cases: Running Your First Paper Trade
The agent is configured. The prediction prompt is ready. The cron schedule will run fetch, predict, paper-trade, and report in four daily steps.
Before activating the full schedule, validate the prediction prompt against real market data: fetch a sample of current Polymarket markets manually, paste the data into wisgate.ai/studio/image with claude-opus-4-6 selected, and confirm the output JSON is well-formed and that confidence scores look reasonable before the first automated run.
Deployment sequence: configure polymarket-config.yaml → run one manual prediction cycle → review portfolio.json for output quality → run backtest against historical data → activate the daily cron.
All configuration is on this page. This is a paper trading research tool — no real funds are involved at any step. Get your WisGate key at wisgate.ai/hall/tokens, validate the prediction prompt at wisgate.ai/studio/image, and run the first manual cycle before activating the daily cron. Not investment advice.