A Bloomberg Terminal-style platform for prediction markets, creating financial derivatives on top of existing prediction market contracts from Kalshi, Polymarket, and Manifold.
Ivry creates synthetic financial assets from prediction markets:
- ** Index Products**: Combined baskets of related contracts (e.g., Election Index, Crypto Index)
- ** Volatility Options**: Hedge against prediction market volatility
- ** Single Contracts**: Individual prediction market positions
- ** Basket Products**: Diversified portfolios across themes
Users can search, discover, and trade these financial instruments through a professional trading terminal interface.
arbitrader-1/
├── src/arbitrader/ # Python backend
│ ├── clients/ # API clients for Kalshi, Polymarket, Manifold
│ ├── flows/ # Prefect workflows for data collection
│ ├── models/ # Data models
│ ├── services/ # Embeddings, Qdrant (vector DB), Clustering
│ └── api/ # FastAPI layer (coming soon)
├── frontend/ # Next.js Terminal UI (Dark Mode)
│ ├── app/ # Pages and routes
│ ├── components/ # Terminal-style React components
│ └── lib/ # Types and data models
└── README.md
- Install dependencies:
pip install -e .- Set up environment variables:
cp .env.example .env
# Edit .env with your API keys if neededFor Qdrant Cloud:
- Set
QDRANT_URLto your cluster URL (e.g.,https://xxx.qdrant.io) - Set
QDRANT_API_KEYto your API key - Leave
QDRANT_HOSTandQDRANT_PORTempty
For local Qdrant:
- Set
QDRANT_HOST=localhostandQDRANT_PORT=6333 - Leave
QDRANT_URLandQDRANT_API_KEYempty
- Start Qdrant (if using local instance):
docker run -p 6333:6333 qdrant/qdrantpython run_flow.py# Deploy the flow
prefect deploy src/arbitrader/flows/market_events.py:process_market_events --name market-events
# Run the deployment
prefect deployment run process_market_events/market-eventspython deploy.pyThis will start a flow server that you can trigger via the Prefect UI or API.
src/arbitrader/- Main Python packageclients/- API clients for Kalshi, Polymarket, and Manifoldflows/- Prefect workflow definitionsmodels/- Data modelsservices/- Embedding, Qdrant, and Clustering servicesconfig.py- Configuration settings
The Next.js frontend is in the frontend/ directory. See frontend/README.md for details.
cd frontend
npm install
npm run dev # Runs on http://localhost:3000- Fetches events from Kalshi and Manifold APIs
- Generates embeddings using MiniLM-L6-V2 model
- Stores events and embeddings in Qdrant vector database
- Uses Prefect for workflow orchestration with retries and error handling
Manifold API works without authentication for public data. Optional API key can be added to .env if needed.
SETUP:
BACKEND: python -m venv .venv .venv\Scripts\activate pip install uv pip install google-genai uv sync
FRONTEND: cd frontend npm install
POST SETUP
RUN BACKEND: .venv\Scripts\activate uvicorn src.arbitrader.api.server:app --reload --host 0.0.0.0 --port 8000
RUN FRONTEND: cd frontend npm run dev