blockchainprojects / bitshares-ui

Graphical User Interface for BitShares Blockchain
https://wallet.bitshares.org
MIT License
0 stars 1 forks source link

[34] #2717 Spotlight: Prediction Market #120

Closed sschiessl-bcp closed 5 years ago

sschiessl-bcp commented 5 years ago

https://github.com/bitshares/bitshares-ui/issues/2717

First task: Implement basic frontend and needed modals

Metizik commented 5 years ago

@sschiessl-bcp , I am now almost done with UI part and modals. I explored assets tab with prediction markets and have a few questions about how to fit requested UI for table with existing data model. Especially I don't understand how to get prediction to display from asset info, and also - what is the correct way to fetch opinions for specific prediction market?

sschiessl-bcp commented 5 years ago

There is a PR that adds asset action for settling https://github.com/bitshares/bitshares-ui/pull/2752 that might contain interesting information for you.

Essentially, the information is not a separate field but baked into the asset description:

let description = assetUtils.parseDescription(
    asset.options.description
);
let prediction = description.condition;
let expiration = description.expiry;

An opinion is merely a buy or sell order in the market PREDICTIONASSET/COLLATERAL.

Take for example https://develop.bitshares.org/#/asset/TRUMPIMPEACH. It's collateral is BTS. The prediction is Trump does not last first term, or in easier to grasp wording: Trump will be impeached. Now the opinions are

Metizik commented 5 years ago

@sschiessl-bcp , I have a few questions regarding implementation of required logic: 1) What kind of assets should be used as backing asset, is it only BTS, USD and CNY, as specified in ticket or all "user issued assets", or only those, which user do have balance of?

2) What does "participation fee" stands for? Now there is a disabled empty input, which I believe can be used to display a fee of market creation operation, but in existing UI for market creation there are three fields, which are used to setup fee: Market fee, Max market fee, reward percent.

3) We suppose, that in a case of "Yes" opinion user have to borrow prediction market assets and in a case of "No" opinion user have to borrow backing asset, if it isn't on the balance. And all these manipulations should be carried out under the hood, along with the creation of buy/sell order. Are we right?

4) We suppose, that it should be impossible to set the price, when adding opinion although there is such possibility when creating buy/sell order in UI wallet. In case of prediction markets, the price will always be equal to 1, until market is resolved. Ones it becomes resolved, price is set to 0 or 1 depending on how the event ended. Is this correct?

sschiessl-bcp commented 5 years ago
  1. BTS, USD, EUR and CNY to start with. User balance does not matter at the time of asset creation

  2. This refers to the market fee on asset creation. I will fill in for the rest, use dummy value for now.

  3. Agree: put buy order. Disagree: borrow and put sell order.

  4. Please add a probability column in the bottom table, which reflects the price. Add a Probability input (Price input) in the Add opinion modal as well. Price can be between 0 and 1.