Skip to content

Instantly share code, notes, and snippets.

@vishalsachdev
Created January 10, 2026 18:49
Show Gist options
  • Select an option

  • Save vishalsachdev/0cf61e464014149d3bfd2a29aacb5702 to your computer and use it in GitHub Desktop.

Select an option

Save vishalsachdev/0cf61e464014149d3bfd2a29aacb5702 to your computer and use it in GitHub Desktop.
Prediction markets primer for analytics projects

Here is a complete, formatted Markdown file ready to be copied and pasted directly into a GitHub Gist.


Prediction Markets & Analytics: A Portfolio Guide for Gies MSBA Students

Target Audience: Students in the MS in Business Analytics (MSBA) program at Gies College of Business. Goal: Leverage prediction market data (Polymarket, Kalshi) to build standout portfolio projects that demonstrate skills in Big Data, Financial Analytics, and Storytelling.


🚀 Why Prediction Markets?

Most analytics portfolios are filled with the same "Titanic Survival Prediction" or "Stock Price Forecasting" projects. Prediction markets offer a competitive edge because they generate probabilistic data on unique real-world events (elections, Fed rates, pop culture, climate).

  • It’s not just finance: It’s "Information Aggregation."
  • It’s Big Data: High-frequency order book updates.
  • It’s Business Intelligence: Real-time sentiment analysis that businesses actually pay for.

📚 Curriculum Alignment: Mapping Projects to Gies Courses

Don't just build random projects; align them with your coursework to double your efficiency.

1. BADM 517: Data Storytelling

  • The Angle: "The Wisdom of Crowds vs. Pundits."
  • Project: Compare the probability history of a major event (e.g., an election or product launch) on Polymarket against traditional polling or news sentiment.
  • Deliverable: An interactive Tableau or Streamlit dashboard showing the exact moment the market "knew" the outcome before the news broke.

2. FIN 550: Big Data Analytics in Finance

  • The Angle: "Market Microstructure & Liquidity."
  • Project: Ingest the full order book (bids/asks) from Kalshi. Analyze spread, market depth, and slippage.
  • Deliverable: A Python notebook calculating volatility metrics and "cost of trading" across different asset classes (e.g., Politics vs. Economics markets).

3. BADM 554: Enterprise Database Management

  • The Angle: "Real-Time Event Data Warehouse."
  • Project: Build an ETL pipeline that fetches data every minute from an API and stores it in a structured SQL database (PostgreSQL) with a normalized schema (Markets, Prices, Volume).
  • Deliverable: A live database schema diagram and the automated scripts (Cron jobs) that power it.

🛠️ The Data: How to Get It (Free & Legal)

Do not scrape the websites. Use the official APIs.

A. Polymarket (Crypto-Native)

Polymarket uses an off-chain order book for speed but settles on-chain (Polygon).

  • API: Polymarket Gamma API Docs
  • Endpoint: https://gamma-api.polymarket.com/events
  • Cost: Free for public data (prices, volume, history).
  • Tip: You don't need a wallet or API key just to read data.

B. Kalshi (US Regulated)

Kalshi is CFTC regulated. Their data is structured and clean.

  • API: Kalshi Developer Docs
  • Endpoint: https://api.elections.kalshi.com/trade-api/v2/markets (Check docs for the latest base URL).
  • Cost: Free market data.

🤖 The AI-Accelerated Workflow

Use your tools (VS Code, Copilot, Claude/ChatGPT) to act as a "Senior Developer" while you focus on the analytics strategy.

Step 1: The Setup (Prompt Engineering)

Don't write boilerplate code from scratch.

  • Copy the "Get Markets" JSON response example from the API docs.
  • Prompt Claude/ChatGPT:

"I am a Python beginner. Here is the API response structure for Polymarket. Write a Python script using the requests library to fetch the top 10 active markets and normalize this JSON into a clean Pandas DataFrame with columns: [Title, Current_Probability, Volume, Close_Date]."

Step 2: Analysis (VS Code + Copilot)

Once the data is in VS Code, use comments to drive Copilot.

  • Type this comment: # Calculate the daily volatility of the probability column and plot a rolling 7-day average.
  • Hit Tab: Let Copilot generate the Pandas code.

Step 3: Deployment (GitHub)

Don't leave code on your hard drive.

  • Prompt: "Write a README.md file for this project. Explain that it is an arbitrage detector between prediction markets. Include a section on 'Methodology' and 'Tech Stack'."

💡 Project Ideas for Your Portfolio

1. The "News vs. Noise" Detector

  • Concept: Does the market move before the New York Times publishes an article?
  • Tech: Python, NewsAPI (free tier), Polymarket API.
  • Output: A correlation matrix showing the time-lag between price spikes and news headlines.

2. The Calibration Engine (The "Brier Score" App)

  • Concept: Take 100 resolved events. Did things with a 70% probability actually happen 70% of the time?
  • Tech: Scikit-learn (CalibrationCurve), Matplotlib.
  • Business Value: Demonstrates your ability to validate risk models—a huge skill in insurance and finance.

3. The Arbitrage Scanner

  • Concept: Find events listed on both Kalshi and Polymarket (e.g., "Fed Rate Cut"). Alert when the price difference > 5 cents.
  • Tech: Python, Streamlit (for a frontend UI), AWS Lambda (to run the check hourly).

📢 Publishing to LinkedIn

You are a Business Analytics student, not just a coder. Sell the insight, not just the code.

Don't post: "I uploaded a Python script to GitHub."

Do post:

"Do prediction markets react faster than traditional news? I analyzed 500+ political contracts on Polymarket to find out. My data pipeline (built with Python & SQL) found that markets often price in news 2-4 hours before major headlines break. Check out the analysis and the code here: [Link]"

Tags: #BusinessAnalytics #GiesBusiness #DataScience #PredictionMarkets #FinTech


Would you like me to generate the specific Python code for the "Arbitrage Scanner" to get you started on your first repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment