Hello everyone!

I would like to share a Fedimint module I have been working on over the last few weeks. For anyone unfamiliar with fedimint learn here.
The prediction market I have implemented allows for events to be represented as any number of outcomes. A user can create a new market, and give out the market id to whoever they want to have access. Then users can make bets on the market on which outcomes they believe to be mispriced. After the event occurs, the owner of the outcome control key of the market can declare a payout, which distributes the market's holdings to users based on their bets.

How it works

A market has a contract price and a number of outcomes. Each outcome has its own order book of buys and sells.
In order for a new contract to be created, buy's prices from all outcomes must add up to the contract price. When this happens, contracts of each buy's outcome are handed out to the buys.
For a contract to be destroyed, sell's prices from all outcomes must add up to the contract price.
Contracts of each outcome can also be swapped locally in each outcomes order book. (New orders will always pick the best price between creating/destroying vs swapping.
A payout occurs after the outcome has been declared by the outcome control key of the market. The payout distributes the contract price amongst the contracts of each outcome.
It is still very alpha so not ready for real sats!
Thanks for looking!!!
Very cool! This is something we've been talking about on here for a while.
The only prediction market in the Bitcoin space I'm aware of right now is over at FreeBitcoin, but users can't create events and currently it's limited to sports and spot prices.
reply
Beautiful work...
reply