π PollCelo - Daily Poll, Daily Celo
The #1 Daily Prediction Market MiniApp on Farcaster using Celo + MiniPay (cUSD)
PollCelo is a viral daily polling app where users vote with tiny cUSD amounts (0.01 - 0.5 cUSD), creating a pot that winners share at the end of the day. Every poll is instantly shareable as a beautiful Farcaster Frame.
π Features
Core Features
- β One Daily Poll - New poll every day at 00:00 UTC
- π° Vote with cUSD - Tiny amounts (0.01 - 0.5 cUSD) on Celo
- π Win Rewards - 95% of pot shared among winners
- πΌοΈ Shareable Frames - Every poll is a beautiful Farcaster Frame
- π Live Results - Real-time voting progress
- π History - Track your wins and losses
- π Turkish Market Focus - USD/TRY, CBRT, and local content
- β‘ Almost Zero Fees - Thanks to Celo's low transaction costs
π New Features (Just Added!)
- π Referral System - Earn 0.01 cUSD per friend who votes
- π Smart Contract - Trustless voting & automatic payouts
- π± Mobile App - Native iOS & Android app (coming soon)
ποΈ Tech Stack
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS
- Blockchain: Celo (cUSD stablecoin)
- Wallet: MiniPay, Wagmi v2, Viem
- Farcaster: Frame SDK, Frame Wagmi Connector
- Storage: Upstash Redis (with in-memory fallback)
- OG Images: @vercel/og
- Deployment: Vercel
π Project Structure
daily-poll-mini-app/
βββ app/
β βββ layout.tsx # Root layout with metadata
β βββ page.tsx # Home - today's poll + voting
β βββ providers.tsx # Wagmi + React Query providers
β βββ globals.css # Global styles
β βββ poll/
β β βββ [id]/
β β βββ page.tsx # Individual poll detail
β β βββ layout.tsx # Poll metadata + Frame tags
β βββ history/
β β βββ page.tsx # Past polls + user stats
β βββ success/
β β βββ page.tsx # Vote confirmation + share
β βββ api/
β βββ og/
β βββ route.tsx # Dynamic OG image generation
β
βββ components/
β βββ Header.tsx # User info + cUSD balance
β βββ PollCard.tsx # Poll display with progress bars
β βββ VoteButton.tsx # cUSD amount selector + vote
β βββ WinnerBadge.tsx # Win/loss display
β βββ FAB.tsx # Floating action button
β
βββ lib/
β βββ polls.ts # Poll logic + in-memory storage
β βββ redis.ts # Upstash Redis integration
β βββ celo.ts # Celo/cUSD config + utils
β βββ wagmi-config.ts # Wagmi configuration
β βββ format.ts # Formatting utilities
β
βββ types/
β βββ index.ts # TypeScript types
β
βββ public/ # Static assets
π οΈ Setup Instructions
Prerequisites
- Node.js 18+ and npm/pnpm/yarn
- Vercel account (for deployment)
- Upstash Redis account (optional, free tier)
- Wallet with cUSD on Celo (for receiving fees)
1. Clone and Install
cd daily-poll-mini-app
npm install
# or
pnpm install
2. Environment Variables
Copy .env.local.example to .env.local:
cp .env.local.example .env.local
Edit .env.local:
# Upstash Redis (optional - app works without it)
UPSTASH_REDIS_REST_URL=https://your-redis-url.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_token_here
# Celo Network
NEXT_PUBLIC_CELO_RPC_URL=https://forno.celo.org
NEXT_PUBLIC_CUSD_ADDRESS=0x765DE816845861e75A25fCA122bb6898B8B1282a
# Your wallet address (to receive protocol fees)
PROTOCOL_WALLET_ADDRESS=0xYourWalletAddressHere
# App URL (for Frames)
NEXT_PUBLIC_APP_URL=http://localhost:3000
3. Run Development Server
npm run dev
Open http://localhost:3000 in your browser.
4. Testing in Warpcast
- Install Warpcast mobile app
- Enable Developer Mode in Settings
- Add your local URL (use ngrok for HTTPS):
ngrok http 3000 - Open the ngrok URL in Warpcast
π’ Deployment to Vercel
One-Click Deploy
Manual Deployment
-
Push your code to GitHub
-
Import to Vercel:
npx vercel -
Add environment variables in Vercel dashboard
-
Deploy:
npx vercel --prod -
Update
NEXT_PUBLIC_APP_URLto your Vercel domain
π First 7 Poll Ideas (Ready to Use)
The app comes with 7 pre-configured polls perfect for Turkish users:
- Tomorrow 1 USD = ? TL - Daily currency prediction
- Will BTC break $120K this week? - Crypto prediction
- FenerbahΓ§e vs Galatasaray - Derby winner
- Year-end 1 USD = ? TL - Long-term prediction
- Gold hits $3,000 this month? - Commodities
- Next CBRT interest rate decision - Central bank policy
- ETH surpasses $5,000 in December? - Ethereum prediction
π° Money Flow (How It Works)
Option A: Off-Chain (Launch Today!)
- Users vote by sending cUSD to your
PROTOCOL_WALLET_ADDRESS - Votes are recorded in Redis/memory
- At end of day, manually distribute 95% to winners
- Keep 5% as protocol fee
Distribution Script (manual):
// See lib/distribute.ts for full implementation
const winnersPot = totalPot * 0.95
const protocolFee = totalPot * 0.05
// Transfer winnersPot proportionally to all winners
Option B: On-Chain (Week 2 Upgrade)
Deploy a smart contract to automate distribution:
contract PollDistributor {
function vote(uint256 pollId, uint256 optionId) external payable
function closePoll(uint256 pollId, uint256 correctOptionId) external
function distribute(uint256 pollId) external
}
π¨ Customization
Adding New Polls
Edit lib/polls.ts and add to SEED_POLLS:
{
question: 'Your question here?',
description: 'Additional context',
emoji: 'π―',
options: [
{ id: 'opt1', text: 'Option 1', emoji: 'β
', votes: 0, totalAmount: 0 },
{ id: 'opt2', text: 'Option 2', emoji: 'β', votes: 0, totalAmount: 0 },
],
}
Changing Vote Amounts
Edit lib/celo.ts:
export const VOTE_OPTIONS = [
{ amount: 0.01, label: '0.01 cUSD', emoji: 'πͺ' },
{ amount: 0.05, label: '0.05 cUSD', emoji: 'π°' },
{ amount: 0.1, label: '0.1 cUSD', emoji: 'π΅' },
{ amount: 0.5, label: '0.5 cUSD', emoji: 'πΈ' },
]
Customizing Colors
Edit tailwind.config.ts:
colors: {
celo: {
green: '#35D07F',
yellow: '#FBCC5C',
dark: '#2E3338',
},
}
π§ Troubleshooting
Wallet Not Connecting
- Make sure you're testing in Warpcast app (not browser)
- Check that Frame SDK is initialized:
sdk.actions.ready() - Verify Celo RPC URL is working
Votes Not Recording
- Check
PROTOCOL_WALLET_ADDRESSis set correctly - Verify user has enough cUSD + CELO for gas
- Check browser console for transaction errors
Redis Not Working
- App works fine without Redis (uses in-memory storage)
- Verify Upstash credentials in
.env.local - Check Redis dashboard for connection errors
π Analytics & Monitoring
Track key metrics:
- Daily Active Users - Unique voters per day
- Total Volume - cUSD voted per day
- Win Rate - Percentage of users who win
- Viral Coefficient - Shares per user
π£οΈ Roadmap
- Core voting functionality
- Farcaster Frame integration
- Real-time results
- History tracking
- Smart contract for auto-distribution
- Referral rewards (0.01 cUSD per friend)
- Leaderboard
- Push notifications for results
- Multi-language support
- Advanced analytics dashboard
π€ Contributing
Contributions welcome! Please:
- Fork the repo
- Create a feature branch
- Make your changes
- Submit a pull request
π License
MIT License - see LICENSE file for details
π Support
- GitHub Issues: Report a bug
- Farcaster: @yourusername
- Email: your@email.com
π Ready to Launch?
You now have a fully functional daily poll MiniApp that:
β Works on Farcaster with MiniPay β Uses cUSD on Celo (almost zero fees) β Has beautiful shareable Frames β Includes 7 pre-made Turkish market polls β Can be deployed to Vercel in minutes
Let's ship this and get thousands of users voting with cUSD tomorrow! π
Built with β€οΈ for the Farcaster + Celo community