vibe analytics for prediction markets
Natural language analytics dashboard for Kalshi and Polymarket prediction market data. Ask questions in plain English, get charts. Powered by LLM-generated SQL over ClickHouse.
- Natural language to SQL — ask questions, get interactive charts
- Multi-platform — Kalshi + Polymarket data side by side
- Smart charting — auto-selects chart type, date formatting, number formatting (K/M/B)
- Widget refinement — inline editing of any chart with full conversation history
- Natural language targeting — reference widgets by name or position ("make the 2nd chart a line chart")
- Materialized views — pre-computed aggregations for instant common queries
- Self-correction — automatic SQL retry when queries fail
- Flexible LLM backend — OpenAI, Anthropic, Gemini, Ollama, or any OpenAI-compatible API
"Compare the longshot bias (calibration error) between Kalshi and Polymarket"
"Show Kalshi maker vs taker monthly excess return over time"
"Break down maker vs taker excess return by category on Kalshi (top 5)"
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ React Frontend │ │ Fastify API │ │ ClickHouse │
│ Vite + TW4 │────>│ /api/query │────>│ analytics db │
│ port 5173 │ │ port 3001 │ │ port 8123 │
└──────────────────┘ └──────────────────┘ └──────────────────┘
│
v
┌──────────────────┐
│ LLM Provider │
│ (OpenAI, etc) │
└──────────────────┘
| Layer | Technology |
|---|---|
| Runtime | Bun |
| API | Fastify, ClickHouse, OpenAI SDK |
| Frontend | React 19, Vite 6, Tailwind CSS 4 |
| Charts | Recharts |
| State | Zustand |
| Layout | react-grid-layout |
| Types | Shared TypeScript package |
| LLM Proxy | LiteLLM (optional) |
- Bun v1.0+
- An OpenAI API key (or any OpenAI-compatible provider)
- ClickHouse instance + Polygon RPC access (setup guide)
git clone https://github.com/pzeroai/pzero.git
cd p0
bun installcp .env.example .env
# Edit .env — at minimum, set LLM_API_KEYbun run migrate-parquet
bun run backfill-trade-timestampsbun run dev- Setup Guide — installation, data, and LLM configuration
- Architecture — system design and data flow
- Usage Guide — how to use the app with example queries
- Contributing — development workflow and PR process
Special thanks to @beckerrjon and prediction-market-analysis for the prediction market dataset that powers this project.


