Kalshi ETF Baskets: Democratizing Prediction Markets

Inspiration

Prediction markets are powerful tools for forecasting, but they can be overwhelming. While traditional finance offers ETFs (Exchange-Traded Funds) to let investors bet on sectors or trends without picking individual stocks, prediction markets like Kalshi require users to find and trade specific, granular contracts (e.g., "Fed rates in March" vs "Fed rates in April"). So, our project explores ETFs for prediction markets.

Our inspiration came from the desire to bridge the gap between high-level intuition ("I think AI is going to boom this year") and the specific, complex instruments available on exchanges. We wanted to build a tool that lets anyone trade on a theme in a single click.

What it does

Kalshi ETF Baskets allows users to: Select a Theme: Choose from curated baskets like "Tech Growth", "Climate Change", or "Inflation". Generate with AI: Describe a trend in natural language (e.g., "Crypto will crash in late 2025"), and our LLM agent dynamically constructs a portfolio of relevant Kalshi markets. One-Click Execution: Instantly execute a batched order to buy "Yes" or "No" positions across multiple markets, weighted by confidence or strategy.

How we built it

Stack

  • Backend: Python & FastAPI
  • Frontend: Streamlit
  • Model: We used GPT-4 to interpret natural language trends and map them to live Kalshi market tickers

Key Algorithms

To allocate capital across different markets in a basket, we implement a weighted allocation strategy. The total budget B is distributed among n selected markets based on a relevance score R_i and a confidence factor C_i.

Allocation for market i is computed as:

Allocation_i = B * (R_i * C_i) / sum_{j=1 to n} (R_j * C_j)

This ensures that capital is distributed proportionally to the strength of each market’s signal, so the ETF emphasizes the contracts most aligned with the chosen theme.

Challenges we ran into

  • Market Ephemerality: Unlike stocks, prediction markets expire. A "Climate" basket today must have different contracts than one next month. Our dynamic sourcing engin constantly updates the available components of a basket.
  • Latency & Atomicity: Executing a basket trade implies placing multiple orders simultaneously. We had to handle partial fills and ensure that either the whole basket executes or we handle failures gracefully (using batch orders where possible).

Accomplishments that we're proud of

  • End-to-End Trading: We successfully placed real (demo) trades on Kalshi from a single button click in our custom UI
  • Smart Curation: The "Generate from Trend" feature lets you type a sentence and see a list of financial contracts pop up is a glimpse into the future of trading interfaces.

Built With

Share this project:

Updates