GodsEye is a multi-agent prediction market analysis app built around Polymarket. It imports live markets, generates claims, creates a simulated society of forecasters, runs a belief-updating simulation, and lets you inspect the result through an interactive globe, replay view, and report flow.
- Imports live Polymarket markets
- Shows active markets on a globe-first discovery UI
- Generates claims and evidence for a market
- Builds a panel of AI forecasters with distinct styles
- Runs a multi-tick simulation of belief updates and claim sharing
- Produces a report comparing market probability vs. simulation probability
- Supports paper trading against report outcomes
- Next.js 16
- React 19
- TypeScript
- Three.js / React Three Fiber
- Supabase client
- FastAPI
- SQLAlchemy async
- PostgreSQL / Supabase
- httpx
- LiteLLM
- Lava-backed Gemini + Apollo access
backend/ FastAPI API, services, schemas, tests
frontend/ Next.js app, globe UI, simulation and report pages
docs/ Specs and supporting design docs
- A user pastes a Polymarket URL or browses a live event.
- The backend imports market metadata and current probability.
- Claims are generated for the market question.
- A simulation world is built with multiple forecast agents.
- The simulation runs and tracks belief, confidence, trust, and faction changes.
- The frontend renders the replay and report views.
- Node.js current LTS
- npm
- Python 3.12
- A PostgreSQL database or Supabase project
Create backend/.env with the values you need for local development.
DATABASE_URL=postgresql://...
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=...
LAVA_API_KEY=...
K2_API_KEY=...
POLYMARKET_GAMMA_BASE_URL=https://gamma-api.polymarket.comUseful notes:
DATABASE_URLcan bepostgresql://...; the app normalizes it to the async SQLAlchemy driver.LAVA_API_KEYis required for Gemini and Apollo-backed calls.K2_API_KEYis needed fork2-thinkmodel calls.- If
SUPABASE_URLand keys are missing, some live database-backed features will not work.
Create frontend/.env:
NEXT_PUBLIC_API_URL=http://localhost:5001
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=...If Supabase env vars are missing, the frontend falls back to a no-op realtime client instead of crashing.
cd backend
python -m venv .venvActivate the virtual environment:
# PowerShell
.venv\Scripts\Activate.ps1
# bash
source .venv/Scripts/activateInstall dependencies and run the API:
pip install -r requirements.txt
uvicorn app.main:app --reload --port 5001The API will be available at http://localhost:5001.
cd frontend
npm install
npm run devThe app will be available at http://localhost:3000.
GET /healthz- backend healthcheckPOST /api/markets/import- import a Polymarket marketGET /api/markets/browse- browse live Polymarket eventsPOST /api/markets/refresh- refresh the browse cachePOST /api/sessions/{market_id}/claims/generate- generate claimsPOST /api/simulations/build-world- create a simulationPOST /api/simulations/{simulation_id}/start- start a simulationGET /api/reports/{simulation_id}- fetch a report
- The browse feed is cached in memory on the backend for one hour unless explicitly refreshed.
- The frontend globe can still render with fallback data if the backend is unavailable.
- The app uses
NEXT_PUBLIC_API_URLto decide which backend to call. - The backend loads env vars from the repo root
.envandbackend/.env, withbackend/.envtaking precedence.
Frontend:
cd frontend
npm run buildBackend tests and smoke checks live under backend/tests/ plus the integration scripts in backend/.
The app title and UI branding use GodsEye.