Skip to main content

Deploy Your Prediction Market in 15 Minutes

This guide will walk you through deploying a production-ready prediction market using Vercel’s one-click deployment and Supabase integration.
Prerequisites: You’ll need GitHub and Vercel accounts. Both are free to get started.

Deployment Steps

1

Fork the Repository

First, star and fork the Kuest repository to your GitHub account:
  1. Visit github.com/kuestcom/prediction-market
  2. Click the ⭐ Star button (top right)
  3. Click Fork to create your own copy
Starring helps us grow the community and keeps you updated on releases!
2

Configure Environment Variables

Before deploying, you need to configure your environment variables. Download and edit the .env.example file:
  1. Download .env.example
  2. Edit the file with your configuration (details below)
  3. Save it for Step 3 when you’ll import it to Vercel

Required Environment Variables

Kuest CLOB Authentication

Generate your trading credentials at auth.kuest.com by connecting your Polygon wallet:
.env
KUEST_ADDRESS="0x..."          # Your Polygon wallet address
KUEST_API_KEY="..."            # Generated API key
KUEST_API_SECRET="..."         # Generated API secret
KUEST_PASSPHRASE="..."         # Generated passphrase
These credentials authenticate your fork with the shared Kuest CLOB (Central Limit Order Book) for order matching.

Admin Configuration

.env
# Comma-separated list of admin wallet addresses
ADMIN_WALLETS="0x...,0x..."
Admin wallets can:
  • Access the admin panel at /admin
  • Create custom markets
  • Configure platform settings and fees
  • Manage categories and tags

Reown AppKit (Wallet Connection)

Create a free project at dashboard.reown.com:
.env
REOWN_APPKIT_PROJECT_ID="..."
This enables WalletConnect v2 for wallet connections (MetaMask, Rainbow, etc.).

Better Auth (Session Management)

Generate a random 32-character secret at better-auth.com:
.env
BETTER_AUTH_SECRET="..."  # 32 random characters
Important: Changing this value invalidates all user sessions and encrypted credentials, requiring users to re-authenticate.

Cron Secret

Create a random secret (16+ characters) for securing your cron jobs:
.env
CRON_SECRET="..."  # Random 16+ character string

Optional Environment Variables

Image Optimization

.env
# Enable Next.js image optimization (may increase Vercel costs)
IMAGE_OPTIMIZATION=false

Monitoring (Sentry)

Optional error tracking and monitoring:
.env
SENTRY_DSN="..."
SENTRY_ORG="..."
SENTRY_PROJECT="..."
SENTRY_AUTH_TOKEN="..."
3

Deploy to Vercel

Now deploy your forked repository to Vercel:
  1. Go to vercel.com/new
  2. Click Add NewProject
  3. Import your forked repository (connect GitHub if needed)
  4. In the import modal, expand Environment Variables
  5. Click Import .env and select your edited .env.example file
  6. Click Deploy
  7. Wait for deployment to complete (2-3 minutes)
  8. Click Continue to Dashboard
The first deployment will succeed but won’t be functional yet - we need to add the database in Step 4.
4

Create Supabase Database

Vercel provides one-click Supabase integration:
  1. In your Vercel project, navigate to Storage tab
  2. Click Create DatabaseSupabase
  3. Accept default settings (creates a Supabase account if you don’t have one)
  4. Click Create
  5. After creation completes, click Connect Project
This automatically:
  • Creates a Supabase project
  • Sets up PostgreSQL database
  • Configures Supabase Storage bucket
  • Adds connection environment variables to Vercel
Supabase provides 500MB database and 1GB storage on the free tier - perfect for getting started.
5

Redeploy with Database

Now that the database is connected, redeploy to initialize the schema:
  1. Go to the Deployments tab
  2. Find your latest deployment
  3. Click the three dots (…) menu
  4. Select Redeploy
  5. Confirm and wait for deployment to complete
This deployment will:
  • Run database migrations
  • Initialize database schema
  • Sync initial market data
  • Make your prediction market fully functional
6

Enable Fork Sync (GitHub Actions)

Keep your fork updated with upstream changes:
  1. In your forked repository on GitHub, go to SettingsActionsGeneral
  2. Under “Actions permissions”, select Allow all actions and reusable workflows
  3. Click Save
This enables automated sync workflows to pull updates from the main Kuest repository.
GitHub Actions also runs automated tests on your fork to ensure everything works correctly.
7

Complete Admin Setup

Your prediction market is now live! Complete the setup:
  1. Visit your deployed site (find the URL in Vercel dashboard)
  2. Connect your wallet (must be one of the ADMIN_WALLETS)
  3. Navigate to AdminGeneral
  4. Configure:
    • Company name and branding
    • Trading fees and affiliate settings
    • Theme colors and logos
    • Default language and localization
The admin panel is only accessible to wallets listed in the ADMIN_WALLETS environment variable.

Your Market is Live! 🎉

Congratulations! You now have a fully functional prediction market. Here’s what you can do next:

Create Markets

Learn how to create custom prediction markets

Customize Branding

Update colors, logos, and theme settings

Configure Fees

Set custom trading fees for your fork

API Integration

Build trading bots with our APIs

Optional: Add Custom Domain

Want to use your own domain? In Vercel:
  1. Go to SettingsDomains
  2. Add your custom domain
  3. Follow DNS configuration instructions
  4. Wait for DNS propagation (5-30 minutes)
Custom domains are included in Vercel’s free tier!

Alternative Deployment Options

While Vercel + Supabase is the fastest path, Kuest supports multiple deployment targets:

Docker

Self-host with Docker Compose

Kubernetes

Deploy to any Kubernetes cluster

Cloud Run

Google Cloud Run deployment

Fly.io

Deploy to Fly.io edge network

Troubleshooting

Deployment fails with database error

Ensure you completed Step 5 (Redeploy with Database). The first deployment won’t work without database connection.

”Admin access denied” error

Verify your wallet address is correctly added to ADMIN_WALLETS in Vercel environment variables:
  1. Go to Vercel → SettingsEnvironment Variables
  2. Check ADMIN_WALLETS value matches your wallet address (case-insensitive)
  3. Redeploy if you made changes

Markets not loading

Check the cron jobs are running:
  1. Vercel → Deployments → Latest deployment logs
  2. Look for /api/sync/ endpoint calls
  3. Ensure CRON_SECRET is set correctly

Wallet connection fails

Verify REOWN_APPKIT_PROJECT_ID is set correctly:
  1. Check dashboard.reown.com
  2. Copy the Project ID from your AppKit project
  3. Update environment variable in Vercel
  4. Redeploy
Need help? Join our Discord or open an issue on GitHub.

Next Steps

Now that your prediction market is deployed:

Build docs developers (and LLMs) love