Ask HN: What are the algorithms used by predictions markets like Polymarket?

6 points by callmeed a day ago

I am curious how prediction markets like polymarket and kalshi work behind the scenes. I assume it's more like stock options than sports betting.

Is there something like a market maker to help provide liquidity?

Is it setting probabilities/prices using something like black-scholes?

How would you design a very simple prediction market MVP?

big-green-man a day ago

Yes, it's exactly like black-scholes. Pricing them is the exact same math as pricing European options (unless your system is a potential counterparty for existing contracts, that is, unless your system can buy back peoples purchased contracts at the current price, in which case the math is like American options). Probabilities is of course simply a naive calculation of percentage purchased of each side. I'm sure some do something more complex, like a function that includes percentage of each outcome boight and what price they were bought at, I don't know how much more accurate that would be off the top of my head, but I would think it wouldn't change the calculus because price purchased at would give you an indication of certainty, but potential payoff would negate that factor, unless there's a discrepancy due to your premium or you can find behavioral studies saying otherwise.

Some have a market maker, but usually that's not the case. The price is determined by the ratio between the binary options in the market. Ones with multiple potential outcomes can be reduced to binary easily for input into the black-scholes formula. " the algorithm" generally in cases like this are just the game theoretical incentive structure and human behavior does the rest.

MVP, that's a complex question. You've got to pick your stack, mode of payment, design an interface, back end, API, I'd start with just a server side back end to do all the computations and build the API and then integrate it to your payment method whether that's a bitcoin node or whatever, and then build an interface from there. If you're using ethereum or something like that, youre going to need to do it in a trustless sort of way, so that back end thing is going to be smart contracts and the API is going to be contract calls.

JSDevOps a day ago

Why wouldn’t it just be a simple order book? You could easily manipulate it by stacking a bunch of orders just outside the book’s depth, pushing the market in your desired direction. This creates the illusion of ‘smart money’ at play, and with low liquidity, others would quickly follow suit. This strategy would be cheap and surprisingly effective in thinly traded markets.

  • mejutoco 18 hours ago

    I am guessing you would be on the hook for the other side of the bet. Apart from the potential legal implications, that could be expensive.

    • JSDevOps 15 hours ago

      That’s what spread betting is in the uk no?

tripplyons a day ago

Not that sure about Polymarket, but Kalshi uses a limit order book and has incentives for market makers to provide liquidity. The prices are set by what people are willing to buy and sell for, not by an algorithm.

user90131313 a day ago

There are whales and they go beyond liquidity. They can manipulate the definition and how markets settles. Beyond elections, a lot of the stuff are relaying on how market settles.

JSDevOps a day ago

Why wouldn’t it just be a simple order book? You could easily manipulate it by stacking a bunch of orders just outside the book’s depth, pushing the market in your desired direction. This creates the illusion of ‘smart money’ at play, and with low liquidity, others would quickly follow suit. This strategy would be cheap and surprisingly effective in thinly traded markets.