EcoRound
No-loss esports prediction market powered by Chainlink CRE and Morpho yield
What it is
EcoRound is a no-loss prediction market for esports matches deployed on a Tenderly virtual fork. Users deposit USDC to predict the winner of a match. All deposits are routed into a Morpho ERC4626 yield vault during the match. When the match ends, everyone gets their principal back — but winners share the yield earned during the prediction window.
The problem it solves: traditional prediction markets require users to risk their capital. EcoRound removes that barrier entirely. You can participate in competitive esports predictions with zero downside — your worst outcome is getting your money back.
How it works:
- Admin creates a match via the panel, deploying a VaultMatch contract through FactoryMatch on the Tenderly virtual network.
- Users deposit USDC to back Team A or Team B while the match is Open.
- The Chainlink CRE oracle (cron workflow) monitors 3 simulated esports data sources (PandaScore, VLR, Liquipedia) via REST API.
- When 2/3 sources agree the match has started, CRE calls lockMatch() on-chain via the Keystone Forwarder.
- When 2/3 sources agree on the winner, CRE calls resolveMatch(winner) on-chain.
- Users claim: winners receive their deposit + proportional yield share, losers receive 100% of their deposit back.
The oracle uses on-chain vault status as the source of truth — it reads the contract state first before querying external sources, preventing duplicate or conflicting actions.
API keys for the esports data sources (PandaScore, VLR, Liquipedia) are protected using Chainlink Confidential HTTP — secrets are stored in the Chainlink DON Vault and injected into HTTP request headers inside a TEE enclave. The keys are never exposed to node operators, logs, or source code, making the oracle production-ready.
How it Works
Smart Contracts (Solidity, Foundry):
- VaultMatch.sol — per-match no-loss vault. Lifecycle: Open → Locked → Resolved. Integrates Morpho ERC4626 for yield. Inherits Chainlink Receiver for CRE report routing via Keystone Forwarder.
- FactoryMatch.sol — deploys and registers VaultMatch instances per match.
- Deployed on Tenderly virtual fork. Uses real USDC and Morpho vault addresses from mainnet state.
Oracle (Chainlink CRE):
- Go workflow compiled to WASM, triggered by cron every 30s.
- Fetches match data from 3 simulated REST API sources.
- Applies 2/3 consensus logic to determine lock/resolve actions.
- Writes on-chain via EVM capabilities using the Keystone Forwarder(0x5E342a8438B4f5d39e72875FCee6f76B39CCE548).
- Simulated and tested with: cre workflow simulate EcoRound-workflow
Chainlink Confidential HTTP:
- API keys for PandaScore, VLR.gg, and Liquipedia are stored in the Chainlink DON Vault (secrets.yaml) and fetched sequentially inside a TEE enclave at runtime via runtime.GetSecret().
- Keys are injected as X-Api-Key headers into HTTP requests — never printed, never logged, never visible outside the enclave.
- In simulation: keys resolved from .env file.
- In production: keys resolved from DON Vault with zero operator visibility.
- 401 responses are handled gracefully — source is skipped, consensus continues with remaining sources.
API Simulator (Go, Gin, GORM):
- Simulates PandaScore, VLR.gg, and Liquipedia REST APIs.
- Backed by Neon PostgreSQL. Admin API allows manually setting match results per source (simulating real data feeds).
Admin Panel (Go, tview TUI):
- Terminal UI for creating matches, setting results, and monitoring on-chain state in real time.
Frontend (Next.js 16, React 19, TailwindCSS 4, wagmi/viem/RainbowKit):
- Valorant-themed UI. Match browsing, deposit flow, claim flow, live pool stats.
Infrastructure:
- Tenderly virtual fork (full mainnet state, no real funds at risk)
- Neon PostgreSQL for off-chain match data
Links
Created by
- Muhammad Meidy Noor Al Barry