bitshares-ui icon indicating copy to clipboard operation
bitshares-ui copied to clipboard

Define Logic for Margin Position Status

Open startailcoon opened this issue 6 years ago • 5 comments
trafficstars

Applies to Asset Details -> Margin Positions for positions near or below the threshold.

Currently

        if (cr < mr) {
            return "danger";
        } else if (cr < mr + 0.5) {
            return "warning";
        } else {
            return "";
        }

Originally posted by @sschiessl-bcp in https://github.com/bitshares/bitshares-ui/issues/2779#issuecomment-502967658

startailcoon avatar Jun 18 '19 18:06 startailcoon

} else if (cr < mr * 1.309) {

30.9% is the average of the two Fibonacci levels 23.6% and 38.2%

froooze avatar Jun 18 '19 19:06 froooze

@sschiessl-bcp can you please elaborate on your wish on this task?

We take the status to color the field by class, danger or warning. We currently have this logic on the following to get the status.

https://github.com/bitshares/bitshares-ui/blob/636d381770b75413b6614e6638c3845a09f5a861/app/lib/common/MarketClasses.js#L997-L1012

startailcoon avatar Jun 23 '19 17:06 startailcoon

Currently we have

  • danger
  • warning
  • nothing

This task is to discuss if we want the following below and what CR they should be tied to (suggestion in brackets)

  • danger (cr < mr)
  • warning (cr < mr + (mr-1)*0.5)
  • adequate (or some other wording, (cr < mr + (mr-1)*1.5)
  • nothing

sschiessl-bcp avatar Jul 01 '19 06:07 sschiessl-bcp

So You're looking at introducing another level of indication. I like frooze suggestion of using Fibonacci levels.

Let's look at the bitUSD asset then.

Level sschiessl-bcp frooze
danger < 1.6 < 1.6
warning < 1.9 < 1,9776 (23.6%)
adequate < 2.5 < 2,2112 (38,2%) or < 2.4 (50%)
nothing > 2.5 > 2,2112 (38,2%) or > 2.4 (50%)

startailcoon avatar Jul 04 '19 20:07 startailcoon

Does anyone think we need to change / add a third level to this? Otherwise I think we can close this.

startailcoon avatar Jul 24 '19 19:07 startailcoon