What is Pyth Roulette?
Imagine a roulette wheel, but instead of a ball landing on a number, the "spin" is a live countdown powered by on-chain verifiable randomness, and the result is determined by the real-time price of Bitcoin.
Pyth Roulette is a browser-based game where you:
- Pick ODD or EVEN
- Place a bet (play money -- no real funds)
- Watch as Pyth Entropy generates a random countdown between 3 and 30 seconds
- When the timer hits zero, the app grabs the live BTC/USD price from Pyth Hermes
- The last two digits of the whole-dollar price decide your fate
If BTC is at $65,953, the last two digits are 53 - that's odd. Bet odd? You win. Bet even? Better luck next time.
The key insight: the randomness comes from timing. Nobody can predict what BTC's price will be 17 seconds from now at the per-dollar level. Entropy decides when to look, and Price Feeds decide what we see.
How Pyth Network Powers the Game
Pyth Roulette is built on two Pyth products working in concert, each playing a distinct role.
Pyth Price Feeds (Hermes SSE)
The game maintains a live Server-Sent Events connection to Hermes, streaming real-time BTC/USD prices into the UI. Players see the price ticking while the roulette wheel spins. When the countdown reaches zero, the app fetches the latest price to determine the outcome
Pyth Entropy (On-Chain on OP Sepolia)
Entropy is the reason the game is fair. It generates verifiable randomness on-chain through a commit-reveal protocol between the user and a Pyth provider. The random number gets mapped to a wait time
This is the entire fairness mechanism. The countdown duration is not chosen by the frontend, not chosen by a server, and not predictable by the player. It comes from the Entropy contract on Optimism Sepolia, verified on-chain.
Pyth Roulette was built to explore a simple question: what happens when you combine verifiable randomness with real-time price data? You get a game where the house doesn't control the timing, the player doesn't control the outcome, and the result is determined by the actual Bitcoin market at a moment nobody could predict.
The two Pyth products complement each other perfectly here:
- Entropy provides the when - a provably random moment in time
- Price Feeds provide the what - the real-world data at that moment
The entire frontend is a single React app with no backend. Hermes SSE handles the price stream, the Entropy contract on OP Sepolia handles the randomness, and Fortuna handles the provider reveals. All verifiable, all transparent.
Stack: React 19 / Vite / Tailwind CSS v4 / framer-motion / viem / TypeScript
Give it a spin: github.com/dender10/Pyth-roulette-

Top comments (0)