Skip to main content

Trade context and strength

Trade context combines current ESPN ownership with completed fantasy scoring and upcoming matchups. Use it to inspect the roster and strength evidence behind a trade score.

Which snapshot and horizon do you get?​

Request or evidenceRule
RESTGET /v1/trade/context
MCPget_league_trade_context_model
InputsConfigured league, season, as-of week, horizon
HorizonDefault 4; range 1–18
Inclusive endmin(week + horizon − 1, regular_season_end_week)
MetricsExact-week projections/VORP; explicit internal identity mapping
roster_snapshotFetch time, observed ESPN week, match with requested week
Ownership is current

Historical or future as-of requests still use the current ESPN roster. They do not reconstruct ownership for the requested week.

How is fantasy strength calculated?​

points_per_week = sum(completed_matchup_points) / completed_scoring_weeks
strength_z = (points_per_week − league_mean) / population_standard_deviation
History ruleBehavior
Eligible periodsCompleted regular-season periods ending before both requested and observed ESPN week
Multiweek matchupsDivide totals by actual scoring-week count
Byes, ambiguous matches, incomplete totalsExclude from observations
League mean/stddevUse teams with observations; population standard deviation
At least two observations, zero stddevObserved teams get z=0
Fewer than two observationsZ scores remain null
Team without historyNull strength

Positive z means stronger fantasy scoring. It describes completed points, not win probability or NFL defense strength.

What are committed players?​

committed_players lists our players (ESPN ids) who are in an outgoing offer that is approved, submitting or submitted and not yet resolved. ESPN still shows them on our roster, so recommenders and the worker's LLM fallback must not send them in another trade. Each entry has espn_id and the offer_keys holding him.

An offer stops counting when its resolution is recorded or after OUTGOING_COMMIT_HOURS (default 72) from its executed_at, whichever comes first. The list is read on every call, not from the 60-second cache.

What does schedule coverage mean?​

Weekly statusMeaning
scheduledPairing known; strength may still be null
byeFantasy bye
unavailablePairing unavailable or ambiguous

Schedule strength is the mean opponent z only when every non-bye week has known pairing and strength, with at least one strength observation. Missing opponents are not treated as average strength.

Output fields and read errors
OutputContents
RosterPosition, slot, ESPN injury status, eligible slots and identity mapping
MetricsPer-week projected_points and vorp_score
HistoryCompleted matchup/scoring-week counts and unavailable periods
ScheduleWeek, matchup period, status and opponent strength
CoverageMissing mappings/metrics remain null and counted
HTTP statusCause
422Invalid request
503Context unavailable
504ESPN timeout
502Other ESPN read failure