DTJ v/s AOC v/s JD v/s GN

Post thumbnail is a caricatured photo of AOC and JD created using xAI. 

So, it was back around September of 2024, when I got totally hooked on tracking the Polymarket for the U.S. presidential election. Of course, that was because I was rooting for my second favorite orange man, Donald John Trump (first place is a tie between Goku and Durga Prasai, in case you’re wondering). Fast forward to late December, and I decided to check my Chrome history – turns out I had visited that Polymarket site over 1,800 times (1,863 to be exact) between early September and November 5, 2024. And no, I don’t want to do the math and divide 1863 by 60 days to figure out how many times a day that is – let’s just say it’s probably an unhealthy number, even unhealthier than my BMI. I was obsessed with how Trump and Harris were neck-and-neck in the betting odds, with billions of dollars at stake in the market. I had no money on the line, but man, watching Trump win felt so satisfying. As for the year 2024 – it was a bit of a “thumbs down” year for me personally in all other parts, a year of losses… except for that one big Polymarket win for my favorite orange man. 

During those two months of obsessively tracking the betting odds, I was all into the math behind the Automated Market Maker (AMM) model used by Polymarket. I was particularly interested in things like how the initial betting pool size works, the odds slippage as new bets come in, and what kind of market needs which type of betting model. 

But before we go any further, a quick disclaimer. Gambling is illegal in Nepal under Section 125 of the Penal Code, under Chapter-5 Offences against Public Interest, Health, Safety, Convenience and Morals – with some pretty hefty penalties and even imprisonment. But hey, what’s the harm in learning the math behind it, or even running a simulation that involves nothing to lose but virtual points? I mean, that’s not really gambling, right? Learning the maths behind gamblig certainly doesn’t meet the definition of gambling under the explanation provided under the same section of the Penal Code. Now, even though gambling is a no-go in Nepal, let’s dive into exploring the mathematics of betting odds. After all, this falls under Game Theory and Mathematical Economics, and we are just documenting the learnings on betting odds here, not breaking any laws !

Let's set an example:

Okay, let’s break down the betting for the big 2028 U.S. presidential election, with a hypothetical example. In my simulation for the 2028 U.S. presidential election, the heavyweights are James David Vance and Donald Trump Jr. on the Republican side, and Alexandria Ocasio-Cortez and Gavin Newsom for the Democrats – all fighting to be president elect. 

Here’s the initial market maker setup by person A, B, C and D:
1.
A places 450 shares on DTJ (Donald Trump Jr.)
2. B places 500 shares on AOC (Alexandria Ocasio-Cortez)
3. C places 520 shares on JD (James David Vance)
4. D places 430 shares on GN (Gavin Newsom)

Then the action heats up:
1.
In the 1st bet, E wagers 50 shares on AOC
2. In the 2nd bet, F bets 111 shares on DTJ
3. In the 3rd bet, G bets 40 shares on JD

Now, we’ll use the CPMM (Constant Product Market Maker) model to calculate the odds and the payoff for each person if DTJ wins. The CPMM model keeps the product of the shares in each candidate’s pool constant. So, each new bet affects the price or odds for that candidate.

Step 0: Constructing Tables

Alright, here’s how we’ll structure this exercise: we need to create two separate tables – the Wager Table and the Payoff Table

Wager Table: This table will have six columns: (i) Bettor, (ii) Bet, (iii) Wager, (iv) Resolved, (v) Payoff Rate and (vi) Payoff
In the Wager Table, the Resolved and Payoff Rate columns will be filled by looking up values from the Payoff Table. To calculate the Payoff, we’ll use the formula:
Payoff = (Wager * Resolved * Payoff Rate) – Wager
Basically, the Payoff is the return on the bet minus the initial investment. 

Payoff Table: This table will have five columns: (i) Bet, (ii) Wager, (iii) Payoff Rate, (iv) Resolved and (v) Win Probability
The Bet column will list all the outcomes that need to be resolved. The Wager column will pull in the amounts invested on each bet from the Wager Table. The Payoff Rate for each bet will be the amount wagered on that bet divided by the total wager amount. The Resolved column will show the result of the bet (either 1 for a win or 0 for a loss), and the Win Probability will be the reciprocal of the payoff rate (meaning it’s 1 / payoff rate).

This setup lets us track all the wagers, calculate the payoff for each one, and understand the probability of each bet winning.

Step 1: Analysis of the transactions

Alright, so we can break our transactions down into four main types: Market Maker Bet (B0), First Bet (B1), Second Bet (B2) and Third Bet (B3). We’ll go over each of these transactions and handle them one by one below. 

Step 2: Post the Market Maker Bet (B0)

So, four people—A, B, C, and D—stepped in as the market makers, putting down investments of 450, 500, 520, and 430 CU on DTJ, AOC, JD, and GN, respectively. Once we plug in the numbers, the Wager Table and Payoff Table will look something like this:

In betting arrangement, the market maker bet or the initial bet is very significant. For large platforms like Polymarket, typically there are a few ways the initial pool values or the initial bet are set: 
Market Creator: The person/entity creating the market provides the initial liquidity. They choose the initial probability distribution (like our example of AOC 30%, Vance 35%, Trump 35%). They must deposit real funds to back these initial values. They’re incentivized to set reasonable starting probabilities to attract traders. 
Bootstrapping Phase: Some platforms have an initial period where multiple liquidity providers can contribute. This helps establish a more market-driven initial price. Reduces the burden on a single market creator. 
Professional Market Makers: Some prediction markets have partnerships with professional market makers. These firms provide deep initial liquidity. They often use sophisticated models to set initial probabilities. 

The choice of initial values is strategic because:
1. Too little initial liquidity = high price slippage (big price moves from small trades)
2. Too much initial liquidity = capital inefficient
3. Poor initial probabilities = quick arbitrage trades that could cause losses

The market creator typically earns fees from trades, so they’re incentivized to:
1. Set realistic initial probabilities to encourage trading
2. Provide enough liquidity to enable reasonable trading sizes
3. Maintain the market until resolution

Step 3: Repeat step 2 for subsequent new bets (B1, B2 and B3)

First Bet B1

So, after the market makers have placed their initial bets, we move on to the First Bet (B1). Let’s say, for example, E places a bet of 50 shares on AOC. We’ll update the Wager Table with E’s bet. The Payoff Table will reflect the updated wager and the corresponding changes in the Payoff Rate and Win Probability.

Second Bet B2

Next up, we have the Second Bet (B2). This time, F places a bet of 111 shares on DTJ. We update the Wager Table again with F’s bet. The Payoff Table will be updated, adjusting the Wager column, recalculating the Payoff Rate, and modifying the Win Probability. 

Third Bet B3

Finally, we have the Third Bet (B3), where G places a bet of 40 shares on JD. We again update the Wager Table with G’s bet. The Payoff Table will be adjusted accordingly, factoring in the new wager and recalculating the Payoff Rate and Win Probability. 

Step 4: Resolve the bet and calculate the payoffs

Now we will populate the resolve column in the payoff table with the actual result. At this stage, we finally resolve the outcome of the bets. This is where the rubber meets the road ! Based on the actual results, we’ll mark the Resolved column in both the Wager Table and Payoff Table.

If a bet wins, we set the Resolved value to 1. If it loses, we set it to 0.
The Resolved column directly impacts the Payoff Rate, which is tied to the Wager and Win Probability in the Payoff Table. For example, if DTJ wins, everyone who bet on him will have a “1” in their Resolved column, while those who bet on other candidates will have a “0”. 

Now that the bets have been resolved, it’s time to calculate the Payoffs for each bettor. We use the same formula as before to calculate how much each bettor gains or loses: Payoff = (Wager * Resolved * Payoff Rate) – Wager

If the bettor’s Resolved status is 1 (meaning they won), their payoff will be positive. If it’s 0 (they lost), the payoff will be negative or zero. The total payoff for each person is calculated, reflecting their gain or loss based on the betting odds and the resolved outcome. Once the Payoff column is populated in the Wager Table, we can summarize how much everyone won or lost in USD (or whatever the currency is). 

Some notes

In case, if you want the spreadsheet of these tableshere is the link. There are many platforms like Polymarket, Kalshi for analyzing betting odds. Some of them are even decentralized (one that operates on blockchain technology – where the blockchain technology is used for wagering transactions and even sometimes for resolving the bet. It allows users to speculate on the outcome of various real-world events, such as political elections, sports outcomes, economic trends, or cultural phenomena, by trading on the probability of those events occurring. 

In our example above we have used Constant Product Market Maker (CPMM) model – one of the many popular automated market maker (AMM) models. CPMM Model is the mostly used one that allows for infinite liquidity but has a lot of slippage on the subsequent wagers. When dealing with odds on highly stable assets more improved versions like Stretched Constant Product Market Maker (SCPMM) are used. But having said that CPMM model is the most popular model  or general purpose trading. 

So, in conclusion, What is this waste of a blog post and time? Why am I even writing this? Who needs this? Was this really necessary, or am I just out here wasting my time and yours?