All projects
Token Premier League
Fantasy crypto gaming on the blockchain — Create teams of cryptocurrencies, compete in lobbies, and win prizes based on real-time price movements.
Prediction Markets CRE & AI
What it is
Token Premier League is a Web3 fantasy gaming platform where users build a team of 6 cryptocurrencies and compete in time-bound lobbies based on real market performance, instead of sports players. It solves the problem of passive crypto engagement by turning market knowledge and prediction skill into a competitive, transparent game with on-chain trust.
How it works:
- A user connects a wallet and joins a lobby with an entry fee.
- The user selects 6 tokens and assigns Captain (2x) and Vice-Captain (1.5x) multipliers.
- During the contest window, token prices are tracked using oracle data.
- Points are calculated from percentage price movement (for example, +1% = +100 points, -1% = -100 points), with multipliers applied.
- A live leaderboard ranks participants, and winners receive rewards based on final standings.
What problem it solves:
- Makes crypto participation more interactive and skill-based.
- Replaces opaque/off-chain fantasy logic with transparent blockchain-backed settlement.
- Provides fair, real-time competition using verifiable market data.
- Creates a structured way for users to engage with crypto markets beyond simple buy/hold trading.
- CRE Setup for Multi Price Feeds : https://github.com/Kali-Decoder/Token-Premier-League/tree/main/cre-data-feeds-tpl
- Chainlink Price Feed Contracts : https://github.com/Kali-Decoder/Token-Premier-League/tree/main/chainlink-pricefeed
- Dapp Deployment : https://token-premier-league.vercel.app/
- Product Direct demo : https://youtu.be/qDDqh6wcr6M
- Product Explanation : https://youtu.be/IivwHEaeqGk
Use Case
- Centralize multiple feed mappings inside one contract (DataConsumerMulti)
- Read latest prices on a fixed schedule without manual calls
- Standardize output format for backend services, bots, or analytics pipelines
- Keep chain/network and feed-pair configs environment-driven (staging / production)
Stack - Solidity (0.8.20): DataConsumerMulti contract
- Chainlink Data Feeds: underlying oracle data source
- Chainlink CRE (Chainlink Runtime Environment): workflow runtime
- TypeScript + Bun: workflow implementation and tests
- Viem: ABI encoding/decoding and unit formatting
- Zod: config schema validation
- YAML/JSON config: target/rpc/workflow settings
Architecture
- Smart Contract Layer
- DataConsumerMulti stores pair → feed address mapping
- Exposes getLatestPrice(pair) and getDecimals(pair)
- CRE Workflow Layer
- main.ts boots Runner
- workflow.ts defines handler logic
- On trigger, workflow calls contract methods via EVMClient
- Scales raw prices using decimals and logs results
- Configuration Layer
- project.yaml: RPC + network target definitions
- workflow.yaml: workflow artifact + config file mapping
- config.staging.json / config.production.json: schedule, chain, contract, pairs
CRE Modal Used
The project uses a CRE cron-trigger modal (scheduled execution model):
- CronCapability triggers the workflow at the configured interval (schedule)
- Handler executes read-only EVM contract calls
- Output is emitted as JSON each run
How it Works
- Frontend in Next.js 14 + TypeScript + TailwindCSS for lobby creation, team selection, leaderboard, wallet actions, and real-time UI updates.
- Wallet and chain integration using wagmi, viem, and RainbowKit.
- Backend/data layer with MongoDB for app state, snapshots, transactions, and participant/lobby metadata.
- Smart contracts (Solidity + Foundry + OpenZeppelin) to handle contest participation, deposits, reward distribution, and trustless settlement.
- Price oracle integration using Chainlink Data Feeds for market price inputs used in fantasy point calculations.
Links
Created by
- Neeraj Choubisa