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

Understanding prediction markets #1776

Closed
1 task
sschiessl-bcp opened this issue May 27, 2019 · 10 comments
Closed
1 task

Understanding prediction markets #1776

sschiessl-bcp opened this issue May 27, 2019 · 10 comments
Labels
0 Question Notification that Issue has an open question. Please reference open question within Description

Comments

@sschiessl-bcp
Copy link

sschiessl-bcp commented May 27, 2019

User Story
As a developer I want to understand prediction markets such that I can create UI for it.

Considering the handling on the backend, what is the difference of a prediction market bitasset compared to a normal bitasset?

In particular:

  1. Are there any restrictions depending on resolution date or is this merely informal?
  2. Can push price feed between 0 and 1, or only exactly 0 and 1? Greater than 1? What are the impacts besides the black swan bug Prediction markets can suffer a black swan #460? Any intentional impact of price feed?
  3. The borrowing disregards the price feed and always enforces 1:1?
  4. What happens if I force settle before global settlement (resolution)? Is that even possible?
  5. I assume that resolving a prediction market means forcing a global settlement with a given force settle price (0 or 1)? What is the backend call for that?
  6. Are there any other technical restrictions compared to normal bitasset?

Additional Context (optional)
Tickets for UI are bitshares/bitshares-ui#2717 and bitshares/bitshares-ui#1065

CORE TEAM TASK LIST

  • Answer detail questions on prediction markets
@pmconrad pmconrad added the 0 Question Notification that Issue has an open question. Please reference open question within Description label May 27, 2019
@nathanielhourt
Copy link
Contributor

  1. I don't think there are any enforced restrictions on settlement date... Do we even record the settlement date prior to settlement? I believe this is entirely informal.

  2. OK, perhaps my recollection of prediction markets is fuzzy... but I would've sworn prediction markets didn't have feeds at all, and that they were blocked. Reading the code, it appears that feeds are allowed in a prediction market, but I believe this to be a bug, and that feeds should not exist on prediction markets. Am I missing something?

  3. Yes, price feed should not impact borrowing. If it does, I believe it's a bug. It is important that the collateral always matches the debt exactly 1:1.

  4. Settling prior to global settlement is not allowed.

  5. Looking at the existing code, I think it's just a normal global settlement... but there's no restriction that the settlement price be exactly 0 or 1. Again, I'd call this a bug.

  6. In light of the above, it seems to me that the current implementation of prediction markets is either horribly buggy, or too poorly understood to use or support. We should draw up a formal spec detailing how prediction markets are intended to work, what restrictions there are on them, and then fix up the implementation. It might not be a bad idea to put in a soft fork blocking them until then.

@sschiessl-bcp
Copy link
Author

  1. I don't think there are any enforced restrictions on settlement date... Do we even record the settlement date prior to settlement? I believe this is entirely informal.
  2. OK, perhaps my recollection of prediction markets is fuzzy... but I would've sworn prediction markets didn't have feeds at all, and that they were blocked. Reading the code, it appears that feeds are allowed in a prediction market, but I believe this to be a bug, and that feeds should not exist on prediction markets. Am I missing something?
  3. Yes, price feed should not impact borrowing. If it does, I believe it's a bug. It is important that the collateral always matches the debt exactly 1:1.
  4. Settling prior to global settlement is not allowed.
  5. Looking at the existing code, I think it's just a normal global settlement... but there's no restriction that the settlement price be exactly 0 or 1. Again, I'd call this a bug.
  6. In light of the above, it seems to me that the current implementation of prediction markets is either horribly buggy, or too poorly understood to use or support. We should draw up a formal spec detailing how prediction markets are intended to work, what restrictions there are on them, and then fix up the implementation. It might not be a bad idea to put in a soft fork blocking them until then.

The issues you mentioned have existed all the time so I don't see a reason to block them unless they can break the chain. We will be creating basic UI for it that will only allow to set the parameters in a feasible way, and certainly proper restrictions are necessary in the backend but I don't think we should postpone it due to that.

After all, you are at the complete mercy of the prediction market creator anyways.

@pmconrad
Copy link
Contributor

Are there any restrictions depending on resolution date or is this merely informal?

A PM can be settled at any time.

Can push price feed between 0 and 1, or only exactly 0 and 1? Greater than 1? What are the impacts besides the black swan bug #460? Any intentional impact of price feed?

The feed price should always be ignored for a PM.
According to #460 that is not the case, meaning that a feed price can trigger global settlement at 1:1.

Reading the code, it appears that feeds are allowed in a prediction market, but I believe this to be a bug, and that feeds should not exist on prediction markets. Am I missing something?

Feeds could be useful to control the core exchange rate, for example.

The borrowing disregards the price feed and always enforces 1:1?

Yes.

What happens if I force settle before global settlement (resolution)? Is that even possible?

Not possible.

assume that resolving a prediction market means forcing a global settlement with a given force settle price (0 or 1)? What is the backend call for that?

asset_global_settle_operation - I think the price must be in the range 0..1, not just either 0 or 1.

Are there any other technical restrictions compared to normal bitasset?

A PM must have the same precision as the underlying asset.
A PM must have the global_settle permission set.
You can't bid_collateral on a PM after GS.

@abitmore
Copy link
Member

abitmore commented May 27, 2019

As mentioned in #460 (comment), I think price feeds can be used to globally settle PMs in a decentralized way, the logic would be totally different than the current.

asset_global_settle_operation - I think the price must be in the range 0..1, not just either 0 or 1.

Why not 0 or 1?

By the way, settling at 0 means the market fees collected by the asset issuer/creator and shared to referral program worth zero. That's not a good business.

Can discuss protocol changes here: bitshares/bsips#42

@sschiessl-bcp
Copy link
Author

Good point on market fee and settling to 0. Do you have an idea how asset owner can profit from market fee either case or make offering a prediction market profitable (seeing as he would be the neutral house of sorts)?

@abitmore
Copy link
Member

I had an idea about setting a base price, e.g. borrow with 101% collateral but not 100%, then the 1% goes to the house; when trading, the buyer pays more collateral to pay house fees.

In short, charge fees in collateral asset.

@abitmore
Copy link
Member

I'd recommend that we discuss new features in bitshares/bsips#42.

@pmconrad
Copy link
Contributor

Why not 0 or 1?

The correct question would be "Why not something in between?" :-)

(AFAIK the idea is that e. g. in case of a poll the PM would pay out in relation to the poll result. In theory, as the poll date approaches the price of the asset will approximate the poll result, i. e. the market will predict the outcome of the poll. Hence the name.)

By the way, settling at 0 means the market fees collected by the asset issuer/creator and shared to referral program worth zero. That's not a good business.

Yes, that's a drawback. Mitigated by

  • The issuer can withdraw and sell tokens from the pool while the market is still operative.
  • Generally, a business will create many PMs, and should over time receive 50% of the nominal value of the fees.

@abitmore
Copy link
Member

(AFAIK the idea is that e. g. in case of a poll the PM would pay out in relation to the poll result. In theory, as the poll date approaches the price of the asset will approximate the poll result, i. e. the market will predict the outcome of the poll. Hence the name.)

Settling at a price between 0 and 1 means it's no longer a "binary" prediction market. The scenario you described does exist though, but I guess it's less common.

@sschiessl-bcp
Copy link
Author

Thanks for the insight, collect enough information to continue building for UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Question Notification that Issue has an open question. Please reference open question within Description
Projects
None yet
Development

No branches or pull requests

4 participants