Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prediction Markets on SN #309

Open
ekzyis opened this issue Jun 10, 2023 · 7 comments
Open

Prediction Markets on SN #309

ekzyis opened this issue Jun 10, 2023 · 7 comments
Labels
backburner postpone consideration of ticket feature new product features that weren't there before needs specification

Comments

@ekzyis
Copy link
Member

ekzyis commented Jun 10, 2023

A month ago, I created a draft PR for a NIP for prediction markets on nostr and posted about it on SN.

Then, I thought about reusing the code for polls on SN for simple prediction markets on SN and mentioned it in our internal slack as an idea. @huumn approved the idea and gave me green light to create a ticket. I said I would just go and create a draft PR to allow a more concrete discussion. However, so far I didn't.

Exactly this was mentioned today here with sport bets as the use case (see parent of comment).

Since I didn't create a draft PR yet but I would love to see some more discussion and feedback from stackers on this, I am creating this ticket now.

So basically, I imagine this to be a new post type. It could be similar to the existing polls but people "stake sats" on a specific answer or multiple answers. So basically like this except it would also show how many sats have been staked on each answer and thus the probability of every answer being true:

2023-06-09-232817_624x303_scrot
-- https://stacker.news/items/181715

However, I have distinguished two models for prediction markets:

  1. "Betting markets": users can only place bets (and additional bets) but not withdraw their bets until the prediction market expired
    (not sure if this even counts as a prediction market)
  2. "Contract markets": users can buy and sell contracts which expire at (for example) 1 ("winning" contract) or 0 sat ("losing" contract). The prices of the contract are based on the current probabilities of the outcome (according to the prediction market).
    (Since SN uses millisats internally, contracts could cost 800 millisats if they have a chance of 80% to win. The expiration price depends on the desired "precision" of the prediction market.)

1. Prediction market using bets

The button to vote on an answer would open a dialog so the user can enter the amount of sats they want to bet on this answer. Also, users are able to place multiple bets over time and even on different answers since being able to see what the market currently thinks is the most probable outcome is an (or even the most) important feature of prediction markets. For example, if new information is available, every user can place new bets to reflect the new available information in the prediction market.

After the event has happened, the outcome is decided and the users which picked the correct answer win the sats of every other losing user depending on the amount they have bet.

Example of distribution of sats after event occurred:

User A has bet 100 sats on the winning outcome A. 1000 sats have been staked in total on outcome A. 250 sats were staked on the other outcome B. Therefore, in total, 1250 sats have been staked across all outcomes. User A receives his initial 100 sats back and wins 100/1000 * 250 = 25 sats.

If user A has bet 100 sats on outcome B (such that there are 250 sats staked in total on outcome B) and outcome B occurs, user A would win 100/250 * 1000 = 400 sats.

We can say that according to the prediction market, the probability of outcome A happening was 1000/(1000+250) = 0.8 (= 80%) and of outcome B was 250/(1000+250) = 0.2 (= 20%).


2. Prediction market using contracts

A more sophisticated model for a prediction market is based on contracts which allows selling of contracts (in contrast to the model above where one can only place additional bets but never take back bets).

In this model, users would be able to buy contract which will expire at 1 or 0 sat per contract. The price of the contracts would be based on the current probability (see calculation above). So for example, if according to the prediction market, a contract has the chance of 80% to "win", the contract will cost 80% of the expiration price.

Essentially, the difference in this model is that the prediction market can more easily reflect what all participants think since users can also sell contracts if they own some and think the current probability is too high.

Example of distribution of sats after event occured:

User A holds 100 contracts of outcome A. The expiration price of each contract is 1 sat. Outcome A occurs and they receive 100 sats. Assuming they bought their contracts at the very beginning (where every contract has the same probability) and there are only two outcomes, they would have made a profit of 50 sats since they bought their contracts for 0.5 sats each.


What is not so clear however: Who is going to be the oracle which decides on the outcome of events?

Prediction markets must have a definite outcome after a specific date.

Examples:

Event Outcomes Expiration date
Which team will win the match on <date>? Team A, Team B <date>
Will Twitter go bankrupt in 2023? Yes, No 2023-12-31 or earlier
How many noodles are in the bowl I am eating? including link to live stream of me eating noodles <0-10>, <11-20>, <21-30>, <...> after I have eaten my bowl of noodles and counted them
Will SN reach a new ATH of users next month? Yes, No End of next month

Even though most prediction markets are easily determined (or at least should be), someone still has to be the oracle.

I see following options for this:

  1. creator of the prediction market
  2. SN team

If prediction market creators play oracle:

  • a random user could lock sats by never specifying the outcome. In this case, SN would have to step in anyway
  • they could pick the wrong outcome because they colluded with other users or because they themselves participated in the market (under the same nym or different nym)
  • if creators aren't allowed to participate [and only "trusted" users are allowed to participate to protect against sybil attacks], the users who are the most interested to participate in specific prediction markets and thus would come up with such prediction markets would not create them since then, they couldn't participate.

If SN plays oracle:

  • SN team could become a bottleneck: depending on the amount of prediction markets (and the amount of effort required to know the "true" outcome of an event), this would put too much of a burden on them
  • SN team may want to participate in prediction markets, too, leading to a conflict of interest

Since both options have drawbacks, I think there should be some incentive to play oracle. This incentive could be a small fee taken from the winning users. Maybe this would solve the conflict of interests since users who are interested to participate in specific prediction markets (and thus want to create them) would give up being able to participate for the chance to gain fees only for specifying the outcome.

Reading over all of this, maybe I am overestimating this risk of malicious oracles. But this risk depends on the amount at stake so maybe I am also not and thus the only reasonable choice is to put trust in SN which have the most reputation to lose?


For the people who don't know what prediction markets are yet: Prediction markets: can betting be good for the world?


Reference:

@ekzyis ekzyis added the feature new product features that weren't there before label Jun 10, 2023
@ekzyis
Copy link
Member Author

ekzyis commented Jun 10, 2023

Link to discussion on SN: https://stacker.news/items/190757

@ekzyis
Copy link
Member Author

ekzyis commented Jun 10, 2023

Other questions:

  • How much should such a post cost?
  • Could the oracle consist of multiple users?
    For example, every participant becomes also an oracle. Every participant has to pick the outcome after a specific date (this would make it impossible to have events with a "dynamic date") and only the participants which picked the outcome which the most other users also picked actually receive their sats. According to my game theory skills (which aren't that great), this could work out.

@UndisciplinedSN
Copy link

You're right to start thinking about malicious actors, but at this stage of the site I doubt it would be an immediate issue. It seems similar to being concerned about creators of bounties not paying them out when someone did complete the bounty.

However, the scheme you describe for letting the participants act as oracles doesn't work. The incentive is for the losing side to vote for themselves, just in case there were more of them. For something like that to work, the losers would have to win something that they only get if their stated outcome matches the plurality. There would also have to be a second date when outcomes have to be posted by, to avoid the frozen sats issue.

I think having the creator act as oracle is the right place to start and operate on a "buyer beware" standard. Let reputation and personal risk tolerance regulate the situation. I would create lots of these, because I generally only wager when I have a strong feeling about the outcome. It also seems like there's less liability to the site, if it's super explicit that these are strictly p2p interactions.

@ekzyis
Copy link
Member Author

ekzyis commented Jun 10, 2023

You're right to start thinking about malicious actors, but at this stage of the site I doubt it would be an immediate issue. It seems similar to being concerned about creators of bounties not paying them out when someone did complete the bounty.

Yes, I agree. I think I'm thinking "too far ahead". We'll know more when we've deployed the first iteration and got more feedback from users and see how the feature is used.

However, I want to mention that compared to bounties, the sats of the participants are at stake here unlike with bounties.

However, the scheme you describe for letting the participants act as oracles doesn't work. The incentive is for the losing side to vote for themselves, just in case there were more of them. For something like that to work, the losers would have to win something that they only get if their stated outcome matches the plurality.

Ah right, I forgot that losers have nothing to lose. Maybe a penalty could work? Like a bond?

There would also have to be a second date when outcomes have to be posted by, to avoid the frozen sats issue.

You are right

I think having the creator act as oracle is the right place to start and operate on a "buyer beware" standard. Let reputation and personal risk tolerance regulate the situation. I would create lots of these, because I generally only wager when I have a strong feeling about the outcome. It also seems like there's less liability to the site, if it's super explicit that these are strictly p2p interactions.

Yes, I agree. I guess with some background in cybersecurity, I tend to think of everyone being malicious and trying to abuse everything all the time even though most users are probably completely oblivious to any exploitable systems, lol

What do you think about the incentive to play oracle?

@UndisciplinedSN
Copy link

What do you think about the incentive to play oracle?

My initial instinct would be to tie it into the payout system that already exists. Polls charge 1 sat to answer and those sats go somewhere. I'm not up on the details, but I think posts that generate more sats get a larger share of the daily payout. Is the assumption that those rewards are too small to provide a sufficient incentive? If so, you could split those sats with creators of this post type at a higher rate or charge more than 1 sat to make your prediction.

@ekzyis
Copy link
Member Author

ekzyis commented Jun 12, 2023

My initial instinct would be to tie it into the payout system that already exists. Polls charge 1 sat to answer and those sats go somewhere. I'm not up on the details, but I think posts that generate more sats get a larger share of the daily payout.

Ah, good point and yes, that's right. You receive rewards for top posts, top comments and tipping good content early.

Is the assumption that those rewards are too small to provide a sufficient incentive? If so, you could split those sats with creators of this post type at a higher rate or charge more than 1 sat to make your prediction.

No, I just wasn't thinking about this daily reward yet.

Other question: What do you think about the two prediction market models?

@UndisciplinedSN
Copy link

Conceptually, I love the contracts model, because it allows for something like in-game wagering. However, it seems like it would be much more difficult to implement and would need a much larger user base than sn currently has in order for its benefits to really manifest. The betting model also seems much easier to understand for users.

One aspect of the betting model I've been wondering about is whether you want to reveal the current pools or not. Initially, I had the same idea as you of letting people see the current odds. However, since these odds change as more bets come in, there would be an incentive for everyone to delay placing their bets until as much information as come in as possible. If the current pools were not shown, then people would simply be betting on what they expect to happen, while maybe incorporating their own expectations about what other people are doing. This actually strikes me as a more natural way of allowing odds to naturally develop and it doesn't penalize early movers.

@huumn huumn added backburner postpone consideration of ticket needs specification labels Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backburner postpone consideration of ticket feature new product features that weren't there before needs specification
Projects
None yet
Development

No branches or pull requests

3 participants