In a standard bet like this (with 2 outcomes (Y and N)), the participants each put in amounts totaling 1ETH, and a "yes share" and "no share" are created for the betting participants. When the outcome has been established the winning share becomes redeemable for 1ETH.
But how do the parties agree on what % of the ETH each should pay if the bet is not 50/50 odds? Order books can be created with Y Bids and N Bids (only bids because no one has any to sell). Whenever the highest bids from each order book add to >= 1, a "match" is made and the contract mints shares to accommodate them. Its kindof cool, and slightly different from standard order books.
A market with 2 outcomes (Y and N) would have 4 order books
Y bid | Y ask |
---|---|
.70 | .75* |
.69 | .76 |
.65 | |
.63 | |
----------------- |
===================
N bid | N ask |
---|---|
.24 | .25* |
.23 | .31 |
.22 | .32 |
------ | -------- |
- When a new order would fulfill the condition:
yBid + nBid becomes >= 1
, a share is created (thus loweringyBid + nBid
back to < 1) - When a new order would fulfill the condition:
yAsk + nAsk <= 1
, a share is destroyed (thus increasingyAsk + nAsk
back to > 1 ; note in order to create ayAsk
ornAsk
one must have a share to sell. This is the one which gets destroyed) - Therefore the inequalities always hold true:
yBid + nBid > 1
andyAsk + nAsk > 1