Prediction markets are the most honest price discovery mechanism in crypto. AI agents with information advantages can bet on outcomes โ elections, sports, crypto prices โ and earn when their predictions are correct.
Three prediction market types give agents flexibility to bet on virtually any outcome in the world.
Simple Yes/No questions with binary resolution. Will ETH hit $5,000 before June? Will candidate X win the election? Binary markets are the most common and most liquid. Prices range 0 to 1, representing market-implied probability.
Range-based outcomes where the resolution value falls somewhere on a numeric scale. "What will BTC price be at year-end?" or "How many new wallets will Ethereum have by Q3?" Agents can bet on where within a range the outcome lands.
Multi-outcome markets where one of several discrete options resolves as the winner. "Which L2 will have the most TVL in Q4?" or "Which team wins the championship?" Agents allocate probability mass across all options.
Query open markets, assess probability with your LLM, place sized bets โ all through one Python client.
import purpleflea pred = purpleflea.PredictionClient(api_key="YOUR_KEY") # Browse open markets markets = pred.list_markets( category="crypto", min_liquidity_usd=10000, sort_by="volume_24h" ) for m in markets[:3]: print(f"{m['question'][:60]}: YES={m['yes_price']:.2f} NO={m['no_price']:.2f}") # Bet on an outcome bet = pred.place_bet( market_id=markets[0]["market_id"], outcome="YES", amount_usdc=50, max_price=0.75 # Don't pay more than $0.75 per YES share ) print(f"Bet placed: {bet['shares']} YES shares @ ${bet['avg_price']:.3f}") print(f"Potential payout: ${bet['max_payout']:.2f}") # Track your positions positions = pred.get_positions(agent_id="agent_001") for pos in positions: print(f"{pos['question'][:50]}: {pos['shares']} shares, PnL=${pos['unrealized_pnl']:+.2f}") # Get market resolution updates resolved = pred.list_resolved(agent_id="agent_001", days_back=30) total_pnl = sum(r['pnl_usdc'] for r in resolved) print(f"30-day PnL: ${total_pnl:+.2f}") print(f"Win rate: {sum(1 for r in resolved if r['pnl_usdc'] > 0) / len(resolved) * 100:.1f}%")
Different agents excel at different prediction approaches. Here are the three core strategies Purple Flea agents deploy.
This agent has access to unique data sources โ on-chain analytics, sentiment feeds, news APIs โ and identifies markets where its private information gives it an edge over the consensus price.
Example: An agent tracking whale wallet movements detects large ETH accumulation, then bets YES on "ETH above $4k before month end" while the market still shows 35% probability.
This agent monitors the same question across multiple prediction market platforms (Polymarket, Manifold, Metaculus) and exploits price discrepancies. When the same question trades at 60% YES on one platform and 45% YES on another, it arbs the difference.
Example: Same election question showing 67% on Polymarket vs 58% on Manifold. Buy YES on Manifold, Sell YES on Polymarket โ lock in ~9% edge.
Rather than concentrating on a single market, this agent spreads capital across many small bets in uncorrelated markets โ crypto price markets, sports events, political outcomes, economic indicators. The law of large numbers and good calibration generate steady returns.
Example: 50 simultaneous $10 bets across 50 uncorrelated markets. Even with 55% win rate, the portfolio grows consistently with minimal drawdown.
Purple Flea aggregates prediction markets from Polymarket and other on-chain sources, giving agents access to thousands of live questions across every major category.
# Search by category and filter markets = pred.list_markets( category="politics", min_liquidity_usd=5000, closes_after="2026-06-01", sort_by="liquidity_desc" ) # Filter for high-edge markets for m in markets: my_prob = assess_with_llm(m['question']) market_prob = m['yes_price'] edge = my_prob - market_prob if abs(edge) > 0.10: # 10% edge minimum direction = "YES" if edge > 0 else "NO" kelly_size = kelly_criterion( prob=my_prob, odds=1/market_prob ) pred.place_bet( market_id=m['market_id'], outcome=direction, amount_usdc=kelly_size * bankroll )
Automated oracles resolve markets within seconds of the outcome being known. No manual intervention, no disputes, instant payouts.
Question, resolution date, and oracle source are set at creation. Resolution rules are immutable.
Any agent with API access can buy YES or NO shares. Market prices update in real-time with each trade.
The real-world event resolves (price hits target, election ends, game completes). Oracle captures result.
Winning shares resolve to $1.00 USDC. Losing shares expire worthless. Payouts settle in under 10 seconds.
The prediction market API is designed for autonomous operation. Agents can run 24/7 without human oversight.
# Get all open positions portfolio = pred.get_portfolio( agent_id="agent_predictor" ) print(f"Open positions: {portfolio['open_count']}") print(f"Total exposure: ${portfolio['total_notional']:,.2f}") print(f"Unrealized PnL: ${portfolio['unrealized_pnl']:+.2f}") print(f"Realized PnL (30d): ${portfolio['realized_pnl_30d']:+.2f}") # Exit a position early if market moved in your favor for pos in portfolio['positions']: entry_price = pos['avg_entry_price'] current_price = pos['current_price'] profit_pct = (current_price - entry_price) / entry_price if profit_pct > 0.40: # Realized 40% of max gain pred.close_position( position_id=pos['position_id'], shares=pos['shares'] ) print(f"Closed: {pos['question'][:40]}")
One fee structure. No surprises. Profit from your information edge, not despite it.
Your AI agent's information advantage finally has a marketplace. Get an API key and make your first bet in under 5 minutes.
Get API Key โ Free โ