Commit 1f49900
fix(predict): odds prices stale on feed cards and event page during live markets cp-7.81.2 (#31951)
## Description
Cherry-pick of #31922 into `release/7.81.2-ota`.
Updates Predict sport game market cards so Moneyline odds can update
from live WebSocket market prices.
The main sport market card now subscribes to live prices for the visible
Moneyline tokens and displays live `bestAsk` values when available,
falling back to static token prices when live data is missing or
disabled. The featured carousel sport card uses the same live-price
fallback for payout rows and buy button odds.
The live sport-card price behavior is controlled by a default-on remote
feature flag, `predictSportCardLivePrices`, so the WebSocket
subscriptions can be disabled remotely while preserving the existing
static price display.
## Changelog
Updated Predict sport game market cards to show live Moneyline prices.
## Related issues
Fixes:
- PRED-958
- PRED-1028
## Manual testing steps
See original PR #31922 for full manual testing steps.
## Cherry-pick details
| Field | Value |
|---|---|
| Original PR | #31922 |
| Target branch | `release/7.81.2-ota` |
| Squashed commit cherry-picked | `676e748` |
### Conflict resolution notes
- `tests/feature-flags/feature-flag-registry.ts`: kept only the new
`predictSportCardLivePrices` flag; unrelated main-only flags surfaced as
patch context were not introduced.
-
`app/components/UI/Predict/views/PredictHome/PredictHome.view.test.tsx`:
kept deleted — the `PredictHome` view does not exist on
`release/7.81.2-ota`.
## Pre-merge author checklist
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability.
- [x] I've included tests if applicable.
Made with [Cursor](https://cursor.com)
Co-authored-by: Caainã Jeronimo <caainaje@gmail.com>1 parent 0476432 commit 1f49900
14 files changed
Lines changed: 393 additions & 12 deletions
File tree
- app/components/UI/Predict
- components
- FeaturedCarousel
- PredictMarketSportCard
- providers/polymarket
- selectors/featureFlags
- types
- utils
- tests
- component-view
- fixtures
- feature-flags
Lines changed: 87 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
86 | 95 | | |
87 | 96 | | |
88 | 97 | | |
| |||
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
110 | 137 | | |
111 | 138 | | |
112 | 139 | | |
| |||
184 | 211 | | |
185 | 212 | | |
186 | 213 | | |
| 214 | + | |
187 | 215 | | |
188 | 216 | | |
189 | 217 | | |
| |||
257 | 285 | | |
258 | 286 | | |
259 | 287 | | |
260 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
261 | 291 | | |
262 | 292 | | |
263 | 293 | | |
| |||
414 | 444 | | |
415 | 445 | | |
416 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
417 | 503 | | |
Lines changed: 45 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
33 | 36 | | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
117 | 125 | | |
118 | 126 | | |
119 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
120 | 153 | | |
121 | 154 | | |
122 | 155 | | |
| |||
265 | 298 | | |
266 | 299 | | |
267 | 300 | | |
268 | | - | |
| 301 | + | |
269 | 302 | | |
270 | 303 | | |
271 | 304 | | |
| |||
279 | 312 | | |
280 | 313 | | |
281 | 314 | | |
282 | | - | |
| 315 | + | |
283 | 316 | | |
284 | 317 | | |
285 | 318 | | |
| |||
298 | 331 | | |
299 | 332 | | |
300 | 333 | | |
301 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
302 | 337 | | |
303 | 338 | | |
304 | 339 | | |
| |||
315 | 350 | | |
316 | 351 | | |
317 | 352 | | |
318 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
319 | 357 | | |
320 | 358 | | |
321 | 359 | | |
| |||
333 | 371 | | |
334 | 372 | | |
335 | 373 | | |
336 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
337 | 377 | | |
338 | 378 | | |
339 | 379 | | |
| |||
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
| |||
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
129 | 156 | | |
130 | 157 | | |
131 | 158 | | |
132 | 159 | | |
| 160 | + | |
133 | 161 | | |
134 | 162 | | |
135 | 163 | | |
| |||
158 | 186 | | |
159 | 187 | | |
160 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
161 | 235 | | |
162 | 236 | | |
163 | 237 | | |
| |||
0 commit comments