← Back to home

Betflix

Fast, YES/NO bets on real-time prices with ENS winner badges, powered by Pyth and The Graph.

Problem Statement

This project provides head-to-head betting on crypto price movements with instant settlement.On prediction markets it always takes a long time for the market to settle and sometimes all you want is to use the same core tech for silly head to head bets.Betflix is based exactly on this.Users can create bets on price movements and lock in their predictions on-chain. Besides the prices, they also can set three key parameters: how long the bet runs, the window to join, and most importantly - the custom ENS subdomain name the winner will receive as a trophy. The created bets and the predictions are associated on chain.Other users browsing the app can instantly join any pending bet, automatically taking the opposite position. Just pure disagreement settled by codeThe winner takes the entire pot powered by Pyth Network and also gets their custom ENS subdomain minted as an NFT trophy.All active bets are visible through The Graph Protocol's lightning-fast queries, creating a live feed of ongoing battles. Users can track their wins, see who's on a hot streak, and jump into the action within seconds. The ENS trophies create a permanent stamp of the win.

Solution

The core architecture project is build with Scaffold-ETH 2 framework. I have used the NextJJS, Hardhat and the subgraph extensions to setup the project structure.The core components included are as below -Smart ContractsCore betting logic with configurable parameters for creation, cancellation and bet resolution.Integrates Pyth Contract for price fetching and price feed updates.Integrates ENS Resolver and Registry for ENS updates..Emergency functions for admin interventionComprehensive error handling and fund protectionPyth NetworkOn-demand price feed updates fetched from the UI which is passed and updated on-chain. The core concept of price updates is just wonderfulCreator pays update fee upfront, resolver gets refundedValidates price freshness and exponent consistencyENS IntegrationWinners receive unique ENS subdomains as permanent trophiesSubdomains are pre-selected during bet creationAutomatic transfer via NameWrapper on bet resolutionThe Graph ProtocolReal-time indexing of bet lifecycle eventsTracks pending/active/resolved bets and user statisticsReduces RPC calls and improves UI responsivenessWorth Mentioning and Notable -Built it solo even after having a huge UI development PTSD.

Hackathon

ETHGlobal New Delhi

2025

Contributors