Skip to content

feat(predict): add UCL soccer support with 3-way draw markets#28121

Merged
matallui merged 11 commits intomainfrom
predict/soccer
Mar 31, 2026
Merged

feat(predict): add UCL soccer support with 3-way draw markets#28121
matallui merged 11 commits intomainfrom
predict/soccer

Conversation

@matallui
Copy link
Copy Markdown
Contributor

@matallui matallui commented Mar 30, 2026

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:

  • New ucl league type with home-first team ordering (opposite of NFL/NBA)
  • Draw button (gray/muted theme) rendered between team buttons for soccer matches
  • Polymarket negRisk 3-outcome events parsed into 3 PredictOutcomes sorted by groupItemThreshold
  • Game chart generalized from hardcoded 2-series to N-series (3rd line for draw)
  • Scoreboard respects home-first ordering for soccer leagues
  • Position labels resolved from slug-based team lookup via TeamsCache (zero network overhead)
  • Token titles enriched at parse time for negRisk moneyline markets

Changelog

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

Feature: UCL soccer predictions with draw button

  Scenario: user views a UCL match card in the feed
    Given the UCL league is enabled in the feature flag
    And a UCL match event exists on Polymarket

    When user views the Predict feed
    Then a sport card renders with the UCL match
    And the scoreboard shows home team on the left, away team on the right
    And three action buttons appear: Home | DRAW (gray) | Away

  Scenario: user places a draw prediction
    Given user is viewing a UCL match card

    When user taps the DRAW button
    Then the buy preview opens with the draw outcome
    And after purchase, the position shows "$x on Draw"

  Scenario: user views the game chart for a UCL match
    Given user opens a UCL match detail page

    When user views the price chart
    Then three lines are rendered: Home (team color), Draw (gray), Away (team color)
    And all three endpoint labels are visible

  Scenario: user views existing UCL positions on a card
    Given user has positions on a UCL match

    When user views the sport card
    Then positions show "$x on Team Name" (not "$x on Yes to win")
    And long team names are truncated with ellipsis

Screenshots/Recordings

**Before **

N/A — UCL soccer was not previously supported

After

Before vs After screenshots:

Screenshot 2026-03-30 at 2 05 17 PM Screenshot 2026-03-30 at 2 03 48 PM Screenshot 2026-03-30 at 2 04 25 PM

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

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 new isDrawCapableLeague helper and groupItemThreshold ordering used to consistently sort outcomes/tokens.

Updates the prediction UI to render an optional DRAW bet button (new draw variant + testIDs), split bet button label/price into separate lines, and ensures bet/preview navigation selects the matching outcome for the tapped token (in PredictMarketDetails and PredictSportCardFooter).

Generalizes game visuals for soccer: PredictGameChart now 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 ucl slug parsing (home-away order), surfacing groupItemThreshold on outcomes, improving negRisk token titles (e.g., “Draw”), and resolving negRisk position outcome labels from eventSlug/slug with optional team lookup.

Written by Cursor Bugbot for commit 024cc19. This will update automatically on new commits. Configure here.

- 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
@github-actions
Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-predict Predict team label Mar 30, 2026
@matallui matallui marked this pull request as ready for review March 30, 2026 21:36
@matallui matallui requested a review from a team as a code owner March 30, 2026 21:36
@github-actions github-actions bot added the risk-medium Moderate testing recommended · Possible bug introduction risk label Mar 30, 2026
@github-actions github-actions bot added size-XL risk-medium Moderate testing recommended · Possible bug introduction risk and removed size-L risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 30, 2026
caieu
caieu previously approved these changes Mar 31, 2026
Copy link
Copy Markdown
Contributor

@caieu caieu left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 31, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@github-actions github-actions bot removed the risk-medium Moderate testing recommended · Possible bug introduction risk label Mar 31, 2026
@github-actions github-actions bot added the risk-medium Moderate testing recommended · Possible bug introduction risk label Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 29 changed files are exclusively within the Predict feature (app/components/UI/Predict/) plus a locales addition. The changes introduce UCL (UEFA Champions League) support as a new draw-capable sports league with 3-way betting (home/draw/away), including:

  1. New ucl league type with home-away slug order and draw-capable flag
  2. New soccer game periods (1H, 2H, ET, PK) in types and formatPeriodDisplay
  3. Draw button in PredictBetButtons/PredictBetButton with 'draw' variant styling
  4. PredictGameChart updated to support 3-series data for draw-capable leagues
  5. PredictSportScoreboard updated to handle home-first display order for UCL
  6. PredictActionButtons updated with sortedOutcomes logic for draw-capable markets
  7. Bug fixes: outcome matching by token ID in PredictSportCardFooter and PredictMarketDetails
  8. PredictSportTeamLogo: removed color prop (breaking change for callers)
  9. PredictPicksForCardItem: string key change from position_pick_info_to_win to position_pick_info
  10. New localization string 'make_your_prediction' for draw-capable leagues

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:
Changes are limited to the Predict feature with incremental additions (new league, draw button, 3-series chart). No significant performance-sensitive paths are modified - no changes to account lists, login flows, app startup, or core data loading. The chart update adds a third series but this is a minor incremental change that doesn't warrant performance testing.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud
Copy link
Copy Markdown

@matallui matallui enabled auto-merge March 31, 2026 18:25
Copy link
Copy Markdown
Contributor

@caieu caieu left a comment

Choose a reason for hiding this comment

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

LGTM

@matallui matallui added this pull request to the merge queue Mar 31, 2026
Merged via the queue into main with commit 9c99e8d Mar 31, 2026
178 of 181 checks passed
@matallui matallui deleted the predict/soccer branch March 31, 2026 19:06
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2026
@weitingsun weitingsun added release-7.73.0 Issue or pull request that will be included in release 7.73.0 and removed release-100.10.0 labels Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.73.0 Issue or pull request that will be included in release 7.73.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-XL team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants