AI-Powered Crypto Project Viability Predictor with VolatilityVanguard Prediction Market game
- Overview
- Recent Changes
- Prerequisites
- Setup Instructions
- Environment Variables
- Running the Application
- MiniPay Integration
- Project Structure
- Troubleshooting
- Project Overview & Vision
- Technical Architecture
- Volatility Vanguard Integration
VibeCheck is a Minipay-based mini-app that provides AI-powered cryptocurrency project analysis and a prediction market game (VolatilityVanguard). The application supports multiple wallet contexts including MiniPay, Farcaster, and external wallets like MetaMask, etc.
- AI-Powered Token Analysis: Get vibrancy scores and detailed reports for any cryptocurrency token
- VolatilityVanguard Game: Predict token volatility and compete for rewards using USDm
- Multi-Wallet Support: Seamless integration with MiniPay, Farcaster, and MetaMask
- Watchlist Management: Track favorite tokens with premium features
- Admin Panel: Manage contract settings and rounds (admin only)
- Onboarding Experience: Interactive guide for new users
Before setting up the project, ensure you have the following installed:
- Node.js: v18.0.0 or higher
- Yarn: v1.22.0 or higher (package manager) or Bun
- Git: For cloning the repository
- MiniPay Wallet: For testing in MiniPay context (optional)
- MetaMask: For testing with external wallets (optional)
node --version # Should be v18.0.0 or higher
yarn --version # Should be v1.22.0 or highergit clone <repository-url>
cd vibecheckInstall dependencies for both smart contracts and frontend:
# Install smart contract dependencies
cd smartContracts
yarn install
# Install frontend dependencies
cd ../frontend
yarn installCreate a .env file in the smartContracts directory:
cd smartContracts
cp .env.example .env # If .env.example existsRequired variables:
- Private key for deployment
- RPC URLs for networks
- USDm contract addresses
Create a .env.local file in the frontend directory:
cd ../frontend
cp .env.example .env.local # If .env.example existsSee Environment Variables section for details.
Firebase is used for data persistence (watchlist, premium status). The app will fall back to localStorage if Firebase is not configured.
- Create a Firebase project at Firebase Console
- Enable Authentication (Anonymous auth)
- Create a Firestore database
- Copy your Firebase config to
.env.local
Deploy the VolatilityVanguard contract to your desired network:
cd smartContracts
# Deploy to Celo Sepolia (testnet)
yarn deploy-sepolia
# Or deploy to Celo Mainnet
yarn deploy-celoAfter deploying the smart contracts, sync the artifacts to the frontend:
cd smartContracts
yarn sync:dataThis will generate:
frontend/src/constants/contract-artifacts.json- Contract addresses and ABIs for all networksfrontend/src/contracts/volatilityVanguardAddress.ts- Helper functions for contract addressesfrontend/src/abis/VolatilityVanguardABI.json- Contract ABI
For testing with external wallets on Sepolia, deploy and mint mock USDm:
cd smartContracts
yarn hardhat run scripts/mintMockCUSDMultiple.ts --network sepoliaThis will deploy a mock USDm contract and mint tokens to specified addresses.
Create a .env.local file in the frontend directory:
# Firebase Configuration (Optional - app works without it)
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
# RPC URLs (Required)
NEXT_PUBLIC_ALCHEMY_CELO_SEPOLIA_API=https://celo-sepolia.g.alchemy.com/v2/YOUR_API_KEY
NEXT_PUBLIC_ALCHEMY_CELO_MAINNET_API=https://celo-mainnet.g.alchemy.com/v2/YOUR_API_KEY
# WalletConnect (Optional - for WalletConnect integration)
NEXT_PUBLIC_WALLETCONNECT_ID=your_walletconnect_project_id
# Mock USDm (Optional - for development with external wallets)
MOCK_CUSD_ADDRESS_SEPOLIA=0x...
MOCK_CUSD_ADDRESS_MAINNET=0x...- Alchemy: Sign up at Alchemy and create apps for Celo Sepolia and Celo Mainnet
- Alternative: Use public RPC endpoints (not recommended for production):
- Celo Sepolia:
https://forno.celo-sepolia.celo-testnet.org - Celo Mainnet:
https://forno.celo.org
- Celo Sepolia:
cd frontend
yarn devThe application will start on http://localhost:3000
Note: The app uses --webpack flag to avoid Turbopack build issues with certain dependencies.
cd frontend
yarn build
yarn startThe production build will be optimized and ready for deployment.
cd frontend
yarn lintMiniPay is a mobile wallet that provides a seamless Web3 experience. To test your app in MiniPay:
- Install MiniPay: Download the MiniPay app on your mobile device
- Configure Network: Ensure MiniPay is connected to Celo Sepolia (for testing) or Celo Mainnet
- Access via URL: Open your app URL in MiniPay's browser
- Automatic Wallet Connection: Wallet is automatically detected and connected
- Native USDm Support: Uses real USDm tokens (no mock tokens needed)
- Optimized UI: Mobile-first design optimized for MiniPay's viewport
- Context Detection: App automatically detects MiniPay context and adjusts UI
- Deploy your app to a public URL (Vercel, Netlify, etc.)
- Open the URL in MiniPay's browser
- The app will automatically detect MiniPay and connect the wallet
- Ensure you have USDm tokens in your MiniPay wallet for transactions
For local development, you can use:
- ngrok: Create a tunnel to your local server
- LocalTunnel: Alternative tunneling solution
- MiniPay Dev Mode: Some versions support localhost connections
# Example with ngrok
ngrok http 3000
# Use the ngrok URL in MiniPayvibecheck/
├── smartContracts/ # Smart contract development
│ ├── contracts/ # Solidity contracts
│ ├── deploy/ # Deployment scripts
│ ├── scripts/ # Utility scripts
│ └── test/ # Contract tests
├── frontend/ # Next.js frontend application
│ ├── src/
│ │ ├── app/ # Next.js App Router
│ │ ├── components/ # React components
│ │ ├── lib/ # Core libraries
│ │ ├── hooks/ # Custom React hooks
│ │ ├── contracts/ # Contract addresses and helpers
│ │ ├── constants/ # Constants and artifacts
│ │ └── abis/ # Contract ABIs
│ └── public/ # Static assets
└── README.md # This file
Error: Module not found: Can't resolve './contract-artifacts.json'
- Solution: Run
yarn sync:datafrom thesmartContractsdirectory to generate contract artifacts
Error: Turbopack build errors with thread-stream
- Solution: The app uses
--webpackflag by default. If issues persist, ensurenext.config.mjshas the IgnorePlugin configuration
Issue: Wallet not connecting in MiniPay
- Solution:
- Ensure the app is accessed via HTTPS or localhost
- Check that MiniPay is on the correct network (Sepolia or Mainnet)
- Verify RPC URLs in
.env.local
Issue: "Insufficient balance" errors
- Solution:
- For MiniPay: Ensure you have USDm tokens in your wallet
- For external wallets: Deploy and mint mock USDm tokens using the script in
smartContracts/scripts/mintMockCUSDMultiple.ts
Issue: Contract calls failing
- Solution:
- Verify contract is deployed and artifacts are synced
- Check that you're on the correct network
- Ensure you have approved USDm spending (for VolatilityVanguard)
- Check browser console for detailed error messages
Issue: Firebase authentication errors
- Solution:
- The app gracefully falls back to localStorage if Firebase is not configured
- To enable Firebase: Configure all required environment variables
- Ensure Anonymous authentication is enabled in Firebase Console
Vibecheck is a real-time sentiment analysis and prediction engine built for decentralized social networks and crypto communities. Its core function is to synthesize unstructured public data—primarily derived from Farcaster and other social platforms—into a singular, quantifiable metric: the Vibe Score. This score provides instant, actionable insight into the current emotional state and market outlook of a specific community, project, or token.
Our vision is to become the definitive, objective layer for community sentiment in the decentralized space. Vibecheck aims to empower users, traders, and project teams by transforming noisy, qualitative data into a clear, predictive signal, bridging the gap between social conversation and on-chain action. We seek to foster engagement through gamified prediction markets based on the very scores we generate.
| Problem | Vibecheck Solution |
|---|---|
| Information Overload/Noise | Social media streams are overwhelming, making it impossible to manually gauge overall community feeling toward a topic. |
| Sentiment Lag & Bias | Existing tools often use lagged data or simple keyword counting, failing to capture subtle shifts in emotional tone (the "vibe"). |
| Low User Engagement | Data platforms are often passive. Users consume information but don't actively participate in shaping or predicting it. |
Vibecheck operates on a three-layer architecture:
- Data Acquisition Layer: Ingests raw social data.
- Vibe Engine Layer (Business Logic): Processes, cleans, and scores the data.
- Application Layer (Frontend): Displays the score, handles user interactions, and manages the gaming aspect.
- Primary Source: Farcaster (via public APIs like Neynar/Warpcast), prioritizing frame interactions and cast content.
- Secondary Sources (Future Scaling): Selected Telegram/Discord channels, Twitter, and on-chain activity (e.g., DEX trading volume spikes, high-velocity transactions).
- Data Structure: All raw input is standardized into a JSON object containing: timestamp, platform, user_id/fid, raw_text, engagements (replies, likes, recasts/retweets).
The Vibe Engine is the proprietary, multi-stage processing pipeline that converts raw data into the final Vibe Score.
- Removal of spam, bots (via basic heuristics/rate limiting), and non-textual content.
- Tokenization and lemmatization.
This utilizes the Gemini API for advanced sentiment detection:
- Contextual Analysis: For each piece of text, the LLM analyzes the sentiment, accounting for crypto-specific jargon and subtext (e.g., "NGMI" is negative, "WAGMI" is positive).
- Nuance Detection: The LLM detects:
- Intensity: Is the emotion mild or fervent?
- Polarity: Positive, Negative, or Neutral.
- Conditional Sentiment: Is the positivity/negativity conditional on a future event?
The final Vibe Score is a normalized weighted average, ranging from 0.0 to 10.0, derived from three factors:
Vibe Score = ((Σ S × W_E) + (Σ I × W_I) + (Σ R × W_R)) / 3
Where:
- S (Sentiment): The LLM-derived Polarity score (e.g., -1 to +1), weighted by Engagement (W_E)
- I (Intensity): The LLM-derived emotional strength score (0-1), weighted by Influence (W_I)
- R (Recency): Time decay factor, giving more weight to recent data points, weighted by Recency (W_R)
- Technology Stack: Next.js 16 with React 18, Tailwind CSS, and TypeScript
- Conditional Rendering: The app checks the execution context (MiniPay, Farcaster, or external wallet) to adjust UI accordingly
- Data Persistence: Uses Firestore for real-time synchronization with localStorage fallback
Volatility Vanguard is a USDm-based prediction market integrated into VibeCheck where users bet on token volatility relative to AI-predicted risk levels.
cd smartContracts
yarn install
cp .env.example .env
# Fill in your private key and API keys in .envyarn deploy-sepolia
yarn sync:datayarn deploy-celo
yarn sync:data-
placePrediction(roundId, predictsHigher, amount)
- Requires USDm approval before calling
- Stakes USDm tokens on volatility prediction
- Records prediction with current round information
-
claimWinnings(roundIds)
- Claims winnings from settled rounds
- Pull-based claiming mechanism
- Fees are taken from losing pool
-
startNewRound()
- Admin-only function
- Starts a new prediction round
- Protected by lock time guard
- Score ≥80: Low Risk (≤5% expected volatility)
- Score 50-79: Medium Risk (≤15% expected volatility)
- Score <50: High Risk (>15% expected volatility)
- VolatilityVanguard.tsx: Main prediction interface
- VolatilityVanguardService.ts: Contract interaction layer using Wagmi
- AdminPanel.tsx: Admin interface for contract management
- Risk Assessment Display: Shows AI-derived risk level
- Pool Statistics: Current betting distribution
- Prediction Interface: Higher/Lower volatility buttons
- Prediction Management: Track and resolve user predictions
- Real-time Updates: Pool data refreshes automatically
- User selects token and views VibeCheck score
- AI maps score to risk level (Low/Medium/High)
- User approves USDm spending (one-time or max approval)
- User predicts if actual volatility will be Higher or Lower than threshold
- User stakes USDm amount
- After lock period, oracle settles the round
- Winners can claim their share of the losing pool
- ReentrancyGuard: Prevents reentrancy attacks
- Ownable: Admin functions for contract management
- ERC20 Integration: Uses actual USDm token for payments
- Time-based Resolution: Enforces lock period before settlement
- Pull-based Claiming: Users actively claim winnings
- Efficient struct packing
- Batch operations where possible
- Minimal external calls
- Optimized for Celo's low gas costs
- Next.js Documentation
- Wagmi Documentation
- Viem Documentation
- Celo Documentation
- MiniPay Documentation
When contributing to the project:
- Follow the existing code style and patterns
- Use TypeScript for all new code
- Ensure components are mobile-responsive
- Test in both MiniPay and browser contexts
- Update this README if adding new setup steps
See the LICENSE file for details.
Need Help? Check the troubleshooting section or open an issue in the repository.