feat(predict): add UCL soccer support with 3-way draw markets#28121
feat(predict): add UCL soccer support with 3-way draw markets#28121
Conversation
- Add 'ucl' to PredictSportsLeague type - Add soccer game periods (1H, 2H, ET, PK) to PredictGamePeriod - Add groupItemThreshold to PredictOutcome for 3-way market ordering - Add isDrawCapableLeague() utility for draw-capable league detection - Refactor LEAGUE_SLUG_PATTERNS to LEAGUE_SLUG_CONFIGS with teamOrder support (home-away for soccer vs away-home for NFL/NBA) - Add UCL slug pattern with alphanumeric team abbreviations - Update formatPeriodDisplay for soccer periods
- Propagate groupItemThreshold from PolymarketApiMarket to PredictOutcome with numeric coercion (API returns strings) - Override generic 'Yes' token titles with groupItemTitle for negRisk moneyline markets (team name or 'Draw') - Add slug-based outcome label resolution for API positions: extract outcome identifier from position slug and resolve via TeamsCache - Add eventSlug to PolymarketPosition type - Fix outcome matching in handleBuyPress to find the outcome containing the pressed token (backward-compatible for 2-way markets)
…kets - Add 'draw' variant to PredictBetButtonVariant with muted theme tokens - Stack button label and price vertically for graceful wrapping - Render optional draw button between yes/no in PredictBetButtons - Detect draw-capable game markets in PredictActionButtons and build 3-button config sorted by groupItemThreshold (Home|Draw|Away) - Subscribe to 3 token IDs for live price updates - Add draw button test ID and update all test assertions
- Fix outcome resolution in handleBuyPress and handleBetPress to find the outcome containing the pressed token (supports 3-way markets) - Add home-first team ordering in scoreboard for soccer leagues - Show 'Make your prediction' label for draw-capable leagues - Remove 'to win' suffix from position pick labels on sport cards - Add text truncation with ellipsis for long team names - Remove unused color prop from PredictSportTeamLogo - Add make_your_prediction localization string
- Replace hardcoded 2-series checks with dynamic length checks - Add 3rd line for draw token with muted theme color - Generalize getSeparatedLabelYPositions for N label positions - Remove 2-series cap from PredictGameChartContent - Sort outcomes by groupItemThreshold for consistent line ordering
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
app/components/UI/Predict/components/PredictSportScoreboard/PredictSportScoreboard.tsx
Show resolved
Hide resolved
app/components/UI/Predict/components/PredictGameChart/PredictGameChart.constants.ts
Show resolved
Hide resolved
…ring, negRisk guard
app/components/UI/Predict/components/PredictGameChart/PredictGameChart.constants.ts
Show resolved
Hide resolved
app/components/UI/Predict/components/PredictActionButtons/PredictActionButtons.tsx
Outdated
Show resolved
Hide resolved
app/components/UI/Predict/components/PredictGameChart/PredictGameChart.constants.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
app/components/UI/Predict/components/PredictGameChart/PredictGameChart.constants.test.ts
Show resolved
Hide resolved
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
SmokePredictions: Directly tests the Predictions/Polymarket feature - all changes are in this domain. UCL support, draw betting flows, scoreboard rendering, and bug fixes all need E2E validation. SmokeWalletPlatform: Per tag description, Predictions is a section inside the Trending tab, and changes to Predictions views (headers, lists, full views) affect Trending. The Predict feature changes could affect how Predictions content appears in Trending. SmokeConfirmations: Per SmokePredictions tag description, opening/closing positions are on-chain transactions - when selecting SmokePredictions, also select SmokeConfirmations. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|




Description
Adds UEFA Champions League (UCL) soccer support to the Predict product. Unlike NFL/NBA where one team always wins, soccer matches can end in a draw. This introduces 3-way market support throughout the prediction flow — from data parsing to UI rendering.
Key changes:
uclleague type with home-first team ordering (opposite of NFL/NBA)PredictOutcomes sorted bygroupItemThresholdChangelog
CHANGELOG entry: Added UCL soccer league support with 3-way draw predictions
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/PRED-755
Manual testing steps
Screenshots/Recordings
**Before **
N/A — UCL soccer was not previously supported
After
Before vs After screenshots:
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Medium risk because it expands core Predict flows (market parsing, outcome/token selection, live price subscriptions, and chart rendering) from 2-way to 3-way outcomes, which could cause mismatched outcome/token mapping or incomplete data rendering if backend data is inconsistent.
Overview
Adds 3-way (home/draw/away) support for draw-capable leagues (now including
ucl), with a newisDrawCapableLeaguehelper andgroupItemThresholdordering used to consistently sort outcomes/tokens.Updates the prediction UI to render an optional DRAW bet button (new
drawvariant + testIDs), split bet button label/price into separate lines, and ensures bet/preview navigation selects the matching outcome for the tapped token (inPredictMarketDetailsandPredictSportCardFooter).Generalizes game visuals for soccer:
PredictGameChartnow supports N-series (incl. draw line with muted color) and improves endpoint label collision handling for 3+ labels; the scoreboard and footer copy adapt to home-first leagues.Enhances Polymarket integration by adding
uclslug parsing (home-away order), surfacinggroupItemThresholdon outcomes, improving negRisk token titles (e.g., “Draw”), and resolving negRisk position outcome labels fromeventSlug/slug with optional team lookup.Written by Cursor Bugbot for commit 024cc19. This will update automatically on new commits. Configure here.