What This Agent Does
The agent scans a focused Polymarket universe, fetches market context and news, asks OpenAI for a structured probability assessment, applies risk rules, and then either skips or places a trade. Every run is written into D1 for later review.
The current v1 universe is centered on macro and finance-style markets using Gamma tag discovery plus keyword filtering. Sports, politics, celebrity, and novelty markets are not the intended production focus.
Current Cadence
Hourly run: every hour at minute 5, the agent scans markets, evaluates candidates, and records analyses. In dry-run mode it never places real orders.
Midnight backfill: at midnight UTC, the agent checks expired markets, fetches final outcomes, marks analyses correct or incorrect, and resolves open positions in D1.
Controls
Agent Enabled: master pause switch. When off, scheduled runs and scheduled backfills do nothing.
Dry Run: analysis-only mode. When on, the agent can still analyze, log, and backfill, but it will not place real orders.
Run Now: manually triggers the normal scan-and-analyze loop immediately.
Run Backfill: manually triggers the midnight resolution job immediately.
Dashboard Pages
Overview: balances, positions, recent analyses, transactions, controls, and recent resolved positions.
Parameters: live D1-backed settings such as risk caps, market filters, time window, and dry-run mode.
Analytics: P&L, AI cost, calibration buckets, resolved outcomes, probability error, and recent claim activity.
How Decisions Are Made
For each candidate market, the agent combines market metadata, orderbook context, recent news, and a snapshot of existing positions. OpenAI returns an estimated probability, a confidence score, a recommendation, and reasoning.
The agent then applies minimum confidence, minimum edge, Kelly-style sizing, spend caps, open-position limits, and reserve rules. If any check fails, the analysis is kept but the trade is skipped.
Current v1 Assumptions
Bankroll is currently $141. That is enough to keep hourly dry-run testing and later do a tiny live trade, but not enough to support aggressive multi-position experimentation.
The current safe plan is to keep dry-run enabled for several days, review analysis quality and costs, then run a single live trade of about $1 after the remote behavior looks stable.
Important Parameters To Watch
max_days_to_resolution: the most important current filter. With macro markets, 60 days is too tight and may produce few or no candidates. For the current macro universe, use 365.
market_tag_ids: currently points at the Macro Indicators universe.
max_trade_size_usdc and max_daily_spend_usdc: keep these small until live behavior is proven.
What Backfill Produces
Backfill attaches the true market outcome to past analyses. That lets the dashboard show AI accuracy, confidence calibration, and average probability error.
This is how you will judge whether the model is actually useful. It does not automatically retrain the model, but it creates the evidence needed to improve prompts, filters, and later fine-tuning datasets.
Pre-Live Checklist
1. Keep agent_enabled = true and dry_run = true.
2. Set max_days_to_resolution = 365 for the current macro universe.
3. Let the hourly cron run for 3 to 5 days.
4. Review costs, analyses, and backfill outcomes.
5. Only then switch dry-run off and allow a single tiny live trade.