Institutional-grade prediction market trading with 114+ tools across 10 skills — on-chain intelligence, social analysis, quantitative modeling, smart execution, counter-intelligence, trading optimization, and self-improving AI agents that learn from every trade.
The Polymarket system gives AI agents the ability to trade prediction markets on Polymarket — the world's largest prediction market platform. It combines:
Everything goes through the standard enterprise permission pipeline — risk levels, side-effect checks, approval queues, guardrails, and audit logging.
Go to Agents → Create Agent and select the "Polymarket Trader" template from the Finance category. This pre-assigns all 9 skills (108 tools). Or assign skills individually:
| Skill | Tools | Purpose |
|---|---|---|
polymarket | 63 | Trading infrastructure, learning |
polymarket-quant | 14 | Mathematical analysis engine |
polymarket-onchain | 6 | Blockchain intelligence |
polymarket-social | 5 | Social media sentiment |
polymarket-feeds | 5 | Event calendar, news, odds |
polymarket-analytics | 5 | Correlation, arbitrage, regime |
polymarket-execution | 4 | Smart order execution |
polymarket-counterintel | 3 | Manipulation detection |
polymarket-portfolio | 3 | Portfolio optimization |
The agent needs an Ethereum wallet with USDC on Polygon. Two options:
Use the Config tab on the dashboard or poly_set_config. Set trading mode, max position, daily loss limit, drawdown threshold.
Send USDC to the wallet on Polygon. Start with paper trading mode to test strategies risk-free.
┌─────────────────────────────────────────────────────────────────────┐ │ POLYMARKET TRADING SYSTEM │ │ 108 tools · 9 skills │ ├─────────────┬──────────────┬──────────────┬──────────────────────────┤ │ INTELLIGENCE │ EXECUTION │ LEARNING │ │ │ │ │ │ On-Chain (6) │ Trading (63) │ Journal │ │ · Whale tracking │ · Orders, positions │ Calibr. │ │ · Orderbook depth │ · Risk controls │ Strategy │ │ · Net flow analysis │ · Wallet management │ Lessons │ │ · Wallet profiling │ │ P&L Attr │ │ · Liquidity mapping │ Execution Edge (4) │ │ │ · TX decoding │ · Sniper orders │ │ │ │ · TWAP/VWAP scale-in │ │ │ Social (5) │ · Hedging │ │ │ · Twitter sentiment │ · Exit strategies │ │ │ · Reddit pulse │ │ │ │ · Telegram monitor │ Portfolio (3) │ │ │ · Polymarket comments │ · Optimizer │ │ │ · Velocity tracking │ · Drawdown monitor │ │ │ │ · P&L attribution │ │ │ Feeds (5) │ │ │ │ · Event calendar │ Counter-Intel (3) │ │ │ · Official sources │ · Manipulation detector │ │ │ · Odds aggregator │ · Resolution risk │ │ │ · Breaking news │ · Counterparty analysis │ │ │ · Resolution tracking │ │ │ │ │ Quant Engine (14) │ │ │ Analytics (5) │ · Kelly, Black-Scholes │ │ │ · Correlation detection │ · Monte Carlo, Bayesian │ │ │ · Arbitrage scanning │ · RSI, MACD, Bollinger │ │ │ · Regime detection │ · VaR, Entropy, Hurst │ │ │ · Smart money index │ · Signal generator │ │ │ · Microstructure │ │ │ └─────────────┴──────────────┴──────────────┴──────────────────────────┘
Breaking News ──→ Social Velocity ──→ Sentiment Analysis ──→ ┐
Official Sources ──→ Event Calendar ──→ Resolution Track ──→ ├→ Smart Money Index ──→ Signal Generation
Whale Tracker ──→ Orderbook Depth ──→ On-Chain Flow ─────→ ┘ │
↓
Manipulation Check ──→ Resolution Risk ──→ Counterparty ──→ Risk Gate
↓
Kelly Criterion ──→ Position Sizing ──→ Execution (Sniper/TWAP) ──→ Trade
↓
Exit Strategy ──→ Drawdown Monitor ──→ Portfolio Optimizer Record Prediction
↓
Resolve → Review → Lesson → Calibrate → Improve
Promise.all for multi-token analysis, cross-platform sentiment| Mode | How It Works | Best For |
|---|---|---|
| Approval | Agent queues trades → humans approve/reject on dashboard. Auto-approve rules for small trades. | Production, compliance, learning the system |
| Autonomous | Agent trades within risk limits. Circuit breakers auto-pause on loss limits. | Proven strategies, experienced users |
| Paper | Simulated trading with real data. All logged for strategy evaluation. | Testing, new agents, strategy development |
| Tool | What It Does |
|---|---|
poly_whale_tracker | Monitor large trades, detect whale wallets, track accumulation/distribution. Actions: scan, list_whales, add_whale, remove_whale |
poly_orderbook_depth | L2 orderbook analysis — bid/ask walls, liquidity depth, imbalance ratio, spoofing indicators |
poly_onchain_flow | Net buy/sell flow over 5m/1h/4h/24h windows. Separates whale flow from retail |
poly_wallet_profiler | Profile any wallet — trade count, volume, win rate, markets traded. Evaluate if a whale is worth following |
poly_liquidity_map | Map liquidity across multiple tokens. Ranks tradability, identifies thin markets |
poly_transaction_decoder | Decode Polygon transactions — CTF minting, redeeming, splitting, merging |
| Tool | What It Does |
|---|---|
poly_twitter_sentiment | Twitter/X sentiment via Google News proxy. Keyword-based scoring with spike detection |
poly_polymarket_comments | Scrape market comment sections — often contains insider-tier info before price moves |
poly_reddit_pulse | Monitor r/polymarket, r/politics, r/sports, custom subs. Reddit surfaces info 6-12h before MSM |
poly_telegram_monitor | Scrape public Telegram channels for prediction market alpha |
poly_social_velocity | Cross-platform mention velocity — detects spikes from 10→1000 mentions/hour |
| Tool | What It Does |
|---|---|
poly_calendar_events | Structured event calendar — elections, courts, fed, earnings, sports. Actions: list, add, remove, upcoming, auto_discover |
poly_official_sources | First-party data from White House, SCOTUS, SEC, Fed, ESPN, NOAA, Congress. RSS/Atom feeds |
poly_odds_aggregator | Compare Polymarket prices vs betting odds from other platforms. Divergence = opportunity |
poly_resolution_tracker | Track how markets resolve. Monitor resolution sources directly for early signals |
poly_breaking_news | AP, Reuters, BBC, CNN via RSS. Flags headlines most likely to move prediction markets |
| Tool | What It Does | Math |
|---|---|---|
poly_market_correlation | Pearson correlation between token price histories | r = Σ(x-x̄)(y-ȳ) / √(Σ(x-x̄)²·Σ(y-ȳ)²) |
poly_arbitrage_scanner | YES+NO≠$1, multi-outcome sums, cross-market divergence | Price sum deviation analysis |
poly_regime_detector | Trending (H>0.55), mean-reverting (H<0.45), random walk | Hurst exponent via R/S analysis |
poly_smart_money_index | Composite: orderbook imbalance + flow + momentum + news | Weighted signal aggregation (-1 to 1) |
poly_market_microstructure | Spread, fill probability, slippage simulation at various sizes | Orderbook walk simulation |
| Tool | What It Does |
|---|---|
poly_sniper | Trailing limit order — auto-adjusts to trail best bid/ask. Actions: create, list, cancel, status |
poly_scale_in | TWAP/VWAP execution — split large orders into time-weighted slices. Minimizes market impact |
poly_hedge | Create hedges in correlated markets. Actions: create, list, close, analyze |
poly_exit_strategy | Take-profit, stop-loss, trailing stop, time-based exit. Actions: create, list, remove, check |
| Tool | What It Does |
|---|---|
poly_manipulation_detector | Detect wash trading, spoofing, layering, volume concentration, rapid-fire bot activity |
poly_resolution_risk | Score ambiguity risk — vague language, subjective resolution, missing sources, no end date |
poly_counterparty_analysis | Who's on the other side? Whale vs retail distribution. Shows if you're trading against smart money |
| Tool | What It Does |
|---|---|
poly_portfolio_optimizer | Mean-variance optimization across positions. Optimal weights for max Sharpe ratio |
poly_drawdown_monitor | Real-time drawdown tracking with circuit breaker. Daily P&L tracking. Actions: check, history |
poly_pnl_attribution | P&L by strategy, category, and signal source. Kill losers, double winners. Actions: analyze, record, summary |
| Tool | What It Does | Math |
|---|---|---|
poly_kelly_criterion | Optimal position sizing | f* = (bp - q) / b |
poly_binary_pricing | Fair value estimation | Black-Scholes adapted for binary options |
poly_bayesian_update | Update beliefs with evidence | P(H|E) = P(E|H)P(H) / P(E) |
poly_monte_carlo | Simulate 10,000 price paths | Ornstein-Uhlenbeck process |
poly_technical_indicators | RSI, MACD, Bollinger, VWAP, EMA | Standard TA formulas |
poly_volatility | Realized vol, EWMA, Hurst | R/S analysis, Cornish-Fisher VaR |
poly_stat_arb | Pairs trading signals | Engle-Granger cointegration |
poly_value_at_risk | Downside risk | Historical, Parametric, MC VaR |
poly_entropy | Information theory | Shannon entropy, KL divergence |
poly_generate_signal | Master signal combiner | Weighted aggregation + Kelly sizing |
poly_correlation_matrix | Portfolio diversification | Pairwise correlation + PCA |
poly_recall_lessons — check past lessons for this market typepoly_record_prediction — journal prediction with reasoning BEFORE tradingpoly_place_order + poly_exit_strategypoly_resolve_prediction — log outcome → auto-updates calibrationpoly_trade_review → poly_record_lesson — extract insightspoly_calibration — "Am I overconfident at 80%?"poly_strategy_performance — which signals make money?poly_pnl_attribution — P&L by strategy/category/signalEvery trade goes through a 9-step permission pipeline, plus Polymarket-specific risk checks:
Plus: circuit breaker, daily trade/loss limits, position size caps, category restrictions, manipulation screening, resolution risk check, liquidity verification, slippage estimation.
The wallet system implements a 7-layer security model for managing funds. All features are accessible from the Wallet tab on the dashboard.
| Feature | Description | Access |
|---|---|---|
| View Balances | Live USDC + MATIC balances from Polygon RPC. Auto-refreshes every 15s. | Admin |
| Deposit | Copy wallet address to send USDC on Polygon. Supports bridging from other chains via polymarket.com. | Admin |
| Export Private Key | Reveal the private key for import into MetaMask/Rabby. Requires confirmation. Audit-logged. | Owner only |
| View on PolygonScan | Direct link to the wallet's transaction history on the block explorer. | Admin |
Agents can only transfer funds to pre-registered addresses. This is the primary defense against prompt injection, hallucination, and social engineering attacks.
| Security Layer | What It Does |
|---|---|
| Whitelist-only | Agent cannot send to arbitrary addresses. The poly_transfer_funds tool validates against the whitelist. |
| Cooling period | Configurable delay (default 24h, min 0) after adding an address before transfers are allowed. Prevents "add + drain" attacks. |
| Per-transaction limit | Max dollar amount per single transfer (default $100). Set per address. |
| Daily limit | Max total dollars per day per address (default $500). Resets at midnight. |
| Owner-only management | Only owner role users can add/remove/modify whitelisted addresses. |
| Always approval-gated | Every transfer creates a pending request. Cannot be auto-approved regardless of trading mode. |
| 4-hour expiry | Pending transfers expire after 4 hours. No stale approvals sitting around. |
| Full audit trail | Every action logged: add/remove address, approve/reject/fail transfer, export key. |
poly_transfer_funds — validates whitelist, cooling, limits → creates pending requestThe watcher engine provides continuous market surveillance using a configurable background LLM for real-time analysis. It runs a demand-driven architecture — zero CPU/network when idle.
| Type | What It Does | AI? |
|---|---|---|
price_level | Alert when price crosses a threshold | No |
price_change | Alert on % change over time window | No |
volume_surge | Detect unusual volume spikes | No |
resolution_watch | Monitor markets near resolution | No |
portfolio_drift | Alert on portfolio allocation drift | No |
arbitrage_scan | Continuous arbitrage opportunity scanning | No |
crypto_price | Monitor crypto prices (BTC, ETH, etc.) | No |
market_scan | Scan for markets matching criteria | No |
news_intelligence | Multi-source news + LLM impact assessment | Yes |
geopolitical | CIA-analyst-style pattern detection connecting world events to markets | Yes |
cross_signal | Correlates signals from buffer when 3+ converge | Yes |
sentiment_shift | Tracks sentiment over time, alerts on directional changes | Yes |
Background AI analysis uses a separate, configurable LLM (not the main agent model). Configure via the Monitors tab → "Configure" button:
| Table | Purpose |
|---|---|
poly_watchers | Watcher definitions with type, config, interval, status |
poly_watcher_events | Generated signals/alerts with severity, routing status |
poly_watcher_config | Per-agent AI model config, budget, spawn limits |
poly_analysis_cache | 1h TTL cache to avoid duplicate LLM calls |
poly_sentiment_history | Sentiment trend data for shift detection |
poly_signal_buffer | Cross-signal correlation buffer with expiry |
Two-column layout: vertical navigation sidebar (280px) on the left with grouped tabs, content pane on the right. The P&L line chart is sticky at the top and always visible regardless of scroll position.
| Group | Tabs |
|---|---|
| Trading | Overview · Wallet · Pending Trades · Trade History · Paper |
| Automation | Monitors (engine status + AI config) · Signals (events + acknowledge) |
| Orders | Orders (snipers + scale-in) · Hedges · Exit Rules |
| Intelligence | On-Chain · Social · Events · Alerts |
| Analytics | Analytics · Drawdown · Attribution · Calibration |
| Journal | Journal · Strategies · Lessons |
All data loads in parallel via Promise.all (23+ API calls batched). SSE streams provide real-time price and dashboard updates.
The Polymarket page is fully organization-aware:
owner role. Viewing data requires admin.Agents with Polymarket skills get an injected system prompt (buildPolymarketPrompt()) containing:
Market Discovery (11) · Wallet & Account (6) · Funds (2) · Fund Transfers (1) · Portfolio (4) · Order Management (8) · Analytics (6) · Config (4) · Alerts (3) · Approval Queue (4) · Social (3) · Paper (2) · System (2) · Learning (8)
Kelly · Black-Scholes · Bayesian · Monte Carlo · RSI/MACD/Bollinger · Volatility/Hurst · Stat Arb · VaR · Entropy · News Feed · Sentiment · Signal Generator · Correlation Matrix
Whale Tracker · Orderbook Depth · On-Chain Flow · Wallet Profiler · Liquidity Map · Transaction Decoder
Twitter Sentiment · Polymarket Comments · Reddit Pulse · Telegram Monitor · Social Velocity
Event Calendar · Official Sources · Odds Aggregator · Resolution Tracker · Breaking News
Market Correlation · Arbitrage Scanner · Regime Detector · Smart Money Index · Market Microstructure
Sniper Order · Scale In (TWAP/VWAP) · Hedge Position · Exit Strategy
Manipulation Detector · Resolution Risk · Counterparty Analysis
Portfolio Optimizer · Drawdown Monitor · P&L Attribution
Setup Monitors · List Monitors · Manage Monitor · AI Watcher Config
| Method | Endpoint | Description |
|---|---|---|
| GET | /polymarket/dashboard | Global dashboard stats (daily counters, wallets) |
| GET | /polymarket/:agentId/trades | Trade history for an agent |
| GET | /polymarket/:agentId/pending | Pending trades awaiting approval |
| POST | /polymarket/trades/:id/decide | Approve/reject a pending trade |
| GET | /polymarket/:agentId/config | Trading configuration |
| PUT | /polymarket/:agentId/config | Update trading configuration |
| Method | Endpoint | Role | Description |
|---|---|---|---|
| GET | /polymarket/:agentId/wallet | admin | Wallet address and status |
| GET | /polymarket/:agentId/wallet/balance | admin | Live USDC + MATIC balances from Polygon |
| POST | /polymarket/:agentId/wallet/export | owner | Export private key (requires {confirm:"EXPORT"}) |
| GET | /polymarket/:agentId/wallet/whitelist | admin | List whitelisted withdrawal addresses |
| POST | /polymarket/:agentId/wallet/whitelist | owner | Add whitelisted address (24h cooling default) |
| PUT | /polymarket/:agentId/wallet/whitelist/:id | owner | Update address limits or label |
| DELETE | /polymarket/:agentId/wallet/whitelist/:id | owner | Remove whitelisted address |
| GET | /polymarket/:agentId/transfers | admin | Transfer request history |
| POST | /polymarket/:agentId/transfers/:id/approve | owner | Approve and execute transfer on-chain |
| POST | /polymarket/:agentId/transfers/:id/reject | owner | Reject a pending transfer |
| Method | Endpoint | Description |
|---|---|---|
| GET | /polymarket/:agentId/watchers | List market monitors |
| POST | /polymarket/watchers/:id/toggle | Pause/resume a watcher |
| DELETE | /polymarket/watchers/:id | Delete a watcher |
| GET | /polymarket/:agentId/watcher-events | List watcher signals/events |
| POST | /polymarket/:agentId/watcher-events/acknowledge-all | Acknowledge all unread signals |
| GET | /polymarket/:agentId/watcher-config | AI analysis model configuration |
| POST | /polymarket/:agentId/watcher-config | Update AI config (provider, model, budget) |
| GET | /polymarket/engine/status | Watcher engine status (running, ticks, events) |
| POST | /polymarket/engine/control | Start/stop watcher engine |
| Endpoint | Description |
|---|---|
/polymarket/stream?agentId=X | Dashboard update events (trade completed, config changed) |
/polymarket/prices/stream?agentId=X | Live CLOB midpoint prices for open positions (3s interval) |
The watcher engine includes a proactive trading loop that automatically wakes the trading agent when it's behind on daily trade goals. This ensures consistent market engagement without manual intervention.
min_trades_daily goalEvery proactive wake requires the agent to complete these steps in order before placing any trades:
| Step | Tool | Purpose |
|---|---|---|
| 1 | poly_watcher_events action=check | Check for unread market signals |
| 2 | poly_goals action=check | Review performance targets |
| 3 | poly_drawdown_monitor action=check | Portfolio-level risk check (halt if >15%) |
| 4 | poly_calibration | Am I over/under-confident? |
| 5 | poly_pnl_attribution | Which strategies are making/losing money? |
| 6 | poly_strategy_performance | Which signals are actually profitable? |
| 7 | poly_get_positions | Review open positions and P&L drift |
| 8 | poly_exit_strategy action=check | Check if exit conditions triggered |
Only after completing all 8 steps does the agent proceed to market screening and trade placement. This ensures quality over quantity — no blind trading.
poly_quick_analysis + poly_resolution_risk + poly_manipulation_detectorpoly_kelly_criterion — no arbitrary $5 betspoly_scale_in (TWAP/VWAP) to minimize slippagepoly_sniper with trailing limitspoly_hedgeAI trading sessions can be expensive — a single proactive wake can consume 100K+ input tokens ($3-5) if not optimized. The system implements several token-saving measures:
Tool responses are automatically trimmed to reduce token consumption while preserving essential information:
| Tool | Before | After | What's Trimmed |
|---|---|---|---|
poly_get_positions | 17-22K chars | 3-5K chars | Raw API fields stripped to: asset, size, avgPrice, currentPrice, title, outcome, pnl, resolved, redeemable |
poly_screen_markets | 19-38K chars | 4-6K chars | Full market objects stripped to: id, question, slug, outcomes, prices, volume, liquidity. Max 8 results. |
poly_twitter_sentiment | 15K chars | 2-3K chars | Items capped at 5 per query, only title+sentiment+source kept |
poly_search_markets | 5-7K chars | 3-4K chars | Default limit reduced from 20→8, clobTokenIds stripped (agent can fetch via poly_get_market) |
The system prompt enforces strict token efficiency rules:
poly_get_balance must be called before any analysis. If <$5 available, stop immediately.poly_kelly_criterion returns capped=0 (no edge), skip that market immediatelyThese optimizations reduce proactive session cost from $3-5 per wake to $0.50-1.50 per wake — a 60-75% reduction in token usage.
| Issue | Solution |
|---|---|
| SDK not installing | Run poly_check_sdk. Check npm connectivity and disk space. |
| Trades failing | poly_wallet_status — may need USDC or MATIC for gas. |
| No dashboard data | Tables auto-create on first tool use. Run any poly_ tool to initialize. |
| Circuit breaker stuck | poly_circuit_breaker action=reset_daily or Pause/Resume button. |
| Rate limited | Built-in rate limiter (30 req/min/domain). Wait 60 seconds. |
| Stale data on dashboard | Click Refresh. SSE stream auto-updates on changes. |
| Config not taking effect | Config reads from DB on every call — changes are instant. No restart needed. |
| Manipulation detector false positive | Single-wallet concentration is normal in low-volume markets. Check volume. |
| Transfer "Not whitelisted" | Add the address in Dashboard → Wallet → Add Address. Only owner role can add. |
| Transfer "Cooling period" | Wait for the configured cooling period to elapse. Check badge on the address card. |
| Transfer failed on-chain | Check MATIC balance for gas. Verify USDC balance is sufficient. Check PolygonScan for details. |
| Agent wakes but can't trade | Balance gate skips wakes when USDC < $5. Fund the wallet with more USDC on Polygon. |
| Sessions burning 100K+ tokens | Check for duplicate tool calls in logs. Agent should follow token efficiency rules — max 2 screens, no retry on rate limit. |
| Agent keeps calling rate-limited tools | System prompt instructs: skip on first "Rate limited" error. If still happening, check if agent is using latest system prompt (restart PM2). |
| "not enough balance / allowance" | Run poly_set_allowances to approve USDC + CTF tokens for exchange contracts. Also check USDC balance. |
| "invalid price (undefined)" | Auto-trade fired without resolving token price. System now auto-fetches midpoint — verify token_id is valid. |
| Neg-risk market auto-sell won't fill | Neg-risk orderbooks have inverted structure. Limit sells at midpoint won't fill when best bid is 0.001. Use market order or sell at best bid. |
| Can't see Polymarket page | Client org users need access granted: Organizations → Org → Visible Pages → toggle Polymarket. |
| AI watchers not running | Configure AI model in Monitors tab → Configure button. Check daily budget isn't exhausted. |
| Watcher engine stopped | Engine auto-starts when active watchers exist. Check Monitors tab → Start Engine button. |