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

[6][startailcoon] Show more info on asset info page #1119

Closed
abitmore opened this issue Feb 6, 2018 · 32 comments
Closed

[6][startailcoon] Show more info on asset info page #1119

abitmore opened this issue Feb 6, 2018 · 32 comments
Assignees
Labels
[1b] User Story The User Story details a requirement. It may ref a parent Project (Epic). It may ref child Task(s) [3] Feature Classification indicating the addition of novel functionality to the design [6] UX Impact flag identifying the application User Experience [7] Finalized Administartion flag, notifies hours are finalized
Milestone

Comments

@abitmore
Copy link
Member

abitmore commented Feb 6, 2018

It's now calculated as settlement_price / MCR, but should be settlement_price * MSSR / MCR.
Update: see this comment below.
image

@wmbutler wmbutler added the [3] Bug Classification indicating the existing implementation does not match the intention of the design label Feb 6, 2018
@wmbutler wmbutler added this to the 180215 milestone Feb 6, 2018
@wmbutler wmbutler changed the title Global settlement price on asset info page? [.5] Global settlement price on asset info page? Feb 6, 2018
@startailcoon
Copy link
Contributor

I can take this task. I think it's worth adding some more parameters at the same time, like offset percentage, and possibly some more.

@wmbutler wmbutler changed the title [.5] Global settlement price on asset info page? [.5][startailcoon] Global settlement price on asset info page? Feb 6, 2018
@abitmore
Copy link
Member Author

abitmore commented Feb 9, 2018

Actually it's a bit complicated.
The global settlement price is actually correct, but a global settlement (black swan) will trigger at 10% (which is MSSR) above that price.
So what should the UX be?

@abitmore
Copy link
Member Author

abitmore commented Feb 9, 2018

Oh wait, does that "settlement price" include offset? My calculation above didn't count in the offset. I mean, median feed price is a thing, price for force settlement is another.

@startailcoon
Copy link
Contributor

startailcoon commented Feb 9, 2018

The field Global Settlement Price isn't provided by something from the chain in the GUI, but a manual calculation of debt and collateral. I will require some help to provide if this is correct, or requires some new way of calculation.

Code

getGlobalSettlementPrice() {
var call_orders;
if (!this.state.callOrders) {
return null;
} else {
// put the call order on the stack
call_orders = this.state.callOrders;
}
// first get the least collateralized short position
var leastColShort = null;
var leastColShortRatio = null;
var len = this.state.callOrders.length;
for (var i = 0; i < len; i++) {
let call_order = this.state.callOrders[i];
if (leastColShort == null) {
leastColShort = call_order;
leastColShortRatio = call_order.getRatio();
} else if (call_order.getRatio() < leastColShortRatio) {
leastColShortRatio = call_order.getRatio();
leastColShort = call_order;
}
}
if (leastColShort == null) {
// couldn't find the least colshort?
console.log("couldn't find the least col short");
return null;
}
// this price will happen when the CR is 1.
// The CR is 1 iff collateral / (debt x feed_ price) == 1
// Rearranging, this means that the CR is 1 iff
// feed_price == collateral / debt
let debt = leastColShort.amountToReceive().getAmount();
let collateral = leastColShort.getCollateral().getAmount();
let globalSettlementPrice = collateral / debt;
return (<FormattedPrice
base_amount={collateral}
base_asset={leastColShort.call_price.base.asset_id}
quote_amount={debt}
quote_asset={leastColShort.call_price.quote.asset_id}
/>);
}

but a global settlement (black swan) will trigger at 10% (which is MSSR) above that price.

I assume your wish is to display when a market is possibly going to be affected by a black swan event? I will require some more details and a few example on this matter to be able to add in something useful, and hopefully not to confusing for users.

The market details page could, and should imho, have more technical details for traders to analyze the market.

@wmbutler wmbutler changed the title [.5][startailcoon] Global settlement price on asset info page? [1][startailcoon] Global settlement price on asset info page? Feb 9, 2018
@startailcoon
Copy link
Contributor

Releasing this for anyone interested in following up on this for now.

@startailcoon startailcoon changed the title [1][startailcoon] Global settlement price on asset info page? [1] Global settlement price on asset info page? Feb 10, 2018
@wmbutler wmbutler modified the milestones: 180215, 180301 Feb 17, 2018
@startailcoon
Copy link
Contributor

Ping @abitmore. Can you enlighten us about my question from before?

@abitmore
Copy link
Member Author

IMHO it needs UX. We have all the data, need to decide how to non-misleadingly show them.

@abitmore
Copy link
Member Author

All prices described below are in terms of debt/collateral, aka how much debt per collateral, which may affect descriptive words like "below", "above", "lower than", "higher than", "min", "max" and etc. If the price in UI is flipped, corresponding words need to be flipped as well.

We have these data, need to show some or all of them:

  • price feeds: a list, published by witnesses or other price feed producers
    • feed producer
    • price
    • CER
    • MCR
    • MSSR
  • medians (already calculated by server, so get from bitasset data directly):
    • median price feed (showing as settlement price in OP): median of price feeds
    • median MCR
    • median MSSR
  • about force settlement:
    • offset
    • delay
    • max settle-able volume per maintenance interval (percent)
    • force settle price: median price feed * ( 100% + offset ), the price that a force settlement order will be filled at
    • max settle-able volume before next maintenance interval (absolute value): total supply * percent
    • settled volume: amount settled in this maintenance interval
    • remaining settle-able volume: max - settled
  • about margin calls:
    • MSSP: median price feed / MSSR, the lowest price that a margin call can be executed at
  • short positions (list):
    • user
    • debt amount
    • collateral amount
    • call price: if feed price is below or equal to this value, the order will be able to be margin called
    • collateral ratio: median price feed * collateral / debt
  • about black swan event (if an asset is not in black swan state): calculate from the short position with least collateral ratio (affected by this bug: Black swan detection checks short position with lowest call_price but not lowest collateral ratio bitshares-core#649, a black swan event can be deferred)
    • black swan price: MSSR * debt / collateral, if feed price is below this value, a black swan event may occur
  • if an asset is in black swan state (e.g. GOLD):
    • global settlement price: a new settlement order will execute at this price immediately (won't delay)
    • settlement fund: how much collateral is available (should be equal to current supply / global settlement price)
    • a list of collateral bids
      • user
      • additional collateral amount: how much collateral the user wants to add
      • debt amount: how much debt the user wants to cover/claim

@wmbutler wmbutler changed the title [1] Global settlement price on asset info page? [4] Global settlement price on asset info page? Feb 21, 2018
@wmbutler
Copy link
Contributor

This needs UX, @ahdigital ?

@wmbutler wmbutler added [6] UX Impact flag identifying the application User Experience [3] Feature Classification indicating the addition of novel functionality to the design and removed [3] Bug Classification indicating the existing implementation does not match the intention of the design question [6] UX Impact flag identifying the application User Experience labels Mar 1, 2018
@wmbutler wmbutler changed the title [4] Global settlement price on asset info page? [4] Global settlement price on asset info page Mar 1, 2018
@wmbutler wmbutler modified the milestones: 180301, 180315 Mar 1, 2018
@wmbutler wmbutler added the [6] UX Impact flag identifying the application User Experience label Mar 15, 2018
@wmbutler wmbutler changed the title [4] Global settlement price on asset info page [2][4] Global settlement price on asset info page Mar 15, 2018
@grctest
Copy link
Contributor

grctest commented Sep 28, 2018

''bitGOLD' which is currently in a global settlement state has a global settlement value of '-'. If you navigate from bitUSD to bitGOLD via the URL bar the bitUSD value stays until you refresh the page.

In a global settlement state, perhaps it'd be worth providing BSIP 18 related UI elements - indicating how close it is to leaving the global settlement state (and perhaps a link to docs explaining the situation/state bitGOLD is in)?

@wmbutler
Copy link
Contributor

wmbutler commented Oct 1, 2018

@startailcoon I think we need to get this to a closing point.

@startailcoon
Copy link
Contributor

startailcoon commented Oct 8, 2018

@startailcoon I think we need to get this to a closing point.

I tend to agree :)

I know alot more today, and I hope to be able to close this soon.

@wmbutler
Copy link
Contributor

wmbutler commented Oct 8, 2018

So, when you are ready to bring it to a close, make a second issue with the remaining points and close this out. Nice work.

@wmbutler wmbutler added this to the 181017 milestone Oct 8, 2018
@startailcoon startailcoon modified the milestones: 181017, 181031 Oct 15, 2018
@startailcoon startailcoon modified the milestones: 181031, 181128 Nov 11, 2018
@startailcoon startailcoon added [1b] User Story The User Story details a requirement. It may ref a parent Project (Epic). It may ref child Task(s) [7] Estimated Administration flag, notifies hours are estimated and requires revisiting labels Nov 20, 2018
@startailcoon
Copy link
Contributor

I've posted an issue on bitshraes-core to include asset collateral volume and settled volume on chain.

bitshares/bitshares-core#1448

@startailcoon
Copy link
Contributor

Adding a few new fields

Price Feed

bild

Settlement (normal)

bild

Settlement (in Global Settlement)

bild

I'm not sure if the Settlement Volume will change during a global settlement.

@startailcoon startailcoon added [7] Finalized Administartion flag, notifies hours are finalized and removed [7] Estimated Administration flag, notifies hours are estimated and requires revisiting labels Nov 25, 2018
@abitmore
Copy link
Member Author

abitmore commented Nov 25, 2018

Due to bsip42, the name "external price" is not so good. #1865.

Volume limit is ignored after globally settled.

@startailcoon
Copy link
Contributor

@abitmore noted. Removing volume limit data on global settled asset.

Due to bsip42, the name "external price" is not so good

How is "Average market price"?

@sschiessl-bcp
Copy link
Contributor

How is "Average market price"?

How about waht it actually is: Feed price (median of witness feeds)

@sschiessl-bcp
Copy link
Contributor

sschiessl-bcp commented Nov 26, 2018

I did not read the discussion in here in detail beforehand and rearranged a bit, sorry. Can you please check if appropriate

USD
image

CNY
image

sschiessl-bcp pushed a commit that referenced this issue Nov 26, 2018
Issue #1119 - Update Assets Information Page
@startailcoon
Copy link
Contributor

Looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[1b] User Story The User Story details a requirement. It may ref a parent Project (Epic). It may ref child Task(s) [3] Feature Classification indicating the addition of novel functionality to the design [6] UX Impact flag identifying the application User Experience [7] Finalized Administartion flag, notifies hours are finalized
Projects
None yet
Development

No branches or pull requests

6 participants