making a prediction market (for IPL betting)
Things I learned while building a prediction market for IPL betting. Logarithmic Market Scoring Rule, ELO ratings, and more.
I am making a prediction market for IPL betting, which I'm calling gamBET (like gambit & bet, not gambling & betting -- though I guess that works too). It's a fun project I've been working on after watching Why Betting Markets Beat The Experts by Art of the Problem. In this post, I'll share some things I learned while building it.
what is a prediction market?
A prediction market is a market where participants trade on the outcome of events. The price of a share represents the probability of the event occurring. If the price is ₹0.75, the market believes there is a 75% chance of the event occurring. If the event occurs, the share is redeemed for ₹1; otherwise it is redeemed for ₹0.
why betting markets beat the experts
collective intelligence
Prediction markets leverage the wisdom of crowds -- the phenomenon where collective judgment of a diverse group often proves more accurate than individual expert opinions. This works because:
- Different participants bring unique perspectives and information
- Averaging across many independent estimates tends to cancel out individual errors
- People with more confidence in their knowledge tend to bet more, naturally weighting the market
This connects to the Law of Large Numbers: as more people participate, the market price converges toward the true probability of an event.
A few examples where prediction markets have outperformed experts:
The 1916 US Election: The New York Times declared Hughes the winner, but the betting markets favored Wilson, who ultimately won.
The 2024 US Election: When CNN and Fox were calling it "too close to call", Polymarket was already declaring a winner. As the graph below shows, Polymarket was predicting Trump more than a month before polling day.

how algorithms work in prediction markets
Traditional bookmaking relied on experienced oddsmakers who manually set initial odds, adjusted prices as bets came in, and balanced their books to ensure profit. Nowadays, automated market-making algorithms like LMSR dynamically adjust prices based on trades.
logarithmic market scoring rule (LMSR)
Introduced by Robin Hanson in his 2002 paper "Logarithmic Market Scoring Rules for Modular Combinatorial Information Aggregation", LMSR ensures prices adjust dynamically based on trades, maintaining liquidity while keeping the market efficient.
Here's how it works:
- The cost function ensures that buying more shares increases the price non-linearly.
- Traders buy shares in different outcomes, moving prices based on demand.
- The pricing function is: where is the quantity of shares in each outcome and is a scaling factor that determines market liquidity.
A big reason to choose LMSR: it guarantees the market is always liquid, which matters when you don't expect a lot of trading volume and don't want to maintain an order book.
To illustrate:
- For a match between Mumbai Indians and Chennai Super Kings
- Initial probabilities: 60% for Mumbai, 40% for Chennai
- If someone buys 100 shares of Chennai winning, the price might adjust to 45% for Chennai and 55% for Mumbai
- The more shares purchased, the more expensive subsequent shares become -- a natural balancing mechanism
ELO ratings for IPL teams
To provide a starting probability for IPL matches, I'm using ELO ratings -- a system used in chess and esports where each team has a rating that changes based on match results.
The update formula:
where:
- is the new rating
- is the current rating
- is a constant determining sensitivity to changes
- is the actual result (1 for a win, 0 for a loss, 0.5 for a draw)
- is the expected probability of winning
calculating expected win probability
If Mumbai Indians has an ELO rating of 1600 and Chennai Super Kings has 1500:
Mumbai gets a 64% starting probability. The LMSR mechanism takes over from there, letting the market adjust as trades come in.
gamBET sneak peek
