LAMIN.NGOBEHGet Brainwashed
← All books

general

Advanced Prediction Market Strategies

Unknown

Advanced Prediction Market Strategies

> Distilled from three proven prediction market repos: the official Polymarket SDK, the AI-Trader platform (13.4K stars, supports Polymarket paper trading), and polybot's replication scoring engine. These are battle-tested patterns from real trading systems.

1. Polymarket CLOB Execution Strategies

Market Discovery via Gamma API

The Gamma API (gamma-api.polymarket.com) is the market metadata layer. Use it for discovery, not execution.

Efficient Market Scanning Pattern:

1. GET /markets?active=true&closed=false → all active markets
2. Filter: volume_24h > $200, end_date within 30 days
3. Sort by: volume descending (liquidity proxy)
4. For each candidate: GET /markets/{id} → detailed metadata
5. Extract: question, outcomes, resolution_source, category tags

Category-Based Scanning:

  • Politics: highest volume, most liquid, strongest crowd biases
  • Crypto: fast-moving, high volatility, technical analysis applicable
  • Sports: well-calibrated markets, thin edge, high volume
  • Science/Tech: lower volume, higher potential mispricing, longer resolution
  • Entertainment: thin markets, wide spreads, limited research value
  • Economics: data-driven, scheduled catalysts (jobs reports, GDP, Fed decisions)

CLOB Order Execution

Limit Order Best Practices:

  1. Never market-buy — always use limit orders (prediction markets have wide spreads)
  2. Place limit at midpoint between bid and ask, not at the ask
  3. If midpoint doesn't fill in 60 seconds, walk toward the ask by 1 cent
  4. Maximum 3 walks before aborting (slippage > 2% = abort)
  5. For exits: reverse the process (walk toward bid)

Order Book Depth Analysis:

  • Check total depth on both sides before sizing
  • Your order should be < 10% of the visible depth on your side
  • Thin books (< $1000 depth) require smaller positions and patience
  • Watch for "iceberg orders" — large orders hidden behind small visible size

EIP-712 Signature Pattern (Polymarket-specific):

  • Orders are signed off-chain using EIP-712 typed data
  • Private key never leaves the local environment
  • Orders are submitted to the CLOB, not the blockchain directly
  • Settlement happens on Polygon when market resolves

WebSocket Real-Time Feeds

WSS: wss://ws-subscriptions-clob.polymarket.com/ws
Channels:
- market: price updates, new trades
- user: order status, fills, cancellations
- book: orderbook depth changes

Rate Limits: 5 concurrent WS subscriptions. Prioritize:

  1. Open position markets (monitor for flash events)
  2. Watchlist candidates (entry opportunity detection)
  3. High-volume markets (general market health)

---

2. Smart Money Analysis & Copy-Trading Intelligence

Replication Scoring (from polybot)

Reverse-engineer successful traders' strategies by analyzing their public on-chain activity.

Whale Identification:

  1. Query Polymarket's public trade history for a market
  2. Identify wallets with > $10K total volume
  3. Track their entry prices, timing, and position sizes
  4. Calculate each whale's historical win rate and Brier score
  5. Weight their current positions by their track record

Replication Score Formula:

replication_score = Σ (whale_i_position × whale_i_win_rate × whale_i_volume_weight)

A high positive replication score means smart money is on YES. A high negative score means smart money is on NO. Near-zero means smart money is split or absent.

Smart Money Flow Detection:

  • Track large order flow (> $5K single orders) in real-time via WebSocket
  • Sudden whale accumulation at a price level signals informed positioning
  • If whale flow contradicts your ensemble model, investigate before trading
  • Whale exit signals (large sells on existing positions) are stronger than entry signals

Copy-Trading Caveats:

  • Smart money can be wrong — treat as ONE input, not the decision
  • Some whales are market-makers, not directional traders (ignore their flow)
  • Time delay: by the time you detect whale activity, the price may have already moved
  • Never copy-trade without independent thesis validation

Top Trader Analysis

Metrics to Track Per Trader: | Metric | What It Tells You | |--------|-------------------| | Win Rate | Baseline accuracy | | Avg Edge Captured | How much alpha per trade | | Position Sizing Pattern | Consistent or erratic? | | Time in Market | Quick scalpers vs patient holders | | Category Specialization | Expert in politics? Crypto? Sports? | | Drawdown Profile | How they handle losses |

Portfolio-Level Analysis:

  • What's the aggregate smart money position across ALL active markets?
  • Are whales rotating into a specific category? (macro signal)
  • Is smart money volume increasing or decreasing? (confidence indicator)

---

3. AI-Trader MCP-Based Architecture Patterns

Agent-Native Trading

AI-Trader demonstrates how to build trading agents using MCP (Model Context Protocol) tools:

Tool-Based Architecture:

Agent receives market question
→ Uses scan_market tool (MCP) to get current prices
→ Uses research tool (MCP) to gather context
→ Uses analyze tool to estimate probability
→ Uses risk_check tool to validate position
→ Uses execute tool to place order
→ Uses log tool to record trade

Each tool is an independent, composable unit. The agent decides tool sequence based on context.

Paper Trading Pattern (from AI-Trader):

  • Initialize with configurable virtual bankroll ($10K default)
  • Execute trades against real market prices but with simulated fills
  • Add realistic slippage (0.5-2% depending on volume)
  • Track P&L in separate paper portfolio
  • Auto-settle when markets resolve (check resolution status daily)
  • Compare paper performance to live market for strategy validation

Signal Sharing Between Agents:

  • When one agent identifies edge, share the signal with others for independent validation
  • Use structured signal format: { market, probability, confidence, source, timestamp }
  • Receiving agent must independently verify before acting (no blind following)
  • This is essentially the debate engine pattern — multiple perspectives on same signal

Calibration & Backtesting

Forward-Testing Protocol:

  1. Paper trade new strategy for minimum 2 weeks (50+ trades)
  2. Track Brier score by market category
  3. Compare to baseline (naive forecasting, market price)
  4. Only promote to live if:
  • Brier score < market baseline by > 0.02
  • Win rate > 55% (enough to overcome spread)
  • Profit factor > 1.5 (gross profit / gross loss)
  • No single-day drawdown > 5% in paper mode

Resolved Market Calibration:

  • Fetch recently resolved markets weekly
  • Compare your predictions (if any) against outcomes
  • Calculate rolling 30-day Brier score
  • Decompose: calibration error vs discrimination error
  • Feed results into ensemble weight recalibration

---

4. Advanced Market Microstructure

Spread Analysis

Bid-Ask Spread Interpretation:

  • Tight spread (< 2 cents): highly liquid, well-priced, hard to find edge
  • Medium spread (2-5 cents): moderate opportunity, acceptable for standard positions
  • Wide spread (> 5 cents): illiquid, potential edge but execution risk is high
  • The spread IS the market-maker's edge — you must have > spread edge to profit after execution

Volume-Price Relationship:

  • Rising price + rising volume = strong trend (momentum signal)
  • Rising price + falling volume = weak trend (potential reversal)
  • Falling price + rising volume = capitulation (contrarian opportunity?)
  • Falling price + falling volume = disinterest (avoid)

Time-to-Resolution Effects

Resolution Curve:

  • Markets far from resolution: price reflects long-term probability, slow-moving
  • Markets near resolution: price converges to outcome, fast-moving, high information value
  • "Resolution premium": markets often misprice the last 48 hours (panic buying/selling)
  • Best entry: 1-2 weeks before resolution when catalyst is scheduled
  • Best exit: before resolution if edge has been captured (don't hold through binary event unless edge is large)

Market Making vs Directional Trading

Directional Trading (Rohan's primary mode):

  • Take a view on probability. Buy YES or NO.
  • Edge comes from superior probability estimation
  • Risk: being wrong about probability → loss on resolution

Market Making (reference, not primary):

  • Provide liquidity on both sides of the orderbook
  • Edge comes from capturing the spread
  • Risk: adverse selection (informed traders pick off your quotes)
  • Rohan can detect market-maker activity (symmetric orderbook, frequent quote updates) and filter it out of smart money analysis

---

5. Research Dossier Framework

When performing deep market research, structure findings as:

RESEARCH DOSSIER: [Market Question]
================================

MARKET DATA:
- Current price: [YES/NO prices]
- Volume (24h): [$X]
- Total volume: [$X]
- Resolution date: [date]
- Resolution source: [who decides]

BASE RATE ANALYSIS:
- Historical frequency of similar events: [X%]
- Comparable past markets and their outcomes: [list]
- Statistical base rate: [X%]

CURRENT INTELLIGENCE:
- Latest news (< 48h): [summary with sources]
- Social sentiment: [positive/negative/neutral + strength]
- Expert opinions: [named sources with predictions]
- Scheduled catalysts: [dates and events]

SMART MONEY POSITION:
- Top trader aggregate: [bullish/bearish/neutral]
- Replication score: [X]
- Whale activity: [recent large orders]

MODEL ENSEMBLE:
- Grok: [X%]
- Claude: [X%]
- GPT-4o: [X%]
- Gemini: [X%]
- DeepSeek: [X%]
- Ensemble: [X%] (std: [X%])
- Edge vs market: [X%]

RISK ASSESSMENT:
- Key risk factors: [list]
- Tail scenarios: [low-probability high-impact]
- Correlation to existing positions: [assessment]