- Overview
- Vision
- Features
- Technical Stack
- Architecture
- Prerequisites
- Installation
- Quick Start
- Usage
- Deployment
- Testing
- Hackathon Submission Details
- Demo Video
- Pitch Deck
- Contributing
- License
- Contact
Echo-Fi is an innovative DeFi protocol built for the Somnia DeFi Mini Hackathon, transforming prediction markets into interactive, on-chain "town halls" where users debate outcomes, stake assets, and earn yields through AI-moderated resolutions. Leveraging Somnia Network's high-performance EVM-compatible Layer-1 blockchain (over 1.05 million TPS with sub-second finality), Echo-Fi enables real-time, fully decentralized discussions and financial interactions without off-chain dependencies.
This dApp combines elements of DeFi protocols (staking, yields), NFT utilities (debate tokens and badges), and socialFi (forum-like debates), making it a versatile submission for the hackathon's tracks. Users create markets (e.g., "Will ETH exceed $5,000 by Q4 2025?"), mint NFTs for entry, post arguments on-chain, and let an AI oracle propose resolutions—overridable by community votes. Winners receive amplified yields, while losers' stakes fund Somnia ecosystem grants, promoting transparency and innovation.
Echo-Fi addresses crypto's echo chambers by fostering verifiable discourse, scoring high on hackathon criteria:
- Creativity & Originality: AI + debates in DeFi.
- Technical Excellence: Deployed on Somnia Testnet.
- User Experience: Gamified, intuitive interface.
- On-Chain Impact: 100% on-chain.
- Community Fit: Tailored for Somnia's gamers and metaverse users.
Repository: GitHub Repo (Public with >2 commits)
+------------------+ +------------------+ +------------------+ +------------------+ +------------------+
| User | ----> | AI Agent | ----> | Automation | ----> | Smart Contracts | ----> | On-Chain |
| (Natural Language/UI) | (ElizaOS/Node.js) | | (Chainlink) | | (Market, NFT, | | Distribution |
| | | | | | | Oracle, SIP) | | (Staking/NFTs) |
+------------------+ +------------------+ +------------------+ +------------------+ +------------------+
Echo-Fi redefines DeFi by turning passive speculation into active collaboration. Users create markets, mint NFT "debate tokens" to join, and stake assets on outcomes while debating via an intuitive forum interface. An AI oracle analyzes arguments to propose resolutions, with the community voting to override if needed. Winners earn amplified yields, while losers' stakes fund Somnia ecosystem grants, creating a self-sustaining innovation loop. Our goal: make DeFi a vibrant, truth-seeking space where debate drives dividends.
- Prediction Market Creation: Easily create markets with questions, outcomes, and stake requirements; mint ERC-721 NFT "debate tokens" for entry.
- On-Chain Debates: Forum-like interface for posting arguments (stored via events or IPFS hashes), with real-time voting and staking on outcomes.
- AI Resolution Oracle: Lightweight on-chain AI (rule-based sentiment analysis) summarizes debates and proposes outcomes, overridable by community consensus.
- Yield Optimization: Amplified APYs for accurate predictions; gamified "Yield Meter" tracks earnings.
- NFT Utilities: Tradable debate tokens and "Echo Badges" (ERC-721) for top debaters, integrable with Somnia metaverses/games.
- Real-Time Dashboard: Live monitoring of debates, stakes, and yields, powered by Somnia's sub-second finality.
- Gamified Elements: Leaderboards, animated counters, and badges to engage Somnia's gaming community.
- Emergency & Security: On-chain fund locking and multi-signature controls for safe staking.
- React.js with Tailwind CSS for responsive, mobile-first UI
- Next.js for server-side rendering and routing
- ethers.js for Web3 wallet integration (e.g., MetaMask)
- Wagmi for React hooks for Ethereum
- TypeScript for type safety
- Node.js with TypeScript for API handling
- Next.js API Routes for serverless functions
- AI Integration: Rule-based sentiment analysis for debate resolution
- Solidity (v0.8.x) for EVM-compatible contracts
- ERC-20 for yield tokens
- ERC-721 for NFT debate tokens
- OpenZeppelin for secure contract patterns
- Somnia Testnet (Chain ID: 50312)
- High-performance Layer-1 with 1M+ TPS and sub-second finality
- Hardhat/Foundry for development and testing
- Vercel for hosting
- IPFS for decentralized storage
- Git for version control
Echo-Fi's architecture ensures full on-chain execution, leveraging Somnia's speed for scalability.
User (Wallet: MetaMask)
↓ (Connect & Interact)
Frontend (React + Next.js + ethers.js)
↓ (API Calls & Transactions)
Backend (Next.js API Routes) → AI Oracle (Sentiment Analysis)
↓ (Smart Contract Calls)
Somnia Testnet Contracts:
- Market Factory (Create Markets)
- Staking & Yield Logic (ERC-20)
- NFT Minting (ERC-721 Debate Tokens)
- AI Resolution (Rule-Based Scoring)
- Community Voting
↓ (Events for Real-Time Updates)
On-Chain Storage (Events/IPFS) → Dashboard (Live Data)
- Market Creation: User creates market → Mints NFT → Posts debate (on-chain event)
- Debate Phase: Users post arguments → AI analyzes sentiment → Community votes
- Resolution: AI proposes resolution → Community votes to override if needed
- Yield Distribution: Winners earn amplified yields → Losers' stakes fund ecosystem grants
- Debate Context: Global state management for debates, arguments, and votes
- Real-time Updates: WebSocket connections for live debate updates
- Responsive UI: Mobile-first design with Tailwind CSS
- Wallet Integration: MetaMask and other Web3 wallets via Wagmi
- API Routes: RESTful endpoints for debate operations
- AI Oracle: Sentiment analysis and resolution proposals
- Event Handling: Real-time updates through event listeners
- MarketFactory: Creates and manages prediction markets
- DebateToken: ERC-721 NFTs for debate participation
- YieldToken: ERC-20 tokens for yield distribution
- AIVote: Community voting and resolution system
- Scalability: Somnia's 1M+ TPS handles thousands of micro-transactions (votes, posts) per debate
- Security: Audited patterns from OpenZeppelin; emergency pause functions
- Decentralization: 100% on-chain execution with minimal off-chain dependencies
- Node.js >= v18.18
- npm or bun package manager
- MetaMask wallet (configured for Somnia Testnet)
- Somnia Testnet tokens (STT) from faucet: Somnia Faucet
- Git for version control
git clone https://github.com/yourusername/echo-fi.git
cd echo-finpm install
# or
bun installcp .env.example .envEdit .env:
NEXT_PUBLIC_SOMNIA_RPC_URL=https://testnet.somnia.network/rpc
NEXT_PUBLIC_SOMNIA_CHAIN_ID=50312
NEXT_PUBLIC_MARKET_CONTRACT_ADDRESS=0x... # Deployed main contract
NEXT_PUBLIC_NFT_CONTRACT_ADDRESS=0x... # Deployed ERC-721
NEXT_PUBLIC_YIELD_TOKEN_ADDRESS=0x... # Deployed ERC-20npm run dev
# or
bun run devNavigate to http://localhost:3000
- Install MetaMask browser extension
- Connect MetaMask to Somnia Testnet
- Add Somnia Testnet to MetaMask:
- Network Name: Somnia Testnet
- RPC URL: https://testnet.somnia.network/rpc
- Chain ID: 50312
- Currency Symbol: STT
- Click "New Market" or "Start Debate"
- Input question (e.g., "Will BTC hit $100K by Q4 2025?")
- Set stake amount and description
- Mint NFT debate token (approve transaction)
- Post your initial argument in the forum thread
- Connect your wallet
- Navigate to the "Markets" tab
- Click "Start Debate" or "Create Market"
- Fill in the form:
- Question: Your prediction market question
- Description: Detailed explanation of the market
- Stance: Your initial position (Yes/No)
- Initial Argument: Your opening argument
- Approve the NFT minting transaction
- Your market is now live for others to join
- Browse existing markets on the home page
- Click "Join Debate" on a market that interests you
- Mint the debate NFT (if you haven't already)
- Post arguments in the forum thread:
- Select your stance (Yes/No)
- Write your argument
- Submit to the blockchain
- Vote on arguments using the thumbs up/down buttons
- Stake on outcomes via the "Stake Now" button
- Visit your Dashboard to see:
- Staked assets across markets
- Debate history and participation
- Yield accruals and earnings
- NFT collection and badges
- Trade NFTs in the built-in marketplace
- Track your position on leaderboards
- After debate period ends, AI oracle analyzes all arguments
- AI proposes a resolution based on sentiment analysis
- Community can vote to override AI proposal
- Final resolution determines yield distribution
- Winners receive amplified yields
- Losers' stakes fund Somnia ecosystem grants
# Build the project
npm run build
# Deploy to Vercel
vercel --prodSet up the following environment variables in your Vercel dashboard:
NEXT_PUBLIC_SOMNIA_RPC_URLNEXT_PUBLIC_SOMNIA_CHAIN_IDNEXT_PUBLIC_MARKET_CONTRACT_ADDRESSNEXT_PUBLIC_NFT_CONTRACT_ADDRESSNEXT_PUBLIC_YIELD_TOKEN_ADDRESS
- Market Factory: 0xD3f07713bB0D4816E23Ec66C666E0e7721C3b337 (placeholder)
- NFT Debate Token: 0xa7E756116aC6b0819e0d7f7354C21417e1e0b2A7
- Yield Token (ERC-20): 0x565A693cB0838e8ea2A8BBdb3b749893E7ED7f9d
npm test
# or
bun test- Use Hardhat network for local simulation
- Test real-time updates with Somnia RPC
- Verify all user flows work correctly
- Frontend component tests
- API route integration tests
- Smart contract unit tests
- End-to-end user flow tests
- Primary: DeFi Protocols
- Secondary: NFT Utilities
- Competes for $2,500 (1st), $1,500 (2nd), $1,000 (3rd) per track
- Plus ecosystem support and recognition
✅ Public GitHub repo with >2 commits ✅ Working dApp on Somnia Testnet ✅ Architecture documentation in README ✅ Comprehensive features including AI debates and NFT utilities ✅ User-friendly interface with gamification elements ✅ On-chain impact with 100% on-chain execution
- Development: September 2025
- Submission: Before September 19, 2025, 21:00 IST (extended deadline)
- Demo: Live on Somnia Testnet
Watch the comprehensive demo video showcasing:
- Wallet connection and setup
- Market creation and NFT minting
- Debate participation and argument posting
- AI resolution process
- Yield distribution and dashboard features
Demo Video: YouTube Link
- Title: Echo-Fi - AI-Powered DeFi Debate Platform
- Problem: Crypto Echo Chambers and Passive Speculation
- Solution: AI-Moderated On-Chain Debates
- Features: Comprehensive platform overview
- Somnia Integration: Why Somnia Network
- Technical Stack: Architecture and technologies
- Demo: Live application walkthrough
- Community Impact: Benefits for Somnia ecosystem
- Future Roadmap: Next steps and expansions
- Team & Contact: Developer information
Download: Pitch Deck PDF
We welcome contributions to make Echo-Fi even better! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/AmazingFeature - Commit your changes:
git commit -m 'Add some AmazingFeature' - Push to the branch:
git push origin feature/AmazingFeature - Open a Pull Request with a detailed description
- Follow the existing code style and patterns
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting
- Use GitHub Issues for bug reports and feature requests
- For hackathon feedback, contact mentors on Somnia Telegram
- Provide detailed steps to reproduce bugs
This project is licensed under the MIT License - see the LICENSE file for details.
- Name: [Your Name]
- Email: [email protected]
- GitHub: @yourusername
- X (Twitter): @yourhandle
- LinkedIn: Your LinkedIn Profile
- Somnia Network: @SomniaEco
- Telegram: Somnia Hackathon Group
- Discord: Somnia Community Discord
- For technical issues: GitHub Issues
- For hackathon questions: Somnia Telegram group
- For general inquiries: [email protected]
Built with ❤️ for the Somnia DeFi Mini Hackathon 2025
Let's debate the future of DeFi! 🚀🎯💬