Skip to content

fix: use reference price for market baseline#1333

Merged
ibruno merged 1 commit into
mainfrom
fix/price-to-beat-reference-only
Jul 22, 2026
Merged

fix: use reference price for market baseline#1333
ibruno merged 1 commit into
mainfrom
fix/price-to-beat-reference-only

Conversation

@ibruno

@ibruno ibruno commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary by cubic

Use the reference opening price as the market baseline for live charts. Removes the WebSocket-derived baseline to keep the chart stable and consistent.

  • Bug Fixes
    • Always resolve the baseline from referenceOpeningPrice (no fallback to first live tick).
    • Removed baseline state and setter from useLiveSeriesPriceSnapshot and useLiveSeriesWebSocket, and updated the chart accordingly.
    • Updated tests to reflect the new baseline logic.

Written for commit e33e29e. Summary will update on new commits.

@ibruno
ibruno requested a review from a team as a code owner July 22, 2026 15:42
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 4 files

Confidence score: 4/5

  • In src/app/[locale]/(platform)/event/[slug]/_components/EventLiveSeriesChart.tsx, if the reference snapshot is missing opening_price, the chart can still stream live prices but lose the Price To Beat, delta, and target line, which weakens key trading context for users viewing live events. Restore a fallback baseline (or guard with an explicit default behavior) before merging to avoid this regression.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/app/[locale]/(platform)/event/[slug]/_components/EventLiveSeriesChart.tsx">

<violation number="1" location="src/app/[locale]/(platform)/event/[slug]/_components/EventLiveSeriesChart.tsx:463">
P2: When the reference snapshot is unavailable or has no `opening_price`, the chart still receives live prices but now renders no Price To Beat, delta, or target line because the previous WebSocket baseline fallback was removed. Preserving the live baseline only while the canonical reference is unavailable would avoid blank baseline UI without overriding a valid reference price.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

const resolvedBaselinePrice = isEventClosed
? referenceOpeningPrice
: baselinePrice ?? referenceOpeningPrice
const resolvedBaselinePrice = referenceOpeningPrice

@cubic-dev-ai cubic-dev-ai Bot Jul 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: When the reference snapshot is unavailable or has no opening_price, the chart still receives live prices but now renders no Price To Beat, delta, or target line because the previous WebSocket baseline fallback was removed. Preserving the live baseline only while the canonical reference is unavailable would avoid blank baseline UI without overriding a valid reference price.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/app/[locale]/(platform)/event/[slug]/_components/EventLiveSeriesChart.tsx, line 463:

<comment>When the reference snapshot is unavailable or has no `opening_price`, the chart still receives live prices but now renders no Price To Beat, delta, or target line because the previous WebSocket baseline fallback was removed. Preserving the live baseline only while the canonical reference is unavailable would avoid blank baseline UI without overriding a valid reference price.</comment>

<file context>
@@ -463,9 +460,7 @@ function EventLiveSeriesChartContent({
-  const resolvedBaselinePrice = isEventClosed
-    ? referenceOpeningPrice
-    : baselinePrice ?? referenceOpeningPrice
+  const resolvedBaselinePrice = referenceOpeningPrice
   const precisionReferencePrice = currentPrice
     ?? resolvedBaselinePrice
</file context>
Fix with cubic

@ibruno
ibruno merged commit fc2852b into main Jul 22, 2026
8 checks passed
@ibruno
ibruno deleted the fix/price-to-beat-reference-only branch July 22, 2026 15:51
github-actions Bot added a commit to gladwintan5331/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to jcpteam/premarket-kuest that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to a19ba14d/prediction-market-1 that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to wollydolly/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to bahatijoseph097-prog/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to CrisMan7/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to bezsteam/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to seasonHxy/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to socksrust/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to miguelmoney2007-boop/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to alex5323d/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to MetaQQQ/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to 0xbrowser/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to viscf/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to b4fm2w52j8-netizen/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to brandonmathewp/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to mohitrajcoderf/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to Point-7/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to chance532/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to Excoinsevm/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to jointmeafreshone-max/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to trung78955/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to 17343225742/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to hottie1111/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to will2016/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to BIRURU337/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to kyrodigitalagency-dotcom/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to hahzterry/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to infoczechforestry-gif/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to VadymSova/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to culturalex/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to palotespedro534-ship-it/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to predictions-beta/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to o19k/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to dantech-gif/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to ibrunotome/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to IcarusThrice/Kneel-Polygon-prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to SergeWilfried/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to faustosarmiento8153/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to mir711163-lab/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to nexus-ledger-blockchain/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to youlgtm/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to BlockD3v/Prediction that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to ibruno/kuest-prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to maximumbeast777888-lang/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to qafeocapital-jpg/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to chenliangsea-design/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to lemoswebsite/prediction-market that referenced this pull request Jul 22, 2026
github-actions Bot added a commit to mohamadnur/prediction-market that referenced this pull request Jul 22, 2026
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.

1 participant