Re:Bet
Gasless prediction markets for research with Yellow SDK state channels
Problem Statement
ResearchBet is a decentralized prediction market platform that combines on-chain verification with off-chain betting using Yellow SDK's state channels. It enables users to create markets around scientific research questions and place unlimited bets with zero gas fees.The Problem: Traditional prediction markets have high gas costs that make frequent betting economically unfeasible. Research institutions need a way to create low-cost markets for research outcomes while maintaining blockchain security.The Solution: By leveraging Yellow SDK's state channels (Nitrolite protocol), ResearchBet allows users to:Create research prediction markets on-chain (one-time gas cost)Place unlimited off-chain bets with instant settlements (zero gas)Settle final outcomes on-chain for permanent recordMaintain full transparency and provability through blockchain verificationUse Cases:Pharmaceutical companies creating markets for clinical trial outcomesAcademic institutions betting on research publication successInvestors hedging on research project completionPublic markets for scientific consensus on controversial topicsThe platform uses a dual-contract architecture:ResearchMarket.solfor market creation and resolution, andYellowSessionManager.solfor off-chain session management. Users deposit USDC once, create a state channel session, place multiple bets without gas costs, and settle everything on-chain when the market resolves.
Solution
Smart Contracts (Solidity):ResearchMarket.sol: Core market logic with ERC7824-compatible interfaces for Yellow SDK integration. Handles market creation, bet placement, resolution, and winner claiming with automatic fee distribution.YellowSessionManager.sol: Manages state channel sessions using Yellow's Nitrolite protocol (ERC7824 standard). Handles deposits, withdrawals, and off-chain bet settlements.Frontend (Next.js 16, React 19, TypeScript):Server-side rendered pages for optimal performanceMetaMask integration for wallet connectivityReal-time odds calculation and displayForm validation with TypeScript for type safetyResponsive UI using Radix UI components and Tailwind CSSState Channel Integration (Yellow SDK):Integrated Yellow SDK's Nitrolite protocol for gasless bettingSession creation and management for off-chain interactionsDeposit/withdrawal mechanisms for channel managementOff-chain bet placement with on-chain settlementDevelopment Stack:Hardhat 3.x for smart contract compilation and testingEthers.js v6 for blockchain interactionsHardhat EDR for local blockchain simulationTypeScript for type-safe developmentTechnical Highlights:Gasless Betting: All individual bets happen off-chain via state channels, with only the initial deposit requiring gas. This reduces costs by 99%+ compared to traditional markets.Real-time Odds: Dynamic odds calculation based on pool ratios, updated instantly as bets are placed.Automated Settlements: Winners can claim their share of the pool plus their original bet, with automatic fee distribution to the platform.ERC7824 Compliance: Full compatibility with Yellow's Nitrolite protocol for seamless state channel integration.
Hackathon
ETHOnline 2025
2025
Contributors
- awu41
5 contributions