feat(pco): Psychic Consensus Oracle Frontend UI [Innovation Cycle 48]#38
Open
feat(pco): Psychic Consensus Oracle Frontend UI [Innovation Cycle 48]#38
Conversation
Innovation Cycle #48 — 'The Oracle Layer' ## POC: Psychic Consensus Oracle (PCO) Two-layer prediction market where readers bet on story choices AND on whether the crowd consensus will be correct. Smart contract (PsychicConsensusOracle.sol): - Layer 1: Parimutuel story betting (85/10/3/2 split) - Layer 2: Meta-bet on crowd accuracy (contrarian 2x bonus) - ELO-style psychic score: SEER → ORACLE → PROPHET → VOID SEER - Anti-whale cap (psychic pool ≤ 50% main pool) - Payout preview, fee withdrawal, access control - 22 comprehensive Foundry test cases TypeScript SDK (client.ts): - getPool, getConsensusMarket, getPsychicProfile - betOnChoice, betOnConsensus, claim functions - Payout previews, Psychic Edge calculation - Full viem/wagmi integration ## 5 Innovation Proposals 1. Psychic Consensus Oracle — meta-prediction market, 2x contrarian bonus 2. Yield-Bearing Betting Pools — Aave v3 integration, losers still earn APY 3. Chronicle Engine — personalized alternate timelines per betting history 4. Temporal Multiplier Betting — 3.5x early / 1x late epoch system 5. Narrative DNA System — hidden story genome decodable by power users ## Revenue Impact - Year 1: $260K new + $754K existing = $1.014M total (first million!) - Year 5: $4.78M new + $13.56M existing = $18.34M total - Combined moat: 216 months new + existing = 35+ year advantage Do NOT merge — pending manual review.
Two-layer prediction market interface with ELO-style leaderboard. ## New Files - apps/web/src/hooks/usePsychicOracle.ts — wagmi hook for on-chain PCO state - apps/web/src/components/psychic/PsychicConsensusPanel.tsx — main two-layer panel - apps/web/src/components/psychic/PsychicLeaderboard.tsx — ELO leaderboard component - apps/web/src/components/psychic/index.ts — barrel export - apps/web/src/app/api/psychic/leaderboard/route.ts — leaderboard API (on-chain + mock) - apps/web/src/app/api/psychic/pool/[poolId]/route.ts — pool state API (on-chain + mock) - packages/database/prisma/migrations/20260218_add_pco_fields/migration.sql — DB migration ## Modified Files - apps/web/src/app/story/[storyId]/page.tsx — conditionally renders PCO panel vs legacy - packages/database/prisma/schema.prisma — added pcoContractAddress + pcoPoolId fields - .env.example — added PCO env vars ## Architecture Layer 1 (Story Bet): parimutuel on which AI choice wins — unchanged Layer 2 (Psychic Oracle): meta-bet on whether the crowd is correct - Crowd Believer: standard payout if majority is right - Contrarian: 2x bonus payout for calling the upset - ELO scoring: SEER → ORACLE → PROPHET → VOID SEER (fee discounts) ## Design - Ruins of the Future glass-card aesthetic - Framer Motion animations throughout - Mobile-first responsive layout - Real-time countdown timer with urgency states - Psychic Edge signal (3x = Extreme Contrarian, 2x = Strong, etc.) - Badge progress bar (SEER → ORACLE → PROPHET → VOID SEER) Closes #48-frontend
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
This PR ships the complete frontend implementation of the Psychic Consensus Oracle (PCO), the flagship feature from Innovation Cycle #48.
The smart contract, TypeScript client, and types were already built. This PR adds the missing UI layer — connecting everything into a production-ready betting experience.
The Two-Layer Prediction Market
Layer 1 — Story Bet (unchanged parimutuel):
Layer 2 — Psychic Oracle (NEW):
Crowd Believer→ bet the majority is correct (standard payout)Contrarian Psychic→ bet the crowd is WRONG (2× bonus payout)Psychic Edgelive signal (3× = Extreme Contrarian, 2× = Strong, etc.)Files Changed
New Files
hooks/usePsychicOracle.tscomponents/psychic/PsychicConsensusPanel.tsxcomponents/psychic/PsychicLeaderboard.tsxcomponents/psychic/index.tsapi/psychic/leaderboard/route.tsapi/psychic/pool/[poolId]/route.tsmigrations/20260218_add_pco_fields/migration.sqlpcoContractAddress+pcoPoolIdto betting_poolsModified Files
story/[storyId]/page.tsxPsychicConsensusPanel(PCO) orBettingInterface(legacy) based on pool configschema.prismapcoContractAddressandpcoPoolIdfields to BettingPool.env.exampleNEXT_PUBLIC_PCO_ADDRESS,NEXT_PUBLIC_CHAIN_ID,NEXT_PUBLIC_RPC_URLDesign System
All components follow the Ruins of the Future aesthetic:
glass-cardclassName)Testing Checklist
Deployment Notes
1. Run the DB migration
2. Add environment variables
3. Enable PCO for a betting pool
4. For new chapters, set both fields when creating the pool
The story page checks
pool.pcoContractAddress— if set, it renders the PCO panel. Otherwise it falls back to the legacy BettingInterface. Zero breaking changes for existing pools.Architecture Decision
Why conditional rendering instead of replacing BettingInterface?
Existing deployed pools use the old contract. PCO is a new contract deployment. The conditional approach lets us:
Related
INNOVATION_CYCLE_48_FEB_17_2026.mdpackages/psychic-oracle/src/PsychicConsensusOracle.sol(already merged)packages/psychic-oracle/src/client.ts(already merged)