This guide shows common ways to use the prediction market trading bot skill.
User: "Help me build a trading bot for Polymarket"
Response Flow:
- Ask clarifying questions (bankroll, risk tolerance, automation level)
- Generate basic bot with default settings
- Include Polymarket integration only
- Set dry_run: true by default
- Provide simple README
Files Generated:
ai_trading_bot.py(simplified version)config.json(Polymarket only)requirements.txtREADME.md
User: "I want an AI-powered trading bot that uses Claude to analyze prediction markets on both Polymarket and Kalshi. It should find mispricings above 8%, use Kelly criterion for position sizing, and track its own API costs. Budget is $10,000."
Response Flow:
- Generate complete system with all components
- Integrate Claude API for analysis
- Implement Kelly criterion sizing
- Add API cost tracking
- Support both platforms
- Set initial_bankroll: 10000
- Include comprehensive analytics
Files Generated:
ai_trading_bot.py(full version)market_scanner.pyclaude_analyzer.pykelly_calculator.pytrade_executor.pyrisk_manager.pyconfig.json(both platforms)performance_analyzer.pyrequirements.txtREADME.md(comprehensive)
User: "Create a conservative trading bot for prediction markets. I want minimal risk - only trade when you're very confident and the edge is large."
Response Flow:
- Use
examples/config_conservative.jsonas template - Set high thresholds (min_edge: 0.15, min_confidence: 0.80)
- Use small Kelly fraction (0.10)
- Limit positions (max 5)
- Document conservative approach
- Explain trade-offs
Key Config Settings:
{
"strategy": {
"min_edge": 0.15,
"min_confidence": 0.80
},
"risk": {
"max_kelly_fraction": 0.10,
"max_positions": 5,
"max_position_size": 500
}
}User: "Help me build an aggressive trading bot. I want to find lots of opportunities and size positions optimally for maximum growth."
Response Flow:
- Use
examples/config_aggressive.jsonas template - Lower thresholds (min_edge: 0.05, min_confidence: 0.50)
- Higher Kelly fraction (0.50)
- More positions (max 20)
- Include clear risk warnings
- Document aggressive approach
Key Config Settings:
{
"strategy": {
"min_edge": 0.05,
"min_confidence": 0.50
},
"risk": {
"max_kelly_fraction": 0.50,
"max_positions": 20,
"max_position_size": 2000
}
}User: "Build a trading bot that can do arbitrage between Polymarket and Kalshi when the same event is priced differently."
Response Flow:
- Enable both platforms
- Add market matching logic
- Implement price comparison
- Account for transaction fees
- Add simultaneous execution
- Document arbitrage strategy
Key Features:
# Match markets across platforms
matched = find_matching_markets(poly_markets, kalshi_markets)
# Calculate arbitrage opportunity
for pair in matched:
spread = abs(pair.poly_price - pair.kalshi_price)
net_spread = spread - total_fees
if net_spread > min_arbitrage_spread:
# Buy low, sell high
execute_arbitrage(pair)User: "I need performance analytics for my trading bot. Show me win rates, profit curves, Sharpe ratio, and how accurate Claude's predictions are."
Response Flow:
- Focus on
performance_analyzer.py - Add backtesting framework
- Include visualization tools
- Claude calibration analysis
- Skip trade execution components
Key Metrics:
metrics = {
'win_rate': wins / total,
'sharpe_ratio': calculate_sharpe(returns),
'max_drawdown': calculate_drawdown(equity),
'claude_calibration': analyze_predictions(results),
'edge_capture_rate': actual_edge / theoretical_edge
}User: "Create a trading bot but make sure it stays profitable after paying for Claude API costs."
Response Flow:
- Implement detailed cost tracking
- Calculate break-even analysis
- Show cost per market
- Deduct from bankroll
- Include profitability warnings
Cost Analysis:
Markets analyzed: 1,000
Cost per market: $0.0105
Total API cost: $10.50
Expected profit: $400
Net profit: $389.50
ROI on API: 37x ✓
Break-even edge: 2.6%
Your edge: 8%
Safety margin: 3.1x
User: "Build a trading bot for Kalshi only. Focus on political markets and use medium risk."
Response Flow:
- Enable only Kalshi
- Filter for political category
- Use moderate parameters
- Kalshi-specific documentation
- Include API setup for Kalshi
Key Config:
{
"platforms": {
"polymarket": {"enabled": false},
"kalshi": {"enabled": true}
},
"filters": {
"categories": ["politics"]
},
"risk": {
"max_kelly_fraction": 0.20
}
}User: "I want to backtest a trading strategy on historical prediction market data."
Response Flow:
- Create backtesting framework
- Add historical data loader
- Simulate trades with strategy
- Calculate performance metrics
- Compare vs buy-and-hold
Backtest Structure:
def backtest_strategy(historical_markets, strategy):
bankroll = initial_bankroll
trades = []
for market in historical_markets:
signal = strategy.analyze(market)
if signal:
result = simulate_trade(signal, market.outcome)
bankroll += result.profit
trades.append(result)
return analyze_performance(trades, bankroll)User: "Create a fully autonomous trading bot that runs continuously, analyzes markets every hour, and pays its own API bills."
Response Flow:
- Add scheduling logic (run every hour)
- Implement continuous mode
- Autonomous execution (no manual approval)
- Automatic cost payment
- Add monitoring/logging
- Include start/stop scripts
Continuous Mode:
async def run_autonomous():
while True:
try:
await run_trading_cycle()
logger.info("Cycle complete. Sleeping 1 hour...")
await asyncio.sleep(3600)
except KeyboardInterrupt:
logger.info("Stopped by user")
break
except Exception as e:
logger.error(f"Error: {e}")
await asyncio.sleep(60)# Monitor RSS feeds
# Re-analyze on breaking news
# Fast reaction trading# Combine value + momentum + arbitrage
# Weight by past performance
# Dynamic allocation# Automatic rebalancing
# Trailing stops
# Take profit levels# Correlation analysis
# Drawdown alerts
# Performance attributionChoose template based on request:
| User Request | Template | Key Settings |
|---|---|---|
| "Simple bot" | Basic | Single platform, dry run |
| "AI-powered" | Full | Claude analysis, both platforms |
| "Conservative" | Conservative | High thresholds, small Kelly |
| "Aggressive" | Aggressive | Low thresholds, large Kelly |
| "Arbitrage" | Arbitrage | Both platforms, matching |
| "Analytics" | Analytics | No execution, just analysis |
| "Profitable" | Cost-focused | Track costs, profitability |
- Always ask clarifying questions first
- Use appropriate template as starting point
- Customize based on specific needs
- Include relevant examples in README
- Test configuration before delivering
- Provide clear next steps
Bot is ready when it has:
- All required files
- Valid configuration
- Clear documentation
- Working dry-run mode
- Risk warnings
- Cost analysis
- Setup instructions
- Example usage