Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5.8 KiB
Predikt โ env & keys you need to fill in
Everything you must supply to run/deploy Predikt, grouped by component. ๐ = private secret (never commit). โฌ = public value (safe). Every component ships a .env.example / .env.local.template; copy it to .env / .env.local and fill in. All committed values are safe local-dev defaults or public placeholders โ replace them with yours.
1. Backend + database (the app's core) โ oracle/
The app runs on Supabase + Firebase (Manifold's stack). See oracle/web/docs/BACKEND-CONFIG.md.
Create these free-tier accounts: Supabase project ยท Firebase project.
Set in oracle/common/src/envs/prod.ts (+ dev.ts) โ the committed values are Manifold's placeholders and auth breaks until replaced:
- โฌ
supabaseInstanceIdโ your Supabase project ref - โฌ
supabaseAnonKeyโ Supabase anon key (public, RLS-protected) - ๐ Supabase service_role key โ admin/SSR (server env
DEV_ADMIN_SUPABASE_KEY/ prod secret) - ๐ Supabase DB connection โ host/port/password (
SUPABASE_HOST/PORT/PASSWORD) - ๐
SUPABASE_JWT_SECRET,API_SECRET,SCHEDULER_AUTH_PASSWORD - โฌ Firebase web config โ
apiKey(public, domain-locked) /authDomain/projectId/appId/messagingSenderId/measurementId - ๐ Firebase service account JSON (backend admin SDK) + Apple sign-in provider config (App Store requirement)
Backend templates: oracle/backend/api/.env.local.template, oracle/backend/scheduler/.env.local.template.
2. Web app โ oracle/web/.env.local
- โฌ
NEXT_PUBLIC_SUPABASE_URL/NEXT_PUBLIC_SUPABASE_KEY/SUPABASE_URL/SUPABASE_KEYโ your Supabase project (prod) or local (npx supabase start) - ๐
DEV_ADMIN_SUPABASE_KEYโ Supabase service_role (SSR) - AI market factory โ ๐
OPENROUTER_API_KEY(openrouter.ai, server-only) ยท โฌNEXT_PUBLIC_AI_MODEL(default free Llama) ยท โฌOPENROUTER_SITE_URL/OPENROUTER_SITE_NAME - On-chain (all โฌ PUBLIC addresses โ see ยง5):
NEXT_PUBLIC_ONCHAIN_UMA_ADAPTER,_EXCHANGE,_CONDITIONAL_TOKENS,_UMA_OPTIMISTIC_ORACLE,_USDC(optional),_FPMM_FACTORY,_RELAY_URL - Jurisdiction (optional โฌ):
NEXT_PUBLIC_ONCHAIN_BLOCKED_REGIONS/NEXT_PUBLIC_ONCHAIN_ALLOWED_REGIONS(ISO-3166 codes) - Gasless (optional): โฌ
NEXT_PUBLIC_PAYMASTER_URL(free-tier ERC-4337 paymaster)
3. Mobile app โ oracle/native
See oracle/native/FIREBASE-SETUP.md. Run npx expo prebuild --clean before building.
- โฌ
EXPO_PUBLIC_WEB_DOMAIN/EXPO_PUBLIC_WEB_URLโ your deployed Predikt web URL (required for WebView/deep-links/OTA) - โฌ
EAS_PROJECT_ID(runeas init) ยท โฌEAS_OWNER(your Expo account) - ๐ Firebase config files โ your own
google-services.json(Android, packagecom.predikt.app) +GoogleService-Info.plist(iOS, bundlecom.predikt.app) intoconfigs/{dev,prod}/ - ๐
EXPO_PUBLIC_SENTRY_DSN(optional) + โฌEAS/Sentry org - Replace app icons/splash in
assets/with real Predikt art - Accounts: Apple Developer, Google Play, Expo/EAS
4. On-chain relay + market maker โ predikt-relay/.env
- โฌ
PORT,SUBMIT_RATE_LIMIT_PER_MIN,READ_RATE_LIMIT_PER_MIN,TRUST_PROXY - โฌ
RELAY_ALLOWED_ORIGINSโ your app origin(s) (never*) - โฌ
CHAIN_ID(137 Polygon) ยท ๐RPC_URL(your RPC โ Alchemy/Infura free tier, or public) - โฌ
EXCHANGE_ADDRESS/USDC_ADDRESS/CTF_ADDRESS(from ยง5 deploy) - ๐
OPERATOR_PKโ the relay operator EOA key (granted the exchange operator role viaaddOperator) - โฌ
DATABASE_PATH,START_BLOCK - Market maker (
npm run mm): ๐MM_PRIVATE_KEY(funded maker EOA โ USDC) ยท โฌMM_MARKETS,MM_SPREAD_BPS,MM_ORDER_SIZE,MM_LEVELS,MM_REFRESH_MS
5. Contracts deploy โ predikt-contracts/
Deploy each with its own forge script (or deploy-kit). See predikt-contracts/DEPLOY.md.
- ctf-exchange (
.env): ๐PK(deployer key) ยท โฌADMIN,RPC_URL,COLLATERAL(native USDC),CTF,PROXY_FACTORY,SAFE_FACTORY - uma-ctf-adapter (
.env): ๐PKยท โฌCTF,FINDER,OPTIMISTIC_ORACLE,RPC_URLยท โฌETHERSCAN_API_KEY(Polygonscan, for verify) - deploy-kit: ๐
PRIVATE_KEYยท โฌRPC,--chain amoy|polygon - Real Polygon primitive addresses (ConditionalTokens/USDC/UMA) are documented in
DEPLOY.md. - (
clob-client/.envโ the hosted-CLOB SDK client; NOT needed since we self-host the relay.)
6. Bots / distribution
- liquify (off-chain MM) + autopilot (trader) โ
.env: ๐MANIFOLD_API_KEY(your Predikt account API key, from Profile โ API key) ยท โฌMANIFOLD_USERNAMEยท โฌORACLE_API_URL(optional) ยท autopilot: โฌMANIFOLD_MARKET_SLUG - herald (Discord) โ
.env: ๐DISCORD_BOT_TOKEN, โฌDISCORD_CLIENT_ID(Discord dev portal) ยท โฌORACLE_API_URLยท ๐ORACLE_API_KEY(fallback) - relay-tg (Telegram) โ
.env: ๐BOT_TOKEN(@BotFather) ยท โฌORACLE_API_URLยท ๐ORACLE_API_KEY(fallback) - Bots store per-user keys in
keys.json(gitignored, plaintext โ keep the dir private).
Free-tier accounts summary
Supabase ยท Firebase ยท OpenRouter ยท an EVM RPC (Alchemy/Infura) ยท Expo/EAS ยท Apple Developer ยท Google Play ยท Discord + Telegram bots ยท Polygonscan (verify). Plus a funded EVM wallet (USDC on Polygon) for the operator + market maker to go on-chain.
Nothing in this repo is a real private secret โ committed values are safe local defaults / public placeholders / public contract addresses. Fill your own into the .env files (which are gitignored).