$npx -y skills add machina-sports/sports-skills --skill bettingBetting analysis — odds conversion, de-vigging, edge detection, Kelly criterion, arbitrage detection, parlay analysis, and line movement. Pure computation, no API calls. Works with odds from any source: ESPN (American odds), Polymarket (decimal probabilities), Kalshi (integer pro
| 1 | # Betting Analysis |
| 2 | |
| 3 | Before writing queries, consult `references/api-reference.md` for odds formats, command parameters, and key concepts. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | ```bash |
| 8 | sports-skills betting convert_odds --odds=-150 --from_format=american |
| 9 | sports-skills betting devig --odds=-150,+130 --format=american |
| 10 | sports-skills betting find_edge --fair_prob=0.58 --market_prob=0.52 |
| 11 | sports-skills betting evaluate_bet --book_odds=-150,+130 --market_prob=0.52 |
| 12 | sports-skills betting find_arbitrage --market_probs=0.48,0.49 |
| 13 | sports-skills betting parlay_analysis --legs=0.58,0.62,0.55 --parlay_odds=600 |
| 14 | sports-skills betting line_movement --open_odds=-140 --close_odds=-160 |
| 15 | ``` |
| 16 | |
| 17 | Python SDK: |
| 18 | ```python |
| 19 | from sports_skills import betting |
| 20 | |
| 21 | betting.convert_odds(odds=-150, from_format="american") |
| 22 | betting.devig(odds="-150,+130", format="american") |
| 23 | betting.find_edge(fair_prob=0.58, market_prob=0.52) |
| 24 | betting.find_arbitrage(market_probs="0.48,0.49") |
| 25 | betting.parlay_analysis(legs="0.58,0.62,0.55", parlay_odds=600) |
| 26 | betting.line_movement(open_odds=-140, close_odds=-160) |
| 27 | ``` |
| 28 | |
| 29 | ## CRITICAL: Before Any Analysis |
| 30 | |
| 31 | CRITICAL: Before calling any analysis command, verify: |
| 32 | - Odds format is correctly identified (american, decimal, or probability). |
| 33 | - ESPN odds are de-vigged with `devig` before computing edge vs prediction market prices. |
| 34 | - This module computes — it does not fetch. Obtain odds from sport-specific skills or polymarket/kalshi first. |
| 35 | |
| 36 | ## Workflows |
| 37 | |
| 38 | ### Compare ESPN vs Polymarket/Kalshi |
| 39 | |
| 40 | 1. Get ESPN moneyline odds (e.g., from `nba get_scoreboard`): Home: `-150`, Away: `+130` |
| 41 | 2. Get Polymarket/Kalshi price for the same outcome (e.g., home at `0.52`) |
| 42 | 3. De-vig: `devig --odds=-150,+130 --format=american` → Fair: Home 57.9%, Away 42.1% |
| 43 | 4. Compare: `find_edge --fair_prob=0.579 --market_prob=0.52` → Edge: 5.9%, EV: 11.3% |
| 44 | 5. Or all in one step: `evaluate_bet --book_odds=-150,+130 --market_prob=0.52` |
| 45 | |
| 46 | ### Arbitrage Detection |
| 47 | |
| 48 | 1. Get best price per outcome from different sources (Polymarket home at 0.48, Kalshi away at 0.49) |
| 49 | 2. `find_arbitrage --market_probs=0.48,0.49 --labels=home,away` |
| 50 | 3. Total implied 0.97 (< 1.0) → arbitrage found, guaranteed ROI: 3.09% |
| 51 | |
| 52 | ### Parlay Evaluation |
| 53 | |
| 54 | 1. De-vig each leg: Leg 1 → 0.58, Leg 2 → 0.55, Leg 3 → 0.50 |
| 55 | 2. `parlay_analysis --legs=0.58,0.55,0.50 --parlay_odds=600` |
| 56 | 3. Returns combined fair probability, edge, and Kelly fraction |
| 57 | |
| 58 | ### Line Movement Analysis |
| 59 | |
| 60 | 1. Get ESPN open and close lines: Open -140, Close -160 |
| 61 | 2. `line_movement --open_odds=-140 --close_odds=-160` |
| 62 | 3. Returns probability shift, direction, and classification (sharp_action, steam_move, etc.) |
| 63 | |
| 64 | ## Examples |
| 65 | |
| 66 | Example 1: Edge check using ESPN and Polymarket prices |
| 67 | User says: "Is there edge on the Lakers game? ESPN has them at -150 and Polymarket has them at 52 cents" |
| 68 | Actions: |
| 69 | 1. Call `devig(odds="-150,+130", format="american")` → fair home probability ~58% |
| 70 | 2. Call `find_edge(fair_prob=0.58, market_prob=0.52)` → edge ~6%, positive EV |
| 71 | 3. Call `kelly_criterion(fair_prob=0.58, market_prob=0.52)` → optimal bet fraction |
| 72 | Result: Present edge percentage, EV per dollar, and recommended bet size as % of bankroll |
| 73 | |
| 74 | Example 2: Arbitrage opportunity detection |
| 75 | User says: "Can I arb this? Polymarket has home at 48 cents and Kalshi has away at 49 cents" |
| 76 | Actions: |
| 77 | 1. Call `find_arbitrage(market_probs="0.48,0.49", labels="home,away")` |
| 78 | 2. Check `arbitrage_found` in result |
| 79 | Result: If arbitrage: present allocation percentages and guaranteed ROI. If not: present overround and explain no guaranteed profit |
| 80 | |
| 81 | Example 3: Parlay evaluation |
| 82 | User says: "Is this 3-leg parlay at +600 worth it?" |
| 83 | Actions: |
| 84 | 1. De-vig each leg to get fair probabilities (e.g., 0.58, 0.62, 0.55) |
| 85 | 2. Call `parlay_analysis(legs="0.58,0.62,0.55", parlay_odds=600)` |
| 86 | Result: Present combined fair probability, edge, EV, +EV or -EV verdict, and Kelly fraction |
| 87 | |
| 88 | Example 4: Line movement interpretation |
| 89 | User says: "The line moved from -140 to -160, what does that mean?" |
| 90 | Actions: |
| 91 | 1. Call `line_movement(open_odds=-140, close_odds=-160)` |
| 92 | Result: Present probability shift, direction, magnitude, and classification (sharp action, steam move, etc.) |
| 93 | |
| 94 | Example 5: De-vig a standard spread |
| 95 | Use |