Skip to content

fix(fantasy): always use FantasyCalc redraft rankings, not dynasty - #292

Merged
sfreeman422 merged 2 commits into
masterfrom
fix/fantasycalc-redraft-not-dynasty
Sep 11, 2026
Merged

sfreeman422 merged 2 commits into
masterfrom
fix/fantasycalc-redraft-not-dynasty

Conversation

@sfreeman422

Copy link
Copy Markdown
Collaborator

Feedback addressed

Also make sure it's using redraft not dynasty rankings

Problem

marketValue/positionRank were being sourced from FantasyCalc's dynasty rankings for any Sleeper league configured as dynasty or keeper (resolveLeagueFormat derived isDynasty from league.settings.type). Trade/waiver fairness should be judged on current-season (redraft) value, not long-term dynasty valuation.

Fix

resolveLeagueFormat now always returns isDynasty: false, so the FantasyCalc /values/current API is queried with isDynasty=false for every league regardless of its Sleeper format. QB count and PPR scaling are unaffected.

Verified live: for a dynasty-configured league, Bijan Robinson's marketValue now returns FantasyCalc's redraft value (9984) instead of the dynasty value (11127).

Testing

  • npx vitest run src/fantasy/fantasy.service.spec.ts — 26/26 passing (updated 3 expectations that previously asserted dynasty-derived params/values)
  • Full backend + frontend suite via pre-push hook — all passing
  • Manual live verification against the real FantasyCalc API

Per user feedback, marketValue/positionRank should reflect current-season
redraft value for trade and waiver fairness, not long-term dynasty
valuation. resolveLeagueFormat previously derived isDynasty from the
Sleeper league's keeper/dynasty settings, so dynasty and keeper leagues
were scored against FantasyCalc's dynasty rankings.

isDynasty is now always false regardless of league settings, so the
FantasyCalc API is queried for redraft values/ranks for every league.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 11, 2026 21:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Implementation and tests cover the requested behavior; remaining documentation feedback is non-blocking.

Pull request overview

Updates FantasyCalc integration to always use redraft rankings while preserving league scoring adjustments.

Changes:

  • Forces isDynasty: false for valuation requests.
  • Updates tests for redraft behavior across league formats.
File summaries
File Summary
packages/backend/src/fantasy/fantasy.service.ts Uses redraft FantasyCalc values.
packages/backend/src/fantasy/fantasy.service.spec.ts Verifies redraft parameters and behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/backend/src/fantasy/fantasy.service.ts
Co-authored-by: sfreeman422 <16405652+sfreeman422@users.noreply.github.com>
@sfreeman422
sfreeman422 merged commit c2ef6ec into master Sep 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants