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. Every position (PG, SG, SF, PF, C) is eligible in every slot, and each lineup needs at least one player from each team (max 5 from one team).
Scoring (DraftKings NBA)
Point +1, made 3-pointer +0.5, rebound +1.25, assist +1.5, steal +2, block +2, turnover −0.5, double-double +1.5, triple-double +3.
Projections
Players with DraftKings/FanDuel props (points, rebounds, assists, made threes) get each stat solved from the over price (normal approximation for counting stats, Poisson for threes), with the missing stats filled in from role-based per-point rates, then converted to DK scoring. Everyone else blends DK's season average with a salary-implied number. In preseason, both are scaled by the factor the posted props imply (stars play fewer minutes). OUT players are excluded automatically; Q players are tagged.
Starting lineups
Green START tags come from DraftKings' "Starter" flags in the salary file, or from the ESPN box score once a game tips off (Refresh live data). Once a team's starting five is confirmed, everyone else on that team is tagged BENCH and the Captain-must-be-a-starter and max-bench rules switch on for that team. Bench players are modeled as more volatile.
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 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 spread and total from ESPN's public NBA scoreboard plus the starting fives from the box score. Implied team points move by however much the market moved and every projection rescales. Projections you typed in by hand are never overwritten.
Correlation model
Each simulation draws four latent factors: game pace, each team's offense, and a blowout factor. Everyone loads on pace (so both sides rise together in a track meet — the basis of bring-backs), players load on their own team's offense, and the blowout factor pulls minutes from starters and hands them to the bench.
Distribution
Outcomes are log-normal (right-skewed). Starters are fairly steady (σ about 0.40) because minutes are predictable; bench players are about 35% more volatile. Each simulation samples a game script from your mix weights.