bitshares-ui
bitshares-ui copied to clipboard
Define Logic for Margin Position Status
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
} else if (cr < mr * 1.309) {
30.9% is the average of the two Fibonacci levels 23.6% and 38.2%
@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
Currently we have
dangerwarning- 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
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%) |
Does anyone think we need to change / add a third level to this? Otherwise I think we can close this.