A swipe-based micro prediction app built on Base, featuring gasless transactions and instant predictions. Users can make quick predictions with simple swipe gestures. Here's the demo link: https://based-rust.vercel.app/ Youtube video: https://www.youtube.com/watch?v=wV99Tz0V4mw
- Next.js - React framework
- MiniKit - Base wallet integration
- OnchainKit - Base blockchain utilities
- Tailwind CSS - Styling
- Supabase - Database and real-time subscriptions
- Foundry - Smart contract development
- Install dependencies:
npm install
# or
yarn install
# or
pnpm install
# or
bun install
- Set up environment variables:
# OnchainKit Configuration
NEXT_PUBLIC_ONCHAINKIT_PROJECT_NAME=TOMO
NEXT_PUBLIC_URL=your-deployment-url
NEXT_PUBLIC_ICON_URL=your-icon-url
NEXT_PUBLIC_ONCHAINKIT_API_KEY=your-api-key
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
# Paymaster & Gasless Transactions (Coinbase Developer Platform)
NEXT_PUBLIC_PAYMASTER_URL=https://api.developer.coinbase.com/rpc/v1/base/your-project-id
NEXT_PUBLIC_BUNDLER_URL=https://api.developer.coinbase.com/rpc/v1/base/your-project-id
# Optional: Redis for notifications
REDIS_URL=your-redis-url
REDIS_TOKEN=your-redis-token
- Start the development server:
npm run dev
- Intuitive swipe gestures for Yes/No predictions
- Real-time market cards with live data
- Support for multiple market categories (Crypto, Sports, Politics, Tech, Celebrity)
- Powered by Coinbase Paymaster for sponsored transactions
- Users can predict without holding ETH for gas
- Seamless UX with automatic transaction batching
- Create custom prediction markets with OnchainKit
- Set custom end dates and categories
- Automatic smart contract deployment
- Live leaderboard with user rankings
- Real-time position updates via Supabase
- Instant transaction confirmations
- Built on Base network for low fees
- Custom MarketFactory contract for market creation
- USDC-based predictions with proper decimals handling
- Home.tsx - Main swipe interface with market cards
- SwipeStack.tsx - Handles swipe gestures and animations
- PredictionMarket.tsx - Individual market prediction interface
- CreateMarketOnchainKit.tsx - Market creation with OnchainKit
- Leaderboard.tsx - User rankings and statistics
- Supabase - Real-time database for predictions and positions
- Smart Contracts - MarketFactory and SimplePredictionMarket on Base
- Gasless Transactions - Coinbase Paymaster integration
- Market Data - Category-based market generation system
- Set up Supabase project and get your URL/keys
- Run the database schema from
supabase-schema.sql
- Configure RLS policies for secure access
Contracts are deployed on Base Sepolia testnet:
- MarketFactory:
0xAa84401Ef34C0334D4B85259955DE1fa99495B96
- USDC (Test):
0x32dfDC3bB23d294a1b32E0EDDEddB12088112161
For local testing, use the reset script to clear test data:
-- Execute scripts/reset-test-data.sql in Supabase SQL editor
-- Clears test predictions and positions to avoid duplicates
- user_predictions - Individual swipe predictions with transaction hashes
- user_positions - Aggregated user positions per market
- markets - Prediction market metadata and contract addresses
- Deploy to Vercel or your preferred platform
- Set up production Supabase instance
- Configure Coinbase Developer Platform for gasless transactions
- Deploy smart contracts to Base mainnet (if needed)
- Ensure all environment variables are set in production
- Configure CORS settings for your domain
- Set up proper RLS policies in Supabase