TL;DR — the complete bot in 15
What this page covers
- Screening Kalshi and Polymarket for high-volume, high-edge opportunities
- Running AI-powered analysis on promising markets (async trigger/poll/retrieve pattern)
- Generating trading signals with Kelly criterion position sizing
- Executing paper trades via shadow trading to validate your strategy
- Tracking portfolio performance (win rate, P&L, open positions)
- Extending the bot with scheduling, webhooks, arbitrage, and portfolio-aware signals
Prerequisites
| Requirement | Why |
|---|---|
| Python 3.10+ | Type hints and match statements used in examples |
| httpx | HTTP client — pip install httpx or uv add httpx |
| Rekko API key | Sign up free — no credit card required |
| Platform credentials (optional) | Kalshi or Polymarket API keys for live order execution |
Step-by-step tutorial
Set up the client
Create an authenticated client that you will reuse for every call. Set a generous timeout because analysis calls run a multi-stage research pipeline that takes 30-90 seconds.
Screen markets for opportunities
The screening endpoint scores markets across a platform and returns the top candidates ranked by a composite of volume, price movement, and edge potential. Use it to find markets worth analyzing.Each result includes:
Filter by category to focus on a specific domain:
| Field | Description |
|---|---|
market_id | Platform-specific ticker (e.g. KXFED-26MAR19) |
platform | "kalshi" or "polymarket" |
title | Human-readable market question |
score | Composite opportunity score (0-100) |
volume_24h | 24-hour trading volume in dollars |
yes_price | Current YES contract price (0-1) |
action | Quick recommendation: "ANALYZE", "WATCH", or "SKIP" |
Python
Get AI analysis on promising markets
Analysis runs a multi-stage research pipeline that takes 30-90 seconds. The pattern is: trigger, poll, retrieve.
Generate a trading signal
A signal wraps analysis into an actionable recommendation with Kelly criterion position sizing. Use
?wait=true for a synchronous response instead of the trigger/poll pattern.Signal fields
| Field | Type | Description |
|---|---|---|
recommendation | string | "BUY_YES", "BUY_NO", or "NO_TRADE" |
target_price | float | Rekko’s estimated fair price (0-1) |
edge | float | Difference between fair price and market price |
confidence | float | Confidence in the estimate (0-1) |
risk_rating | string | "low", "medium", or "high" |
size_pct | float | Kelly-derived position size as fraction of bankroll |
time_horizon | string | "hours", "days", or "weeks" |
hedge | string | Suggested hedge position (if applicable) |
expires_at | string | ISO 8601 timestamp — do not trade after this time |
Execute the trade (paper trading)
Rekko provides intelligence — execution happens on the platform. Start with shadow trading (paper trades) to validate your strategy before risking real capital.Shadow trades track the market price at entry, simulate fills, and resolve automatically when the market settles. They cost nothing and use the same tracking infrastructure as live trades.
When you are ready for live execution
Rekko does not execute live trades on your behalf. Use the execution guidance endpoint to get platform-specific order parameters, then place the order using your platform’s API:Python
Complete script
Here is the full bot as a single copy-paste-ready Python script. It screens markets, analyzes the top candidate, generates a signal, and places a shadow trade.Python
Going further
Schedule the bot on a cron
Run the script every hour to continuously screen for new opportunities:Portfolio-aware signals
When you have multiple open positions, standard signals do not account for correlation. The portfolio signal endpoint considers your existing holdings and adjusts sizing to avoid concentration:Python
Cross-platform arbitrage
Find price discrepancies between Kalshi and Polymarket on the same event:Python
Use Rekko from your AI coding assistant
Install the Rekko MCP server to query markets, run analyses, and generate signals directly from your editor:How the pieces fit together
| Step | Endpoint | Tier | Cost |
|---|---|---|---|
| Screen markets | POST /v1/screen | INSIGHT | $0.10 |
| Trigger analysis | POST /v1/markets/{p}/{id}/analyze | INSIGHT | $0.10 |
| Poll status | GET /v1/markets/{p}/{id}/analyze/{id}/status | Free | $0.00 |
| Retrieve analysis | GET /v1/markets/{p}/{id}/analysis | INSIGHT | $0.10 |
| Generate signal | POST /v1/signals | STRATEGY | $2.00 |
| Shadow trade | POST /v1/trades/shadow | Free | $0.00 |
| Portfolio | GET /v1/portfolio | Free | $0.00 |
| Performance | GET /v1/performance | Free | $0.00 |
What’s next
Prediction market API comparison
Compare Rekko with Kalshi, Polymarket, and other market data APIs.
Cross-platform arbitrage
Find and exploit price gaps between Kalshi and Polymarket.
Kelly criterion sizing
Deep dive on the math behind position sizing.
API reference
Full endpoint documentation with interactive playground.
MCP integration
Use Rekko from your AI coding assistant.