Skip to content

Instantly share code, notes, and snippets.

@tom-wagner
Last active September 28, 2025 21:57
Show Gist options
  • Save tom-wagner/a62fb2b3dcbe54e76bd73c47e1a5d618 to your computer and use it in GitHub Desktop.
Save tom-wagner/a62fb2b3dcbe54e76bd73c47e1a5d618 to your computer and use it in GitHub Desktop.
Kalshi NFL workflow

Full Order Pipeline Overview

This pipeline turns market data and probabilistic forecasts into executable orders by fusing rating inputs, Monte Carlo simulations, and Kalshi order book intelligence into a single automated run.

  1. Assemble Inputs – Pull team power ratings, load the win distribution tables published by Inpredict NFL to anchor game-level priors, and ingest the latest Kalshi win-total, exact-win, and futures order books.
  2. Run Season Simulationsnfl/scripts/bash/simulate_win_totals_and_exact_wins_and_futures runs a league-wide Monte Carlo that samples the Inpredict odds, applies custom tie-breaker logic for division and conference standings, and stores outcome frequencies for every team and market tenor.
  3. Summarize Outputs – The simulator exports distributions for season win totals, exact win counts, and futures probabilities, which become the quantitative inputs for pricing edges against Kalshi markets.
  4. Refresh Position Statescripts/bash/run_positions_pipeline.sh snapshots existing exposures, outstanding shares, and bankroll constraints so recommendations respect live risk limits.
  5. Screen Marketsscripts/generate_skip_list.py computes a MAD-based filter that marks teams or contracts where projections are unstable or books are illiquid, creating a skip list used by downstream logic.
  6. Generate Trade Ideasscripts/generate_recommended_orders.py compares simulated fair prices to Kalshi bid/ask ladders, net of the skip list and risk tolerances, and writes structured recommendations to outputs/recommended_orders/*.json.
  7. Validate Artifacts – The wrapper confirms the recommendation file path, ensuring a fresh JSON exists before attempting execution.
  8. Submit Ordersscripts/place_recommended_orders.py --input <file> sends sized orders back to Kalshi, targeting the identified overlays while honoring current book depth and the skip constraints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment