Overview
Add a tutorial in the examples section showing how to build autonomous prediction market agents using Swarms with the Polymarket and Kalshi APIs. Agents should be able to discover events, reason about outcomes, and place bets programmatically.
References:
What to Cover
1. Market Discovery
- Querying Polymarket and Kalshi for open markets/events
- Filtering events by category (politics, sports, crypto, economics, etc.)
- Parsing event metadata: question, resolution criteria, end date, current odds
2. Single-Agent Pattern
- An agent that fetches events, reasons about probability using LLM judgment, and decides whether to bet
- Example prompt chain: fetch markets → summarize event → estimate probability → compare to market odds → execute if edge exists
3. Multi-Agent Swarm Pattern
- Research Agent — fetches news and context about an event
- Analyst Agent — estimates true probability of an outcome
- Risk Agent — checks position size, exposure limits, bankroll management
- Execution Agent — places the bet via Polymarket CLOB API or Kalshi REST API
4. Code Examples
- Connecting to Polymarket's CLOB API (order placement, balance check)
- Connecting to Kalshi's REST API (create order, get positions)
- Full end-to-end working Python example with Swarms
5. Guardrails & Best Practices
- Max bet size limits
- Logging all agent decisions and trades
- Dry-run / simulation mode before live trading
Suggested File Location
examples/integrations/swarms-polymarket-kalshi-prediction-markets.mdx
Acceptance Criteria
Labels
documentation, example, integrations
Overview
Add a tutorial in the
examplessection showing how to build autonomous prediction market agents using Swarms with the Polymarket and Kalshi APIs. Agents should be able to discover events, reason about outcomes, and place bets programmatically.References:
What to Cover
1. Market Discovery
2. Single-Agent Pattern
3. Multi-Agent Swarm Pattern
4. Code Examples
5. Guardrails & Best Practices
Suggested File Location
examples/integrations/swarms-polymarket-kalshi-prediction-markets.mdxAcceptance Criteria
docs.jsonLabels
documentation,example,integrations