Hi! I would like to share my totally non-commercial personal web project that I happily built in Haskell using the IHP web framework.
predimarkt.eu is a play-money educational prediction markets app. Yeah, I know - no real money, no real profits. But also no real massive losses… So, if you are just curious playful person, who love experiencing new things, and want to learn what prediction markets are and check how they work with no risk - come and try it!
It’s also very much privacy friendly - only passkey logins, no emails, no real names - I just don’t want your personal info. This is totally non-commercial personal educational project - no marketing, no analytics, no user profiling, nothing. Just a place for a friendly community to have fun and forecast events that are interesting for them.
Let’s play together! Crowd knowledge needs crowd!
Code it available on Github if anyone is interested (https://github.com/avitkauskas/predimarkt). I would not take it for a learning material - I was learning Haskell and IHP on the run - but it was a very pleasant journey!
This is neat. Haskell must be a great language to write in for this sort of thing!
Prediction markets are so curious. I ought to read through the source of this project sometime to understand them better, and I especially need to understand the legal side of the big ones like Polymarket or Kalshi. I guess it’s all a hyper-optimized & real-time market of futures contracts? It’d be interesting to see how their implementation differs from a play-money implementation, and how the legality of it all influences the software …
IHP web framework was more important and helpful for me in this project than Haskell itself, as it allowed to be very pragmatic and gloss over all the difficulties the newcomers to Haskell usually face.
As for the prediction markets themselves, you can find a lot of info online how they work. This project specifically uses the Robin Hanson Logarithmic Market Scoring Rules (LMSR) for the automatic trading and always available liquidity - essential for the small play-money implementation. Concerning the real money prediction markets - there is a lot of controversy in it and their legality is still not fully solved even if they exist for more than 20 years already. Insider trading is the biggest concern, I would say - it’s too easy to manipulate markets when you can influence the event itself. And crypto involvement does not help with that either. That’s why play-money markets have their value too - they have too little incentives to be manipulated (no real monetary gain), but are good means to express your believes about the future events and help to elicit the common believes of many people very well.
Effect on probabilities is the same, but the way you think about it and the cashflow for you is different. This is a play money market, so we do not reserve money in your account when you short sell (that is when you sell the asset that you do not own yet) but we pay the money to you immediately when you sell. And, if the event did not happen in the end (so you were right selling it) then you keep the money you’ve got. But it you were wrong, and the event did happen, then you’ll have to buy all the shares you owe (the number of shares you short sold) for the price of 1.00 each, that is you’ll then pay more than you initially received. Short selling is a bit confusing subject
Passkey thingy is timing out, can’t register.
UPD: it worked after some funking around. Impressive how brittle is this piece that’s designed to alleviate the password hassles.
Yes, indeed, passkeys can feel a bit finicky, but when they work it becomes easy. I just did not want to store the users emails and be responsible for them in GDPR context, that’s why passkeys only.
Concerning the Haskell-specific markets - please feel free to abuse the system and create whatever you like - provided that you get other interested people online! - that’s the main hurdle. Actually, I got much more views and interest from Haskell people about the platform that from anywhere else
Someone proposed me to experiment with the AI trading agents on the platform. Overall, it makes much sense these days - play-money prediction markets for AI agents to elicit the probabilities of events!