ZYTHE
Decentralized Prediction Market using WORLD ID for human verification and Chainlink CRE for automated resolution.
What it is
Zythe is a decentralized prediction market platform where users can create and participate in markets built around real-world questions and events. Instead of relying on a central authority to manage outcomes, Zythe runs entirely on smart contracts — meaning market creation, participation, resolution, and reward distribution all happen transparently and automatically on-chain. It combines blockchain infrastructure with Chainlink's oracle network and World ID's human verification to create a prediction market that is open, fair, and fully trustless.
Traditional prediction markets have always struggled with one core issue — trust. They depend on centralized operators to honestly report outcomes, which introduces the risk of manipulation, bias, and single points of failure. On top of that, most platforms are vulnerable to bots and fake accounts that game the system and undermine fair participation. Zythe tackles both problems head-on by removing human involvement from the resolution process entirely and using World ID to ensure that every participant is a unique, verified real human — making the platform resistant to sybil attacks and ensuring a level playing field for everyone.
A verified user starts by creating a market — posting a yes/no question tied to a real-world event, setting a deadline, and linking a Chainlink price feed that will serve as the source of truth for resolution. Other participants, each verified through World ID, place their predictions by staking ETH on either outcome before the deadline closes. Once the deadline passes, Chainlink CRE automatically kicks in — it reads live data from the linked price feed, determines the correct outcome, and reports it back to the smart contract without any manual intervention. From there, a winner is selected from the correct predictors using Chainlink's verifiable randomness, ensuring the reward distribution is provably fair and impossible to manipulate.
How it Works
ZYTHE - DETAILED ARCHITECTURE & IMPLEMENTATION
Zythe is built on three fully integrated layers that work together to create a decentralized, trustless prediction market: the smart contract layer on Sepolia testnet, the Chainlink CRE automation layer, and the React-based frontend interface.
LAYER 1: SMART CONTRACT ARCHITECTURE
The foundation of Zythe is a Solidity smart contract deployed on the Sepolia testnet, serving as the immutable source of truth for all prediction market operations. The contract manages two primary data structures: Markets and Predictions. Each Market stores essential information including a unique identifier, title and description, the Chainlink price feed address used for resolution, the strike price that determines the YES or NO outcome, the resolution deadline as a Unix timestamp, resolution status and final outcome, running totals of ETH staked on YES and NO sides, and creation timestamp. Each Prediction tracks which market it belongs to, the predictor's address, whether they predicted YES or NO, the amount staked, when it was placed, and whether winnings have been claimed.
The contract exposes several critical functions for interaction. The createMarket function, restricted to the contract owner, generates new prediction markets with specified parameters including question, description, price feed address, strike price, and deadline. The placePrediction function allows verified users to stake a minimum of 0.01 ETH on either YES or NO for an active market, updating the respective total amounts and recording the prediction. This function includes a World ID verification modifier ensuring only verified humans can participate. The resolveMarket function, designed to be called by the CRE workflow after deadline passage, fetches the current price from the market's associated Chainlink feed, compares it against the strike price, determines the outcome, and marks the market as resolved. The claimWinnings function enables winners to claim their share of the loser pool minus a 2% platform fee. View functions like getMarket and getMarketPredictions provide read-only access for the frontend to display real-time market data.
World ID integration is implemented through a verification mapping and modifier system. A dedicated verifyWorldID function, callable only by the contract owner, marks addresses as verified human participants. The onlyVerified modifier on placePrediction ensures that only those with verified status can place predictions, effectively eliminating Sybil attacks and bot participation.
LAYER 2: CHAINLINK CRE AUTOMATION LAYER
The Chainlink Runtime Environment serves as the autonomous backend brain of Zythe, orchestrating market resolution without any human intervention or centralized server. The CRE workflow is written in TypeScript and designed to run on Chainlink's decentralized oracle network, ensuring trustless execution.
The workflow implements two primary triggers. A cron trigger activates every thirty minutes, executing a comprehensive market check function. This handler first reads the total market counter from the contract via an EVM read capability. It then iterates through each market, retrieving full market details through additional EVM reads. For each market that has passed its resolution deadline and remains unresolved, the workflow fetches the current price from the market's associated Chainlink data feed using Chainlink's price feed capability. It determines the outcome by comparing the fetched price against the strike price, then executes an EVM write transaction calling the contract's resolveMarket function with the appropriate market identifier. The workflow logs each resolution attempt with detailed information including market ID, fetched price, determined outcome, and transaction hash.
A log trigger also monitors the blockchain for SettlementRequested events emitted from the contract. When detected, this trigger extracts the market ID from the event parameters and immediately initiates the resolution process for that specific market, providing an alternative resolution pathway for users who wish to expedite settlement after deadline passage.
The workflow handles errors gracefully, with comprehensive logging at each step. All price feed interactions include timeout handling and validation to ensure data integrity before resolution. The workflow configuration is defined in workflow.yaml, specifying trigger parameters and event signatures, while project.yaml manages RPC endpoints for both Sepolia testnet and Ethereum mainnet, supporting both staging and production targets.
LAYER 3: REACT FRONTEND LAYER
The frontend provides an intuitive interface for users to interact with the Zythe protocol, built with React and TypeScript for type safety and developer experience. The application connects to the blockchain through wagmi and viem libraries, which manage wallet connections, network switching, and contract interactions.
The user interface consists of several key pages. The Markets page displays all active prediction markets in a grid format, each card showing the market question, current YES and NO totals as visual progress bars, time remaining until deadline, and total participant count. Users can click through to individual market pages for detailed views and interaction. Each market page presents the full market question with countdown timer, prominent YES and NO prediction buttons that become active only after wallet connection and World ID verification. A verification panel displays the user's World ID status with clear call-to-action for unverified users. The resolved markets page shows completed markets with final outcomes and allows winners to claim their rewards through a simple interface. The profile page aggregates user statistics including total predictions placed, win rate percentage, net profit or loss, and detailed prediction history with outcome indicators.
World ID integration is implemented through the IDKit widget from Tools for Humanity. When users click the verification button, the widget opens a modal guiding them through World App verification. Upon successful verification, the user's address is submitted to a backend endpoint that triggers the contract's verifyWorldID function, updating their status on-chain. The frontend reflects this verified status immediately, enabling prediction placement.
All data displayed in the frontend is fetched directly from the blockchain through contract view functions, eliminating any centralized database. The application uses React Query for efficient data fetching and caching, with automatic refetching on block updates to ensure real-time accuracy. Transaction states are managed through wagmi hooks, providing users with clear feedback during prediction placement, market creation, and reward claiming operations.
The frontend is styled with Tailwind CSS for responsive design across desktop and mobile devices, with a clean, professional aesthetic that builds user trust. Toast notifications provide immediate feedback on transaction progress and completion, while loading skeletons maintain perceived performance during blockchain data fetching.
INTEGRATION AND DATA FLOW
The three layers operate in a synchronized cycle. Users interact through the frontend to create markets or place predictions, which write directly to the smart contract via wallet-signed transactions. The contract stores all market and prediction data permanently on-chain. The CRE workflow continuously monitors the contract state through scheduled cron checks and event listening. When deadlines pass, the workflow autonomously resolves markets by fetching verified price data from Chainlink feeds and writing outcomes back to the contract. The frontend reads resolved outcomes directly from the contract, updating displays and enabling reward claims. This creates a complete, trustless cycle where humans initiate actions through the frontend, smart contracts maintain state, and CRE automates resolution—all without centralized servers or databases.
SECURITY AND TRUST MODEL
Zythe achieves trustlessness through multiple mechanisms. All funds are held in the smart contract with no ability for any party to withdraw except through the defined claimWinnings function. Market resolution is automated through CRE, eliminating any possibility of manual manipulation. Price data comes from Chainlink's decentralized oracle network, with aggregation across multiple independent nodes preventing data tampering. World ID verification ensures each participant is a unique human, preventing Sybil attacks and ensuring fair participation. The combination of these elements creates a prediction market that is fully transparent, verifiable, and resistant to manipulation at every level.
Links
Created by
- DHARSHIKA PUGALENTHI
- ABIRAMI R
- VISHRUTHAKAVI DM