feat: full prediction-market app — markets, betting, portfolio, resolution#1082
Merged
hman38705 merged 1 commit intoJul 13, 2026
Merged
Conversation
…io, resolution) Adds the application surface on top of the landing page: users can now browse markets, place bets with a real Stellar wallet, create markets, view their positions/claim winnings, and resolve markets (oracle simulation). Foundation (shared contract) - Domain types (Market, Bet, Outcome, …) in src/lib/types.ts - Mock async data layer (src/lib/mock/markets.ts): seeded markets + real betting/settlement/pro-rata payout math, localStorage-persisted. This is the only data source for now (swap for the API client later) - Freighter wallet provider + useWallet() (connect/disconnect/sign) — real Stellar extension integration - Format helpers (formatXLM, odds, timeUntil, shortAddress) - UI kit (Button, Card, Badge, Field/Input/Select, Modal, Stat, OddsBar) on the existing design tokens - App shell: sticky AppHeader (nav + wallet connect + theme) and (app) route group Features (each its own route + component folder) - /markets browse: featured strip, search + category/status filters, grid - /markets/[id] detail: stats, per-outcome odds, wallet-gated place-bet panel - /markets/create validated create-market form (dynamic outcomes) - /portfolio positions, summary stats, claim winnings - /markets/[id]/resolve oracle resolution (settles winners pro-rata) Wiring & tests - Landing page gains "Launch App" + "Explore live markets" CTAs into /markets - proxy.ts CSP connect-src now allowlists the configured API origin - Unit tests for the mock data layer + format helpers; component tests for each feature. App UI + wallet excluded from unit-coverage (covered by component tests + Playwright e2e + visual regression) - Full build green; test:ci green (231 tests, coverage gate met)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds the actual prediction-market application on top of the landing page. Previously the frontend was a landing page only; the product it advertises (create → bet → resolve → claim) had no UI. This PR adds that entire surface.
Built by orchestrating 4 parallel subagents over a shared foundation I authored first (so they couldn't collide); the combined build compiled first try.
What's new
/markets/markets/[id]/markets/create/portfolio/markets/[id]/resolveFoundation (shared contract)
src/lib/types.tssrc/lib/mock/markets.ts— seeded markets + real betting/settlement/pro-rata payout math, localStorage-persisted. Only data source for now; drop-in swap for the API client later.src/lib/wallet/WalletProvider.tsx→useWallet()(real Stellar extension: connect/disconnect/sign)src/components/ui/*(Button, Card, Badge, Field, Modal, Stat, OddsBar) on the existing design tokensAppHeader(nav + wallet connect + theme) +(app)route groupDecisions (per product direction)
proxy.tsCSPconnect-srcnow allowlists the configured API origin.Test plan
npm run build— clean, 7 routes generated, no type errorsnpm run test:ci— 231 passed / 22 suites, coverage gate met (statements 91.6%, branches 81.3%, functions 91.4%, lines 93.1%)🤖 Generated with Claude Code