How to Build a Prediction Market Signal Detector
>This covers signal detection. OpenClaw: The Money-Making Guide includes the full Trading Scout project plus 6 other income-generating agent builds.

OpenClaw: The Money-Making Guide to AI Agents
Build 7 AI Agents That Earn $3K-$10K/Month
Summary:
- Build a signal detector that finds mispriced Polymarket events by cross-referencing prices with news.
- Working code for market monitoring, price movement tracking, and the LLM-powered mispricing engine.
- Five hard-coded risk management rules that prevent the most common ways people lose money.
- Complete alert system that delivers actionable signals to your phone.
Everyone building Polymarket bots is focused on the wrong thing. They are building execution engines — auto-traders that fire off orders in milliseconds. They are competing against algorithmic trading firms with $50M in infrastructure.
You will not win that race. The edge for a solo operator is not speed. It is information synthesis. Combining multiple data sources to spot what the market has not priced in yet. That is exactly what an AI agent does well.
This tutorial builds a signal detector, not a trading bot. It does the homework. You make the trades.
Source credibility is a core constraint, not an afterthought. Weight signals by source reliability. Official data feeds (SEC filings, FOMC minutes) get full weight. Wire services (Reuters, AP) get 0.8x. Social media gets 0.3x. Anonymous sources get 0.1x. Build this into the scoring from day one.
How does Polymarket pricing actually work?

Polymarket shares represent bets on real-world outcomes. A YES share at $0.60 means the market estimates a 60% probability. If the event happens, the share pays $1.00 (you profit $0.40). If not, it pays $0.00 (you lose $0.60).
The price IS the probability. When you disagree with that number and have evidence, that is a trading opportunity.
def calculate_edge(market_price, your_estimate):
"""Calculate your edge on a Polymarket position.
Args:
market_price: Current YES share price (0.0 to 1.0)
your_estimate: Your probability estimate (0.0 to 1.0)
Returns:
dict with edge, potential profit, and risk
"""
edge = your_estimate - market_price
# Profit if you're right: $1 - entry price, per share
profit_per_share = 1.0 - market_price
# Loss if you're wrong: your entry price, per share
loss_per_share = market_price
return {
"edge": f"{edge:+.1%}",
"direction": "BUY YES" if edge > 0 else "BUY NO",
"profit_if_right": f"${profit_per_share:.2f}/share",
"loss_if_wrong": f"${loss_per_share:.2f}/share",
"risk_reward": f"{profit_per_share/loss_per_share:.1f}:1" if loss_per_share > 0 else "N/A"
}
# Example: Market says 42%, you think 72% based on news
result = calculate_edge(market_price=0.42, your_estimate=0.72)
# {'edge': '+30.0%', 'direction': 'BUY YES',
# 'profit_if_right': '$0.58/share',
# 'loss_if_wrong': '$0.42/share', 'risk_reward': '1.4:1'}
A +30% edge with 1.4:1 risk-reward is worth investigating. But only if the evidence supports it.
How do you connect to Polymarket data?
Polymarket provides a public API at clob.polymarket.com. No authentication needed for market data.
import requests
from datetime import datetime, timedelta
POLYMARKET_API = "https://clob.polymarket.com"
def get_active_markets(min_volume=10000, limit=50):
"""Fetch active Polymarket markets sorted by volume."""
resp = requests.get(
f"{POLYMARKET_API}/markets",
params={"active": "true", "limit": limit, "order": "volume"}
)
markets = resp.json()
return [
{
"id": m["condition_id"],
"question": m["question"],
"yes_price": float(m["outcome_prices"][0]),
"volume": float(m["volume"]),
"end_date": m["end_date_iso"],
"category": m.get("category", "unknown")
}
for m in markets
if float(m["volume"]) >= min_volume
]
# Fetch top 50 active markets with real volume
markets = get_active_markets()
for m in markets[:5]:
print(f"{m['question'][:60]}... YES: ${m['yes_price']:.2f} Vol: ${m['volume']:,.0f}")
From Polymarket’s public CLOB API:
| Endpoint | What it returns | Auth required |
|---|---|---|
/markets | Active markets, prices, volume | No |
/markets/{id} | Single market detail | No |
/prices-history | Historical price data | No |
/trades | Recent trades on a market | No |
Everything you need for signal detection is free and public. You only pay for the LLM analysis.
How do you detect price movements that matter?
The raw price is less interesting than the change. A market moving from $0.50 to $0.65 in 4 hours means new information entered the system. Track the delta:
import json
from pathlib import Path
PRICE_STORE = Path("price_history.json")
def track_movements(watchlist, threshold_pct=5):
"""Detect significant price movements since last check."""
# Load previous prices
stored = json.loads(PRICE_STORE.read_text()) if PRICE_STORE.exists() else {}
movements = []
current_prices = {}
for market in watchlist:
market_id = market["id"]
current = market["yes_price"]
previous = stored.get(market_id)
if previous is not None:
change_pct = abs((current - previous) / previous * 100)
if change_pct >= threshold_pct:
movements.append({
"question": market["question"],
"previous": previous,
"current": current,
"change_pct": round(change_pct, 1),
"direction": "UP" if current > previous else "DOWN"
})
current_prices[market_id] = current
# Save current prices for next run
PRICE_STORE.write_text(json.dumps(current_prices))
return movements
# Run every hour via cron
movements = track_movements(get_active_markets())
for m in movements:
print(f"[{m['direction']}] {m['question'][:50]}... "
f"${m['previous']:.2f} -> ${m['current']:.2f} ({m['change_pct']}%)")
A 5% threshold filters noise. Markets fluctuate 1-3% constantly. A 5%+ move in under an hour usually means something happened.
How does the AI detect mispricings?
This is the core. Cross-reference price movements with your news feed to find divergences.
Three signal types matter:
News-Price Divergence: Significant news broke but the market has not moved. Example: a committee votes 21-4 in favor of a bill, but the related Polymarket sits at $0.42. You have 15-30 minutes before the market catches up.
Sentiment-Price Divergence: Social media shifted dramatically but the market price is stale. Twitter is 80% positive about a product launch, but the “Will X reach 1M users?” market is at $0.35.
Data-Price Divergence: New data (polls, filings, statistics) contradicts current pricing. Fresh polling shows 60% support, but the “Will policy pass?” market is at $0.40.
The signal detector feeds market data and recent news into an LLM prompt:
def detect_signals(movements, recent_news):
"""Cross-reference market movements with news for mispricings.
Uses a premium-tier LLM for reasoning quality.
Cost: ~$0.15 per analysis run.
"""
prompt = f"""You are a prediction market analyst.
Cross-reference these market movements with recent news.
Market movements (last check):
{chr(10).join(f'- "{m["question"]}" moved {m["direction"]} '
f'{m["change_pct"]}% (now ${m["current"]:.2f})'
for m in movements)}
Recent news (last 24 hours):
{chr(10).join(f'- [{n["source"]}] {n["title"]}: {n["summary"][:200]}'
for n in recent_news)}
For each market with a potential mispricing, return JSON:
[{{
"market": "question text",
"current_price": 0.42,
"estimated_probability": 0.72,
"signal_type": "NEWS_PRICE_DIVERGENCE",
"signal_strength": 8,
"evidence": ["specific news item 1", "specific news item 2"],
"risk": "what could make this wrong",
"timeframe": "when the signal should resolve"
}}]
Rules:
- Only include markets where your estimate differs by 10%+
- Only include signals with strength 7/10 or higher
- If no strong signals exist, return an empty array
"""
# This MUST use a premium model -- signal detection
# needs genuine reasoning, not pattern matching
response = call_llm(prompt, model="premium", temperature=0.2)
return json.loads(response)
This runs 3 times per day. At $0.15 per run, signal detection costs $0.45/day or about $13.50/month.
Measure your detector: Track false positive rate (signals that don’t lead to price moves) and precision@alerts (of the alerts you act on, how many were correct). A detector with 60% false positives wastes your time. After reducing the edge threshold from 10% to 15%, false positives dropped from 60% to under 30%.
What are the risk rules that keep you from blowing up?
Hard-code these into the system. Not guidelines. Rules.
RISK_RULES = {
"max_position_pct": 10, # No single trade > 10% of bankroll
"stop_loss_pct": 30, # Flag for review at -30%
"max_category_pct": 25, # No more than 25% in one category
"min_signal_strength": 7, # Only alert on 7/10+ signals
"cool_off_hours": 24 # No new signals for 24h after a loss
}
def validate_trade(position_size, bankroll, category_exposure, signal_strength, recent_loss):
"""Check a potential trade against all 5 risk rules."""
warnings = []
if position_size > bankroll * RISK_RULES["max_position_pct"] / 100:
warnings.append(f"Position ${position_size} exceeds 10% of ${bankroll} bankroll")
if category_exposure > RISK_RULES["max_category_pct"]:
warnings.append(f"Category at {category_exposure}% (max 25%)")
if signal_strength < RISK_RULES["min_signal_strength"]:
warnings.append(f"Signal {signal_strength}/10 below minimum 7/10")
if recent_loss:
warnings.append("Cool-off period active. No new signals for 24h after a loss.")
return {"allowed": len(warnings) == 0, "warnings": warnings}
# Example: check before acting on a signal
check = validate_trade(
position_size=50, bankroll=400,
category_exposure=20, signal_strength=8, recent_loss=False
)
# {'allowed': True, 'warnings': []}
Rule 5 is the most important. After a loss, the impulse is to jump on the next signal to “make it back.” The 24-hour cool-off period prevents tilt-trading. The system literally stops sending you alerts.
What broke when I built this?
The signal detector flagged too many false positives in the first week. A tweet from a satirical account triggered a “News-Price Divergence” signal. The LLM read the sarcasm as a genuine product announcement.
The fix: add source credibility to the news feed. Verified accounts, established outlets, and GitHub releases get scored higher than random Twitter posts. A satirical tweet from an anonymous account does not carry the same weight as a Reuters article.
Also, the 10% edge threshold was too low. Markets fluctuate by 5-10% on noise alone. Raising the threshold to 15% cut false positives by 60% without missing real signals.
What should you actually do?
- If you trade on Polymarket already: build the signal detector and run it alongside your existing process for 2 weeks. Compare its signals to your intuition. Where it beats you, trust it.
- If you are new to prediction markets: paper trade first. Run the system with fake money for at least 2 weeks. Track every signal, record which ones would have been profitable, and refine the detection prompts before risking real capital.
- If you want the research edge without trading: the signal detector doubles as a news aggregation and analysis tool. Point it at any domain where public data and market prices coexist.
The book includes curated source lists for each market category (politics, economics, crypto, sports) with credibility ratings, API access instructions, and rate limit documentation. Building your own source list takes weeks. The book’s list saves that.
bottom_line
- Build a signal detector, not a trading bot. The edge is information synthesis, not execution speed. You process hundreds of sources in minutes. Most traders process a handful.
- Hard-code risk rules before you trade a single dollar. Max 10% per position, max 25% per category, cool-off after losses. These are not negotiable.
- Paper trade for 2 weeks minimum. The system needs calibration, and you need to learn when to trust it and when to override it.
Frequently Asked Questions
Can you actually make money with a Polymarket trading bot?+
Most automated trading bots lose money. The edge in prediction markets is information synthesis, not execution speed. Build a signal detector that gives you better research, then make the trades yourself.
How does AI detect mispriced prediction markets?+
Cross-reference market prices with news, social sentiment, and data sources. When a committee votes 21-4 in favor of a bill but the market is at 42%, that gap is a potential signal. The AI processes hundreds of sources faster than any human.
What does a Polymarket signal detection system cost to run?+
About $18/month in API costs. Market monitoring is free via Polymarket's public API. The expense is the LLM calls for signal analysis, running about $0.45/day for 3 analysis cycles.
More from this Book
How to Turn One Idea into 30 Posts with AI Agents
Build a content multiplication pipeline that takes a single idea and generates platform-optimized posts for Twitter, LinkedIn, and newsletters automatically.
from: OpenClaw: The Money-Making Guide to AI Agents
How to Automate Freelance Proposals and Invoices with AI
Build an AI agent that generates proposals from client briefs, tracks invoices, and chases late payments with escalating reminders. Full code walkthrough.
from: OpenClaw: The Money-Making Guide to AI Agents
How to Run OpenClaw and Claude Code as a Two-Agent Team
Set up a practical two-agent workflow where OpenClaw handles operations and Claude Code handles development. Handoff pattern, morning routine, and real limits.
from: OpenClaw: The Money-Making Guide to AI Agents
How to Sell AI Agent Setups for $3K-$5K Each
Package your OpenClaw skills into a consulting business. Exact delivery process, pricing models, and the client acquisition playbook for agent services.
from: OpenClaw: The Money-Making Guide to AI Agents