Roster rules
1 Captain + 5 UTIL from a single game, $50,000 salary cap. The Captain costs 1.5× salary and scores 1.5× fantasy points. Pitchers and hitters are both eligible in every slot, and each lineup needs at least one player from each team (max 5 from one team).
Scoring (DraftKings MLB)
Hitters: single 3, double 5, triple 8, home run 10, RBI 2, run 2, walk 2, hit-by-pitch 2, stolen base 5. Pitchers: inning pitched 2.25, strikeout 2, win 4, earned run −2, hit/walk/HBP allowed −0.6 each, plus complete-game and no-hitter bonuses.
Projections
Each hitter's singles, doubles, home runs, RBIs, runs, walks and steals are solved from no-vig DraftKings/FanDuel prop prices (Poisson means), then converted to DK points and softly reconciled to the team's implied runs. Pitchers use strikeout, outs, earned-run, hits-allowed and win props. Openers and bulk relievers DraftKings flags without props get an innings-based estimate. Hitters with no props are treated as out of the lineup.
Optimizer
For each eligible Captain, a depth-first search walks UTIL candidates sorted by objective value, pruning any branch that can't beat the current top-K pool or breaks the cap. Lineups that pass every stacking rule enter a heap; the final set is drawn greedily with randomized projections, minimum-unique and exposure limits.
Live refresh
Refresh live data pulls the current DraftKings moneyline and total plus the probable pitchers from ESPN's public MLB scoreboard. Implied runs move by however much the market moved, and every projection rescales (hitters with their own team's runs, pitchers inversely with the opponent's). Projections you typed in by hand are never overwritten.
Correlation model
Each simulation draws three latent factors: the game's run environment and each team's offense. Hitters load on their own offense (so teammates move together — the basis of stacking), while pitchers load negatively on the opposing offense. That makes a pitcher and the hitters he faces negatively correlated, which is why the "max hitters facing your own pitcher" rule is on by default (1 allows a single bring-back bat, since every lineup needs a player from both teams).
Distribution
Outcomes are log-normal (right-skewed): hitters are very volatile (σ 0.90 — most games are 0–7 points, a few are 20+), pitchers steadier (σ 0.50). Each simulation samples a game script from your mix weights.