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 can suffer a black swan #460

Closed
2 tasks
pmconrad opened this issue Nov 4, 2017 · 11 comments
Closed
2 tasks

Prediction markets can suffer a black swan #460

pmconrad opened this issue Nov 4, 2017 · 11 comments

Comments

@pmconrad
Copy link
Contributor

pmconrad commented Nov 4, 2017

@abitmore noticed that when a price feed for a prediction market is published, the usual black swan conditions are checked. The black swan checks disregard the is_prediction_market flag, and if the conditions are met, global settlement is triggered for the prediction market.

This behaviour does not make sense:

  • PM tokens are always backed by the same number of backing tokens. A PM will be settled in the range [0,1], which means there is always sufficient collateral available.
  • The actual feed price and MCR seem to be otherwise unused in a PM, so there is no reason to act upon them.

(This has happened on mainnet and testnet, which caused the recent problems.)

@abitmore
Copy link
Member

abitmore commented Nov 4, 2017

I thought it's a feature, so not only the issuer but also specified feed producers can global settle the PM.

@pmconrad
Copy link
Contributor Author

pmconrad commented Nov 5, 2017

Hm. But the black swan settles at the ratio of the least collateralized short, which is always 1:1 in a PM. So this is a rather limited feature.

@abitmore
Copy link
Member

abitmore commented Nov 5, 2017

Agreed. Since we don't have a specification document, we can only guess. We may need to redesign this feature.

@abitmore
Copy link
Member

abitmore commented Nov 13, 2017

Need a BSIP.

@abitmore
Copy link
Member

After done more investigation, I agree this is a bug. We can fix it by disabling price feeds for prediction markets, don't need a BSIP.

The feature that global settle a prediction market via price feeds is debatable and deserves a BSIP.

By the way, need a better business model for the asset creator. Because the token can worth zero in the end, percentage market fee is not enough. This can be discussed in a BSIP as well.

@abitmore abitmore added this to the Next Consensus Changing Release - 201803 milestone Nov 27, 2017
@abitmore abitmore self-assigned this Feb 8, 2018
@abitmore abitmore modified the milestones: 201803 - Consensus Changing Release, Future Consensus-Changing Release Feb 9, 2018
@abitmore
Copy link
Member

abitmore commented Feb 9, 2018

Sorry for accidentally sent out an unfinished comment.

I decided to postpone this as it's still like a uncompleted feature.

  • When the outcome of a PM is 1, the issuer can global settle with 1, or the price feed producers can feed 1 (which will trigger a black swan event then global settle at 1), the result is same.
  • When the outcome of a PM is 0, the issuer can global settle with 0, but
    • the price feed producers are unable to feed 0 (which is a bit complicated to fix),
    • even if they feed a very small price e.g. 0.0001, the market won't be global settled since a small price won't trigger a black swan event.

The final fix would be:

  • allow and only allow feeding 0 or 1
  • when there are enough feeds, global settle at median feed price.

@abitmore abitmore removed their assignment Feb 9, 2018
@jmjatlanta
Copy link
Contributor

The final fix would be:

* allow and only allow feeding 0 or 1

* when there are enough feeds, global settle at median feed price.

Q1: To feed 0, which you say is not easy, are you speaking of permitting 0 on one side of the equation ( removing validation in price::validate() ) and then cleaning up code to assure no divide by zero problems? Or perhaps you have in mind a way to feed 0 another way?

Q2: For your second bullet point, are you suggesting that having the required number of feeds present in a prediction market should automatically trigger global settlement?

@abitmore
Copy link
Member

@jmjatlanta I think it's better to discuss in bitshares/bsips#42 atm.

A2Q1: IIRC, the former.
A2Q2: something like that, perhaps using a new operation is better.

@pmconrad
Copy link
Contributor Author

pmconrad commented Oct 1, 2019

The final fix would be:

  • allow and only allow feeding 0 or 1
  • when there are enough feeds, global settle at median feed price.

No. bitshares/bsips#42 discusses a protocol change. This ticket here is about a bugfix.
The pricefeed should not load to global settlement on PMs, that's all.

@abitmore
Copy link
Member

Fixed by #2019.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants