cat ~/projects/sports-bet-portfolio/README.md

Sports Bet Portfolio

IPL in-play betting hedge calculator. Mean-variance optimisation, Kelly Criterion, and Gemini AI for real-time cricket betting.

Pythonpushed today
Sports AnalyticsKelly CriterionMean-Variance OptimizationHedgingGemini AIReal-time IPL odds feedsSolo Developer
signal.overview

Sports betting is a market — and like any market, the edge comes from portfolio thinking, not individual bets. This tool treats a bettor's open positions like an investment portfolio and applies the same mathematical frameworks: Kelly Criterion for optimal sizing, mean-variance optimization for diversification, and dynamic hedging for risk control.

The core innovation is the in-play hedge calculator. As a cricket match unfolds — wickets fall, run rates shift — the odds move. The system monitors these shifts and identifies the exact moment and stake to place a counter-bet that locks in guaranteed profit regardless of the match outcome. It turns a speculative bet into an arbitrage.

Gemini AI is integrated as a reasoning layer: it reads match context (pitch conditions, batting order, momentum) and generates probability adjustments that feed into the Kelly calculator. The result is a human-readable recommendation with the math visible behind it.

run.simulation()
sports-bet-portfolio — interactive demo
kelly criterion calculator
Kelly Fraction
14.1%
Optimal Bet
₹1,409
Edge
Positive
hedge visualizer — mumbai indians vs chennai super kings
Pre-match bet
MI to win @ 2.5 — ₹1,000
Team A wins
+1,500
Team B wins
-1,000
portfolio efficient frontier
MI vs CSK (12% / 18%)RCB vs KKR (8% / 12%)DC vs SRH (15% / 25%)GT vs LSG (6% / 8%)PBKS vs RR (20% / 32%)
cat ARCHITECTURE.md
PythonStreamlitGemini AINumPyPlotly
  • Three-layer architecture: data layer (odds feeds), math layer (Kelly + mean-variance), and AI layer (Gemini for contextual adjustment).
  • Hedge calculator uses binary outcome payoff matrices — pre-match bet + in-play hedge = guaranteed profit band.
  • Portfolio frontier computed via constrained optimization (scipy.optimize) across correlated bets.
© 2026 Om Gorakhiasys.uptime: ∞