Claude
Skills
Sign in
Back

trade-prediction-markets

Included with Lifetime
$97 forever

Build and test Polymarket prediction market trading strategies for YES/NO token trading. Provides 6 tools: get_all_prediction_events (browse markets, $0.001), get_prediction_market_data (analyze price history, $0.001), create_prediction_market_strategy (generate code, $1-$4.50), run_prediction_market_backtest (test performance, $0.001). Trade on real-world events (politics, economics, sports, crypto). Currently simulation only (live deployment coming soon).

Code Review

What this skill does


# Trade Prediction Markets

## Quick Start

This skill enables trading on Polymarket prediction markets (YES/NO tokens) for real-world events.

**Load the tools first**:
```
Use MCPSearch to select: mcp__workbench__get_all_prediction_events
Use MCPSearch to select: mcp__workbench__get_prediction_market_data
Use MCPSearch to select: mcp__workbench__create_prediction_market_strategy
```

**Basic workflow**:
```
1. Browse markets:
   get_all_prediction_events(market_category="crypto_rolling")
   → See BTC/ETH price prediction markets

2. Analyze market data:
   get_prediction_market_data(condition_id="0x123...")
   → Study YES/NO token price history

3. Create strategy:
   create_prediction_market_strategy(
       strategy_name="PolymarketArb_M",
       description="Buy YES when price <40%, sell at 55%"
   )

4. Test strategy:
   run_prediction_market_backtest(
       strategy_name="PolymarketArb_M",
       ...
   )
```

**When to use this skill**:
- Trading on real-world events (elections, Fed decisions, sports)
- Want binary outcome exposure (YES/NO)
- Interested in probability-based trading
- Exploring prediction market opportunities

## Available Tools (6)

### get_all_prediction_events

**Purpose**: Browse available Polymarket prediction markets

**Parameters**:
- `active_only` (optional, boolean): Only active events (default: true)
- `market_category` (optional, string): Filter by category

**Categories**:
- `crypto_rolling`: Crypto price predictions (BTC >$100k in next hour?)
- `politics`: Elections, policy decisions
- `economics`: GDP, inflation, Fed decisions
- `sports`: Game outcomes, championships
- `entertainment`: Awards, box office results

**Returns**: List of events with names, categories, markets, condition IDs, resolution status

**Pricing**: $0.001

**Use when**: Discovering trading opportunities, browsing available markets

### get_prediction_market_data

**Purpose**: Analyze YES/NO token price history for specific market

**Parameters**:
- `condition_id` (required): Polymarket condition ID
- `start_date` (optional): Filter from date (YYYY-MM-DD)
- `end_date` (optional): Filter to date (YYYY-MM-DD)
- `timeframe` (optional): Candle timeframe (1m, 5m, 15m, 30m, 1h, 4h, default: 1m)
- `limit` (optional, 1-10000): Max candles per token (default: 1000)

**Returns**: Market metadata, YES token price timeseries, NO token price timeseries

**Pricing**: $0.001

**Use when**: Analyzing market price history, researching token behavior, validating strategy concepts

### create_prediction_market_strategy

**Purpose**: Generate Polymarket strategy code with YES/NO trading logic

**Parameters**:
- `strategy_name` (required): Strategy name (follow pattern: Name_RiskLevel)
- `description` (required): Detailed requirements for YES/NO logic, exit criteria, position sizing

**Returns**: Complete Python PolymarketStrategy code

**Pricing**: Real LLM cost + margin (max $4.50)

**Execution Time**: ~30-60 seconds

**Use when**: Building new Polymarket strategies

### run_prediction_market_backtest

**Purpose**: Test prediction market strategy on historical data

**Parameters**:
- `strategy_name` (required): PolymarketStrategy to test
- `start_date` (required): Start date (YYYY-MM-DD)
- `end_date` (required): End date (YYYY-MM-DD)
- `condition_id` (for single market): Specific condition ID
- `asset` (for rolling markets): Asset symbol ("BTC", "ETH")
- `interval` (for rolling markets): Market interval ("15m", "1h")
- `initial_balance` (optional): Starting USDC (default: 10000)
- `timeframe` (optional): Execution timeframe (default: 1m)

**Returns**: Backtest metrics (profit/loss, win rate, position history)

**Pricing**: $0.001

**Execution Time**: ~20-60 seconds

**Use when**: Validating prediction market strategies

### get_data_availability

**Purpose**: Check available data ranges for Polymarket markets

**Parameters**:
- `data_type`: "polymarket" or "all"
- `asset` (optional): Filter by asset
- `include_resolved` (optional): Include resolved markets

**Returns**: Data availability with date ranges

**Pricing**: $0.001

**Use when**: Before backtesting (verify sufficient data)

### get_latest_backtest_results

**Purpose**: View recent prediction market backtest results

**Parameters**:
- `strategy_name` (optional): Filter by strategy
- `limit` (optional): Number of results

**Returns**: Recent backtest records

**Pricing**: Free

**Use when**: Checking existing backtest results

## Core Concepts

### Prediction Market Mechanics

**YES/NO Token Structure**:
```
Event: "Will BTC exceed $100,000 by end of hour?"

YES Token:
- Pays $1.00 if event occurs
- Pays $0.00 if event doesn't occur
- Current price = Market's implied probability
- Example: YES token at $0.65 = 65% implied probability

NO Token:
- Pays $1.00 if event DOESN'T occur
- Pays $0.00 if event occurs
- Current price = 1 - YES price
- Example: NO token at $0.35 = 35% implied probability

Total: YES price + NO price ≈ $1.00 (arbitrage if not)
```

**How trading works**:
```
Scenario: YES token at $0.40

Buy YES token:
- Pay $0.40 now
- If event occurs: Receive $1.00 (profit $0.60 = 150% return)
- If event doesn't occur: Lose $0.40 (-100% return)

Risk/Reward:
- Risking $0.40 to make $0.60
- 1.5:1 reward:risk ratio
- Need >40% win rate to break even
```

### Market Categories

**Crypto Rolling Markets** (high frequency):
```
Type: Continuous prediction markets
Frequency: Every 15m, 1h, 4h, etc.
Question: "Will BTC price increase next [interval]?"

Example:
- 1h BTC rolling market
- New market every hour
- Predict if BTC closes higher than current price

Use case: Short-term price speculation
Trading style: Active, high frequency
```

**Politics** (event-driven):
```
Type: One-time events
Frequency: Varies (elections, policy decisions)
Timeline: Days to months until resolution

Examples:
- "Will candidate X win election?"
- "Will bill Y pass Congress by date Z?"
- "Will Fed cut rates in next meeting?"

Use case: Event speculation
Trading style: Position trading, hold until resolution
```

**Economics** (data release):
```
Type: Scheduled data releases
Frequency: Monthly, quarterly
Timeline: Fixed resolution dates

Examples:
- "Will CPI exceed 3.5% next month?"
- "Will GDP growth exceed 2% this quarter?"
- "Will unemployment rate decrease?"

Use case: Economic data predictions
Trading style: Position before release, exit at resolution
```

**Sports** (scheduled events):
```
Type: Game outcomes, championships
Frequency: Varies by sport
Timeline: Hours to months

Examples:
- "Will Team X win game tonight?"
- "Will Player Y score >25 points?"
- "Will Team Z win championship?"

Use case: Sports betting alternative
Trading style: Event-based positions
```

### Strategy Types

**Probability Arbitrage** (mean reversion):
```
Concept: Buy underpriced probabilities, sell when corrected

Example:
- Event has ~60% true probability
- YES token priced at $0.45 (implies 45%)
- Buy YES (underpriced)
- Sell when price reaches $0.60 (fair value)

Advantages: Mathematical edge if probability estimation accurate
Disadvantages: Requires good probability estimation
```

**Trend Following** (momentum):
```
Concept: Follow YES/NO token price momentum

Example:
- YES token price rising from $0.30 → $0.45
- Buy YES (momentum continuing)
- Exit when momentum fades

Advantages: Captures strong moves
Disadvantages: Late entries, whipsaws
```

**Mean Reversion** (range trading):
```
Concept: Fade extreme probability movements

Example:
- YES token spikes to $0.85 (85% implied)
- Seems too high, buy NO token ($0.15)
- Exit when reverts toward mean

Advantages: Profits from overreactions
Disadvantages: Catching falling knives (sometimes market is right)
```

**Event-Driven** (catalyst trading):
```
Concept: Trade based on news/catalysts

Example:
- Positive news for candidate X
- Buy YES token before market fully reacts
- Exit after market prices in news

Advantages: Early mover advantage
Disadvantages: Requires fast news react

Related in Code Review