Skip to content

BattermanZ/MPP

Repository files navigation

MPP

MPP is a Rust command-line tool that plays World Cup 2026 prediction pools by modelling match outcomes and submitting optimised picks automatically. It reads bookmaker odds and team strength, turns them into a probability distribution over scorelines, picks the entry that maximises expected pool points given the current standings, and writes those picks back to the game.

It drives two games from one model:

  • mpp.football (the primary game), through its authenticated JSON API, with no browser.
  • poules.com (a secondary pool that has no clean API), through a small headless Playwright bridge.

Note: these are skill-based prediction pools, not money betting. MPP automates your own entry using your own account credentials.

How it works

The daily pipeline (one command, mpp run) chains these steps:

  1. Fetch current bookmaker odds from the-odds-api.com.
  2. Sync results, market odds, crowd picks, standings, and the pick ledger into a local SQLite store.
  3. Refit the self-tuning knobs (standings aggression, a draw nudge) from settled gameweeks, and replay the latest one out of sample.
  4. Recommend a scoreline per fixture. Odds and team strength feed a Poisson score grid, blended with an expected-goals prior and Elo ratings, to get a full probability distribution over scores rather than a single guess.
  5. Strategy adjusts each pick for your position in the table: chase variance when behind, protect a lead when ahead.
  6. Submit the picks (coverage mode fills every open fixture).
  7. Refresh the poules.com pool from the same model.

A separate Telegram digest reports the imminent kickoff slot, the picks, and the per-league probability of gaining or dropping a place.

Modelling

  • Poisson score grids (poisson.rs) as the base distribution over scorelines.
  • Expected goals (xg.rs) and Elo (elo.rs) as priors blended into the grid.
  • Value / edge (value.rs) against the bookmaker line.
  • Self-tuning fit (fit.rs) that re-derives model knobs from settled results.
  • Backtesting and replay (backtest.rs, replay.rs, simulate.rs) for out-of-sample checks and standings simulations.

Storage

A SQLite store with schema migrations (src/db/). The store can be dumped to SQL, exported, and restored, so the binary data never needs to be committed.

Commands

mpp run            # daily one-shot: fetch, sync, refit, recommend, strategy, submit, poules
mpp fetch          # pull bookmaker odds
mpp sync           # ingest results / odds / standings / ledger
mpp refit          # re-derive the self-tuning knobs
mpp recommend      # per-fixture pick + edges
mpp strategy       # standings-aware adjustment
mpp submit --all   # write picks to mpp.football
mpp bonus <id>     # place the one-per-tournament bonus
mpp poules         # compute the poules.com pool picks (group scores, bracket, props)
mpp backtest       # score the model against settled results
mpp standings      # show league tables
mpp upcoming       # fixtures in the next N hours
mpp db <action>    # dump / export / restore / verify the store

mpp run --dry-run previews everything and writes no picks. --no-poules runs the mpp.football side only. --no-fetch skips the Odds API call and reuses existing odds.

See CHEATSHEET.md for the full operator runbook.

Stack

Rust (clap, dotenvy, rusqlite) for the engine and CLI. Node with playwright-core for the poules.com bridge, which exists only because that site has no public API.

Setup

cp .env.example .env      # fill in API key and account credentials
cargo build --release
cargo install --path .    # optional: put `mpp` on your PATH
npm install               # only if you use the poules.com bridge

Configuration is read from .env (see .env.example). All secrets stay in .env and the two auth caches (.mpp_auth.json, .poules_session.json), all gitignored.

Development

cargo test                # unit and integration tests
cargo clippy -- -D warnings

License

GNU General Public License v3.0 (GPL-3.0). See LICENSE.

About

World Cup 2026 prediction-pool engine in Rust: bookmaker-odds ingestion, a Poisson/xG/Elo model, edge scoring, standings-aware pick strategy, and automated submission.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors