Our project is a daily crypto price prediction game designed for the Web3 community. Participants can submit their predictions for the price of a selected cryptocurrency (such as Bitcoin or Ethereum), and the person whose guess is closest to the actual price will win a prize.
The game leverages Worldcoin for identity verification to ensure that only humans (no bots) can participate, enhancing fairness. We use Chainlink and Pyth oracles to securely and accurately confirm the crypto price at a specific, predetermined time.
The Crypto prices that player guessed is a valuable data set for applications like AI/ML models for trading strategies, products like perpetual and futures. They reflect people's confidence of the market.
Key Features: Daily Game: Each day, participants predict the price of a specified cryptocurrency. Prize Pool: Players contribute a small entry fee of 0.001 ETH to join. The game starts when the total prize pool reaches 0.1 ETH. Winner: The player with the closest price prediction wins 50% of the prize pool. Fair Verification: Worldcoin verifies participants' humanity, while Chainlink and Pyth ensure secure and accurate price confirmation. This game offers a fun and engaging way for users to test their market knowledge, with a chance to earn rewards daily!
To build the architecture for the crypto price prediction game, we need several Web3 tools and technologies to handle smart contracts, identity verification, data oracles, and front-end integration. Here's a breakdown of what we used:
Smart Contracts (Ethereum) Ethereum Blockchain: we deploy the game as a smart contract on Ethereum. This is where the logic for participation, prize pool management, and winner selection will be implemented. Solidity: Use Solidity to write the smart contracts that govern the game logic, prize distribution, and interaction with oracles (Chainlink, Pyth). OpenZeppelin: For security, use OpenZeppelin’s libraries for access control, token handling, and overall contract security to minimize vulnerabilities.
Worldcoin for Humanity Verification World ID SDK: Integrate Worldcoin’s World ID SDK to verify that participants are humans. The SDK allows to connect with the Worldcoin identity layer to ensure fairness by blocking bots from entering the game. World App or Browser Extension: Players can use the Worldcoin app or a browser extension to verify their identity and interact with our smart contract.
Data Oracles for Accurate Price Feeds Chainlink: Use Chainlink’s Price Feed oracles to obtain secure and accurate real-time cryptocurrency prices. Chainlink will ensure the final price is correct at the prediction cutoff time. Pyth Network: we use the Pyth Network as an additional oracle for price verification. Pyth specializes in providing real-time price data for crypto and other assets, ensuring the game data is reliable.
Smart Contract Interactions Flutter'sWeb3Dart: To interact with our Ethereum smart contracts, we use Web3Dart in the front end. This will allow participants to connect their wallet (e.g., MetaMask) and submit their predictions, pay the entry fee, and claim prizes. Metamask: Allow users to connect their wallets via MetaMask to submit their ETH entry fees and claim rewards.
Game Logic Smart Contract Logic: Store player predictions on-chain. Collect ETH entry fees and maintain the prize pool. Trigger the price check (from Chainlink and Pyth) at the daily cutoff time. Calculate the winner based on the closest prediction. Distribute 50% of the prize pool to the winner, with the rest rolling over or allocated elsewhere.
Front-end Development Flutter app really simplifies the application but introduced a lot of problems integrating to worldcoin, chainlink and pyth.