fix(fantasy): always use FantasyCalc redraft rankings, not dynasty - #292
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
🟢 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: falsefor 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.
Co-authored-by: sfreeman422 <16405652+sfreeman422@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feedback addressed
Problem
marketValue/positionRankwere being sourced from FantasyCalc's dynasty rankings for any Sleeper league configured as dynasty or keeper (resolveLeagueFormatderivedisDynastyfromleague.settings.type). Trade/waiver fairness should be judged on current-season (redraft) value, not long-term dynasty valuation.Fix
resolveLeagueFormatnow always returnsisDynasty: false, so the FantasyCalc/values/currentAPI is queried withisDynasty=falsefor every league regardless of its Sleeper format. QB count and PPR scaling are unaffected.Verified live: for a dynasty-configured league, Bijan Robinson's
marketValuenow 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)