Skip to main content

Lineup optimization

The lineup solver fills starting slots with the highest total eligible VORP. Use this page to understand a suggested swap or an unavailable-lineup result.

Which metrics does the solver use?​

evaluate_lineup serves the weekly optimizer, matchup suggestions and rumor bench_watch actions. Its pool excludes IR-slot players and Sleeper status Out.

Source choiceRule
Target weekUse non-null target-week VORP if any rostered player outside K/D-ST has it; omit players missing metrics
Prior-week fallbackOtherwise average available VORP over the previous three same-season weeks
Fallback freshnessNewest usable input week must be target week minus one
Fallback byesExclude target-week NFL byes using the schedule; discard prior defense multipliers
No usable sourceRaise InsufficientLineupInputError
Missing data is not an optimal lineup

K/D-ST rows alone do not select target-week mode. Week 1 never borrows the prior season; stale inputs, missing schedules and an empty eligible pool fail evaluation.

Source evidence reports metric_source, source_mode, source_season, source_weeks and held_slots.

How are slots filled?​

maximize Σ selected_player.vorp_score × defense_matchup_multiplier
subject to exactly one eligible player per starting slot
each player occupies at most one slot
Slot or resultBehavior
Position slotAccept its position
FLEXAccept the positions named by the slot
BE, Bench, IRExclude from starter demand
Missing K/D-ST capacityHold the slot; preserve its current starter
Missing skill-position capacityFail the solve
Negative VORPAllow it when needed to fill a slot
Successful solveCBC status must be Optimal
Equal optimaNo explicit manager-preference tie-break

The solver uses position eligibility, not arbitrary ESPN eligible_slots. Missing settings default to QB 1, RB 2, WR 2, TE 1, RB/WR/TE 1, K 1 and D/ST 1; the defense multiplier defaults to 1.0.

How does a swap reach ESPN?​

StageRule
DiffCompare optimal player IDs with current starters
PairMatch adds with same-position removals first, then any remaining removal for FLEX
SlotUse the removed starter's actual roster slot
Held startersNever become removal candidates
IdentityResolve internal IDs to ESPN IDs before publication
EvidenceRetain add/drop VORP, multiplier, season/week and source
Dry run--dry-run evaluates without publishing
IR is a separate action

Stashed players must be activated before they can start. ESPN OUT/INJURY_RESERVE control IR hints; the pregame pool uses Sleeper Out. An ineligible IR occupant can block ESPN transactions.

Publication keys and retry behavior
Setting or outcomeBehavior
Idempotency materialTeam, decision weeks, sorted swap identities and JOB_NAME when available
Same Job retrySame key
Another JobNew decision
Transient gateway failureRetry under the same key
Empty swaps or duplicateReturn false
Exhausted retries or 4xxRaise
CLI weekExplicit --week or shared upcoming-week resolver