Prediction Market Primer (part 1)

Published: 2022-01-29


I get a lot of emails from people asking about strategy or technical details on the markets. From the questions I get asked, I can see that a lot of people don't have a firm grasp on the fundamentals of the market. Ove the next few weeks, I hope to put together a learning series on the fundamentals of the predictions.



If you're at all interested in creating a successful strategy, it's essential to learn the technical mechanics of the game. You don't need to need to program to grasp whats going on. And if you're willing to run a few lines of python, you can pretty much get everything you need to understand the games on a deeper level.



So lets get into it.

How predictions work?

You can start by going Pancake Swap documentation of the prediction markets, but that is a very high level overview concerning itself more with the UX of PancakeSwap website. It's worth skimming but won't get you very far.



Prediction markets are smart contract hosted on the Binance Smart Chain. The contract can be seen here. You'll see the contract address on your wallet when you try to make a bet on bscpredict or PancakeSwap. The code of the contract can be seen here. It's not a lot of code if you exclude comments, but I won't lie to you and tell you its easy to read.



Essentially it's a contract that lets you bet money whether you think some number will go up or down in 5 minutes time. A this point its useful to define some terminology:



Timestamps

  • Start Timestamp - The time in which a round starts and bets are allowed
  • Lock Timestamp - The time in which a round takes no bets and the reference price is "locked"
  • Close Timestamp - The time in which a round is closed, the close price is saved and compared to the lock price and a winner (bull, bear or draw) is determined

The round goes from Start (taking bets) -> Lock (no more bets) -> Close (winner determined). From start -> lock is 5 minutes (or called interval seconds). Then from lock -> close is 5 minutes from the time the lock price is set. Then there is 30 seconds between close and the start of the next round (called buffer seconds). These are all configurable in the contract and you can see them here



Prices

  • Lock Price - The reference price to determine winner
  • Close Price - The price at close that's compared to the Lock Price



If Close Price < Lock Price, then BEAR wins. If Close Price > Lock Price then BULL wins. If they're exactly equal, then its a draw and the house wins. A draw happens around 0.2% of the time.

Other terms

  • Round Size or Prize Pool - The total amount bet on BULL and BEAR
  • Bull Bet - A bet that the close price will be ABOVE the lock price
  • Bear Bet - A bet that the close price will be BELOW the lock price
  • Bull Payout - The amount a winning BULL bet would yield gross of treasury fee
  • Bear Payout - The amount a winning BEAR bet would yield gross of treasury fee



Calculating payout

Predictions is a zero sum game and payout is determined by the amount people bet on BULL and BEAR minus the treasury fee (3%).



For instance if people bet 5 BNB on both bull and bear, the Bull and Bear payout will both be 2 (round size / direction bet). The payout is gross of (not including) the treasury fee (3%). So the net (actual) payout will be round size * (1 - treasury) / direction bet. So in the case of a round size of 10 and 5 BNB on each side, the net payout will be 1.94 (10 * 0.97 / 5).



Due to the treasury fee, a successful strategy must account for the 3% that goes to treasury, and another 0.2% to account for draws.



NET PAYOUT IS THE MOST IMPORTANT METRIC IN A SUCCESSFUL STRATEGY



People talk about how successful their strategy is in terms of winning percent, but that's misguided. You can win 60% of the time, but if your net payout is 1.5, then you're losing. If you played 10 games at 1 BNB each, you'd win 6 games or 3 BNB but you'd lose 4, resulting in a net loss of 1 BNB per 10 games.



Similarly if you win only 40% of games but the payout is 2.75, you'd be up. 10 games would yield 4 wins (or 7 BNB). Minus 6 losses, you're still up 1 BNB.



How bets affect payout

Because payout is determined by amount bet on each side, betting affects the net payout. You can't just throw down a large bet size and expect the payout to remain unchanged.

Take the example above in which we have a round size of 10, with 5 BNB bet on both BULL and BEAR. If you bet 1 BNB on BULL, you change the round size to 11 and the bull size to 6. So net bull payout will now be

(11 * 0.97) / 6 = 1.778


Before the bet it was 1.94, so the odds have moved considerably. Now you'd have to be 56% certain you'll win the round just to break even (1 / 1.778). If you bet 0.1 instead, the payout would be



(10.1 * 0.97) / 5.1 = 1.92


and you would only have to be 52% certain to break eve (1 / 1.92).



This is what I call betting in a "shallow" pool and is ill-advised. The smart players know this and scale their bets up when the round size is large. Or if they see someone throw down a huge bet and skew the odds, they go the other way.



The question to ask when determining a strategy is "how confident am I on the outcome?". The number alone doesn't matter, but it has to be put in context with what we believe the payout will be. I could be 60% confident, but if the payout is 1.5, it's a bad bet. Perhaps I should even go the other way because even if its unlikely, the payout would be nice.



The problem with this is that we don't know the final payout ahead of time. Most of the bet volume comes in the last few rounds. We can only guess what we think the final payout will be. In some cases we're more certain than others. For instance, if someone throws down 50 BNB BULL size, skewing the BEAR payout to 4, we can be somewhat certain that the BEAR payout will be above 2. But people will see this and jump in just as you are considering to jump in.



THERE'S NO REASON TO BET BEFORE THE VERY LAST SECOND



The longer you wait the more information you have. Even if you're 90% sure of a bet, you'll want to make sure the payout is at least 1.12. You also don't want to tip your hand to other players. The most common strategy is following successful accounts. This move the odds against them (people are piling in) and a successful strategy becomes a losing strategy very quickly.



The best way to avoid that is to wait until the very last second to bet and periodically switch accounts.



I'm gonna leave it there and pick it up next time. Some other things I want to discuss is where the lock and close price come from (the Oracle), how to query that as well as how to query contract data. Until then, bet responsibly!