Open source · edge detection and risk-gated execution for Kalshi markets.

View source
Edge-Radar ai-automation-tools.dev
Kalshi · Sports · Prediction markets

Research first. Execute second.

Edge-Radar compares Kalshi's price against an independent fair value built from sportsbook consensus and public data feeds. A bet fires only when the gap clears the exchange fee and every risk gate, and it is sized by fractional Kelly.

Dry run by default. Not financial advice: the repo documents its losing segments as carefully as its winning ones.

21
Risk gates
7
Pipeline stages
30
Sport filters
5
Agent roles

How It Works

Pull Kalshi's market price. Pull an independent fair value from sportsbooks / data feeds. If the gap, net of the exchange fee, clears 21 risk gates, a Kelly-sized bet fires through the Kalshi trade API.

fair_value − market_ask = edge · when edge ≥ threshold & gates pass → bet
Reference Price
independent fair values, pulled from public APIs
The Odds API
GET
api.the-odds-api.com /v4/sports/…/odds
8–20 sportsbook lines → no-vig consensus
Sports stats
statsapi.mlb.com
api-web.nhle.com
site.api.espn.com
Crypto / weather / equity
api.coingecko.com
api.weather.gov
query1.finance.yahoo.com
Edge Engine
the seven-stage pipeline that finds & sizes the bet
Kalshi market data
GET
api.elections.kalshi.com /markets, /orderbook
live ask, bid, volume, expiry
Fair-value model
ticker → ML · SP · TO · FU · PR
de-vig, Poisson totals, Elo, hold-out
Edge calculation
fair − ask, with confidence tier
edge ≥ 3% + fee (per-sport floors)
21 risk gates
daily loss · per-event cap · series dedup
NO-favorite floor · min price · confidence
edge ceiling 50% · exposure caps · 10% hard stop
Kelly sizing
fractional Kelly · capped at MAX_BET_SIZE
half-Kelly on cheap NO bets
Execute & Track
wagers, settlement, calibration loop
Kalshi trade API
POST
api.elections.kalshi.com /portfolio/orders
RSA-PSS signed limit order
Position & fills
GET
/portfolio/positions · /fills
track exposure · trim stale orders
Settle & calibrate
27-field settlement record
Brier score feeds back into thresholds
Notify
email reports · daily digest
daily integration-drift check
Outcomes loop back: settled results re-calibrate thresholds & confidence tiers
DRY_RUN=true default · 21 gates · spec

Pipeline

Seven sequential stages. Scan → Size → Execute → Settle.

01
Fetch
Kalshi + Odds API
02
Categorize
ticker → model
03
Compare
fair vs ask
04
Cap
per-event dedup
05
Risk
21 gates
06
Execute
RSA-signed limit
07
Monitor
settle + calibrate
Risk gates · CLAUDE.md § Execution Gates Edge models · ML · SP · TO · FU · PR Settler · make settle

Coverage

What the scanner prices. Each segment carries its own edge floor.

Sports
NBA · NHL · MLB · NFL · NCAA · MLS · soccer · UFC · boxing · F1 · NASCAR · PGA · IPL · tennis · esports
Moneylines, spreads and totals
Prediction
Crypto (BTC, ETH, XRP, DOGE, SOL) · weather in 13 cities · S&P 500
Off by default behind ALLOW_PREDICTION_BETS
Futures
NFL · NBA · NHL · MLB championships · PGA majors
Priced from sportsbook outright odds

Quick Start

Python 3.11+. A preview risks nothing, and DRY_RUN=true is the default even with --execute.

git clone https://github.com/ai-automation-tools/Edge-Radar.git
cd Edge-Radar
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env            # add Kalshi + Odds API keys

python scripts/doctor.py        # validate the environment
python scripts/scan.py sports --filter nba --date today   # preview only