Markets Orchestration
Bridges ESPN live schedules (NBA, NFL, MLB, NHL, WNBA, CFB, CBB) with Kalshi and Polymarket prediction markets. Before writing queries, consult references/api-reference.md for supported sport codes, command parameters, and price normalization formats.
Quick Start
Python SDK:
CRITICAL: Before Any Query
CRITICAL: Before calling any orchestration command, verify:
- A
sportcode is provided for sport-aware commands (get_todays_markets,compare_odds,get_sport_markets,evaluate_market). - Price sources are identified correctly before normalization:
espn= American odds,polymarket= 0-1 probability,kalshi= 0-100 integer.
Important Notes
- Sport context is passed through.
--sport=nbamaps automatically to the correct Polymarket sport code and Kalshi series ticker. - Both platforms use sport-aware search. Polymarket uses
sport→ series_id; Kalshi usesKXNBA,KXNFL, etc. - Prices are normalized. Everything is converted to implied probability for comparison.
Workflows
Today's NBA Dashboard
Returns each game with ESPN info, DraftKings odds, matching Kalshi markets, and matching Polymarket markets.
Find Arb on a Specific Game
- Get the ESPN event ID:
get_sport_schedule --sport=nba - Compare odds:
compare_odds --sport=nba --event_id=<id> - If arbitrage detected, response includes allocation percentages and ROI — computed from reference prices (
price_basis: "reference"), so confirm both legs on each venue's order book before trading it. sourcesandcompletenesssay which venues actually priced this game; a provider error is reported aserror, not as "no markets".
Full Bet Evaluation
evaluate_market --sport=nba --event_id=<id> --outcome=0 --fee_per_contract=<dollars per $1 contract>- Verifies the market is this game's full-game winner market for the chosen side, then reads the ask off the order book
- Pipes ask + fee through
betting.evaluate_bet: devig → edge → Kelly - Returns fair probability, edge, EV, Kelly fraction, and recommendation
Without fee_per_contract the ask is reported but evaluation is null — the net numbers are refused rather than assumed free. A ticker or token_id that names another team, another date, or a derivative (first-half, spread) market is refused, not substituted. Fees are not currently settable via the CLI; use the Python wrapper (markets.evaluate_market(..., fee_per_contract=...)).
Same Game on Both Venues
match_markets --sport=mlb --date=2026-06-06- Each match pairs the Kalshi event (with market tickers) and the Polymarket event (with moneyline token IDs) for the same game — joined deterministically on date + team codes, fuzzy title match as fallback.
- Feed
kalshi.market_tickers[i]andpolymarket.markets[i].token_ids[j]straight intoget_market_priceto compare prices.
Price Movement Over Time
get_market_price --venue=kalshi --ticker=<ticker> --at_time=2026-05-01for a single point-in-time price (bothyes/nosides, 0-1).get_price_history --venue=kalshi --ticker=<ticker> --interval=1dfor the full series — same{timestamp, price}shape on either venue.
Examples
Example 1: Today's games with prediction market odds User says: "What NBA games are on today and what are the prediction market odds?" Actions:
- Call
get_todays_markets(sport="nba")Result: Unified dashboard with each game's ESPN info and Kalshi/Polymarket prices
Example 2: Cross-platform team search User says: "Find me Lakers markets on Kalshi and Polymarket" Actions:
- Call
search_entity(query="Lakers", sport="nba")Result: All Lakers markets across both exchanges with prices and volume
Example 3: Odds comparison for a specific game User says: "Compare the odds for this Celtics game across ESPN and Polymarket" Actions:
- Get event_id from
get_sport_schedule(sport="nba") - Call
compare_odds(sport="nba", event_id="<id>")Result: Normalized side-by-side comparison with automatic arbitrage check
Example 4: Full market evaluation User says: "Is there edge on the Chiefs game?" Actions:
- Get event_id from
get_sport_schedule(sport="nfl") - Call
evaluate_market(sport="nfl", event_id="<id>")Result: Fair probability, edge percentage, EV, Kelly fraction, and bet recommendation
Example 5: Browse all markets for a sport User says: "Show me all NFL prediction markets" Actions:
- Call
get_sport_markets(sport="nfl")Result: All open NFL markets across Kalshi and Polymarket
Example 6: Price conversion User says: "Convert a Polymarket price of 65 cents to American odds" Actions:
- Call
normalize_price(price=0.65, source="polymarket")Result: Common structure with implied probability (0.65), American odds (-185.7), and decimal (1.54)
Example 7: Pair a game across venues User says: "Find the Mets game on both Kalshi and Polymarket" Actions:
- Call
match_markets(sport="mlb", date="<game date>")Result: The game paired across venues — Kalshi market tickers and Polymarket moneyline token IDs side by side
Example 8: Historical price User says: "What was France's World Cup price a month ago?" Actions:
- Call
get_market_price(venue="kalshi", ticker="KXMENWORLDCUP-26-FR", at_time="2026-05-03T12:00:00+00:00")Result: Yes/no prices (0-1) as of that moment; useget_price_historyfor the full curve
Commands that DO NOT exist — never call these
— does not exist. Useget_oddscompare_oddsto see odds across sources.— does not exist on the markets module. Usesearch_marketssearch_entityinstead.— does not exist. Useget_scheduleget_sport_scheduleinstead.
If a command is not listed in references/api-reference.md, it does not exist.
Troubleshooting
Error: No markets returned for a sport
Cause: Sport code may be missing or incorrect
Solution: Check references/api-reference.md for valid sport codes. Use the exact code (e.g., nba, epl, laliga)
Error: compare_odds returns no data for an event
Cause: The event_id is incorrect or the game has not been indexed yet
Solution: Call get_sport_schedule(sport=...) to retrieve the correct event_id first
Error: One source shows warnings in the response Cause: Kalshi or Polymarket is temporarily unavailable Solution: The module returns partial results — use what is available. Retry the unavailable source separately using the kalshi or polymarket skill directly
Error: normalize_price returns unexpected American odds value
Cause: Wrong source parameter — Kalshi uses 0-100 integers, Polymarket uses 0-1 decimals
Solution: Verify the source. Kalshi price of 65 requires source="kalshi", Polymarket price of 0.65 requires source="polymarket"
