Inspiration

Prediction markets like Kalshi move incredibly fast, especially when macroeconomic news drops. When users see a sudden spike or crash on a chart, they often wonder: "Why did this move right now?" and "What other markets should I be trading based on this?" We wanted to build an event attribution and propagation assistant that helps traders make sense of these sudden moves by surfacing context and identifying related opportunities without overstating causality.

What it does

Market Move Explainer is a Chrome MV3 extension tailored for Kalshi market pages. When a user clicks on a sharp price move on a Kalshi chart, the extension injects a compact floating panel that displays a "likely catalyst" for the jump—such as a scheduled economic event or a breaking news headline—along with supporting evidence. Furthermore, it identifies related markets and alerts the user to contracts that are "worth checking" or "possibly lagging" behind the broader market reaction.

How we built it

-Frontend: A TypeScript-based Chrome MV3 extension that captures chart clicks, extracts market metadata, and renders an isolated floating UI panel using a shadow DOM so it doesn't conflict with Kalshi's styling.

-Backend Engine: A local Python FastAPI application that receives the MarketClickContext payload, computes the move's summary, ranks nearby catalysts, and evaluates related markets based on historical data.

-Data Pipeline: A robust macro preprocessing pipeline that ingests live market metadata and candlestick history directly from Kalshi's public APIs. We integrated Google Gemini 2.5 Flash to periodically run batch categorizations on newly discovered markets using a strict JSON schema.

Challenges we ran into

-Reliable Chart Extraction: Accurately grabbing live DOM data and click coordinates from dynamic charts was difficult. We addressed this by building a "best-effort" chart extractor alongside a dedicated deterministic mock flow to ensure UI development and demoing stayed unblocked.

-Data Overload & Rate Limiting: Ingesting Kalshi's historical history could easily trigger rate limits. We solved this by designing our data pipeline to cache per-market CSV files locally, ensuring reruns were incremental and easily resumable.

-Causality Hallucinations: We had to carefully guard against making the tool look like a definitive "arbitrage oracle." We strictly enforced conservative wording in our contracts and UI, framing explanations as "likely catalysts" and trends as "possibly lagging" rather than guaranteed causality.

Accomplishments that we're proud of

-Successfully connecting a fully-typed Chrome extension to a Python backend capable of analyzing real-time financial chart clicks.

-Building a safe, LLM-powered market discovery architecture. Instead of letting the LLM mutate the live database instantly, we created a conservative scheduler that places new Gemini-generated categories into a "candidate" state until they are manually reviewed and promoted.

What we learned

-We gained a deep understanding of Chrome's MV3 architecture, specifically how to use shadow roots to prevent our injected CSS from clashing with the host website.

-We learned how to orchestrate complex data pipelines that calculate financial metrics like comovement and cointegration across prediction markets.

-We improved our prompt engineering by forcing an LLM (Gemini) into a highly strict, offline JSON-batching workflow.

What's next for Kalshify

-Expanding Scope: Currently, the system has a "macro-first" scope (focusing on core economics). We want to scale the data pipeline to cover all of Kalshi's categories, including politics, culture, and tech.

-Advanced Analytics: Upgrading the cointegration module, which is currently gated behind a stub, to fully support advanced pair-trading signal detection.

-Cloud Deployment: Migrating the local FastAPI scaffolding and SQLite caching system to a fully hosted cloud environment so any user can download the extension and use it instantly without running a local Python environment.

Built With

Share this project:

Updates