Skip to content

Prediction markets prototype: side menu entry, market list and details scenes - #6158

Open
j0ntz wants to merge 3 commits into
developfrom
jon/prediction-markets-prototype
Open

Prediction markets prototype: side menu entry, market list and details scenes#6158
j0ntz wants to merge 3 commits into
developfrom
jon/prediction-markets-prototype

Conversation

@j0ntz

@j0ntz j0ntz commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Technical Design Document

prediction-markets-prototype.md

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Description

Prototype for the Prediction Markets task (Asana task).

Adds a Prediction Markets side menu entry and two new scenes backed by the Slipstream Connect API (https://github.com/tylerthebuildor/slipstream-example):

  • List scene: category tabs (sports, crypto, macro, politics), one card per cross-venue market cluster comparing each venue's best ask, best-priced venue highlighted.
  • Details scene: per-venue bid/ask, merged order book top levels, and per-venue market metadata with links out to the venue pages.
  • Typed cleaners + fetch client under src/plugins/prediction-markets/, optional API key at ENV.PLUGIN_API_KEYS.slipstream (phaze precedent).
  • With no API key configured (the normal state for now), the scenes run on a bundled sample dataset behind a visible banner, so the prototype is fully browsable on any build.

Review hardening (from Cursor Bugbot / Security Reviewer findings, all addressed): shared best-ask helper so both scenes highlight the same venue, an https + venue-host allowlist (userinfo rejected) before any leg URL opens, asBiggystring cleaners on all numeric fields, red asks in the order book, and the list keeps last-good data when a background refetch fails.

Read-only scope: no trading, balances, or positions; the design doc records the rationale and the deferred trade-flow phase.


Note

Medium Risk
Introduces a new user-facing flow that fetches untrusted API JSON and opens external URLs; mitigations include cleaners, asBiggystring, and venue URL allowlisting, but the prototype still uses a client-side API key from env like other plugin keys.

Overview
Adds a Prediction Markets side menu entry and logged-in stack routes for a read-only prototype: browse cross-venue market clusters from the Slipstream Connect API.

The list scene uses category tabs (sports, crypto, macro, politics), TanStack Query, and cards that compare each venue’s best ask with the best venue highlighted. The details scene shows per-venue bid/ask, a merged order book, and leg metadata; venue links open in the browser only when isSafeVenueUrl passes an https host allowlist.

New code lives under src/plugins/prediction-markets/ (cleaners, fetchPredictionMarkets, bundled sample data). Optional ENV.PLUGIN_API_KEYS.slipstream enables live GET /connect/markets/{category}; without a key, sample data is shown behind a warning banner. Trading, balances, and positions are intentionally out of scope.

Reviewed by Cursor Bugbot for commit 0cb837b. Bugbot is set up for automated code reviews on this repo. Configure here.

@j0ntz

j0ntz commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence

side menu entry

side menu entry

market list sports

market list sports

market list crypto

market list crypto

market details

market details

Captured by the agent's in-app test run (build-and-test).

@j0ntz
j0ntz force-pushed the jon/prediction-markets-prototype branch from d14fb2a to 0830eaa Compare August 14, 2026 23:39
@j0ntz
j0ntz marked this pull request as ready for review August 14, 2026 23:41
@j0ntz
j0ntz force-pushed the jon/prediction-markets-prototype branch from 0830eaa to dcc48a2 Compare August 14, 2026 23:41
@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.

Comment thread src/components/scenes/PredictionMarketDetailsScene.tsx Outdated
Comment thread src/components/scenes/PredictionMarketDetailsScene.tsx Outdated
@j0ntz
j0ntz force-pushed the jon/prediction-markets-prototype branch from dcc48a2 to 18170fd Compare August 14, 2026 23:50
Comment thread src/components/scenes/PredictionMarketDetailsScene.tsx
@j0ntz
j0ntz force-pushed the jon/prediction-markets-prototype branch from 18170fd to 8247fee Compare August 14, 2026 23:56
@j0ntz

j0ntz commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence (after fix)

market details after fix

market details after fix

Captured by the agent's in-app test run (build-and-test).

Comment thread src/components/scenes/PredictionMarketListScene.tsx
@j0ntz
j0ntz force-pushed the jon/prediction-markets-prototype branch from 8247fee to 63c5bf5 Compare August 15, 2026 00:02
Comment thread src/plugins/prediction-markets/slipstreamTypes.ts Outdated
@j0ntz
j0ntz force-pushed the jon/prediction-markets-prototype branch from 63c5bf5 to 1633dce Compare August 15, 2026 00:10
Comment thread src/plugins/prediction-markets/slipstreamTypes.ts
Comment thread src/plugins/prediction-markets/slipstreamTypes.ts
Typed cleaners and fetch client for the Slipstream Connect API
(cross-venue prediction markets over Polymarket, Hyperliquid, and
Kalshi), plus a bundled sample dataset used when no API key is
configured. The optional key lives at ENV.PLUGIN_API_KEYS.slipstream.
@j0ntz
j0ntz force-pushed the jon/prediction-markets-prototype branch 2 times, most recently from eeab4cc to c8baf0f Compare August 15, 2026 00:23

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using high effort and found 1 potential issue.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit c8baf0f. Configure here.

Comment thread src/plugins/prediction-markets/slipstreamTypes.ts
j0ntz added 2 commits August 14, 2026 17:29
Prediction Markets in the side menu opens a new list scene: category
tabs (sports, crypto, macro, politics) and market cards comparing each
venue's best ask, with the best-priced venue highlighted. Tapping a
market opens a details scene showing per-venue bid/ask, the merged
order book's top levels, and per-venue market metadata with links out.
Scenes show a labeled sample dataset when no API key is configured.
Technical design document covering the data module, scenes, sample
fallback, and the decisions behind the read-only scope, plus the
CHANGELOG entry.
@j0ntz
j0ntz force-pushed the jon/prediction-markets-prototype branch from c8baf0f to 0cb837b Compare August 15, 2026 00:29
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