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

call price wrongly calculated for user shenxiaoyu521 #1075

Closed
nbcks opened this issue Jan 28, 2018 · 14 comments
Closed

call price wrongly calculated for user shenxiaoyu521 #1075

nbcks opened this issue Jan 28, 2018 · 14 comments
Labels
[3] Bug Classification indicating the existing implementation does not match the intention of the design [4c] High Priority Priority indicating significant impact to system/user -OR- workaround is prohibitivly expensive

Comments

@nbcks
Copy link
Contributor

nbcks commented Jan 28, 2018

The user shenxiaoyu521 has a margin position in bitCNY where they have a debt of 1100 bitCNY and a collateral of 805.9 BTS. At the time of writing, their CR is 2.5 and the feed price is 0.29. This checks out since 805.9 / (0.29 * 1100) = 2.5. There call price should therefore be 805 / (MCR * 1100) = 0.4186. However, the call price displayed is 0.29486, which is incorrect. This is clearly incorrect since shenxiaoyu521 would be very close to getting margin called if their call price was so close to their feed price, yet they have a healthy collateral ratio of 2.51 (rather than a CR close to 1.75).

Steps to reproduce:

  1. Visit shenxiaoyu521 in the wallets asset explorer
  2. Click margin positions
  3. Observe the collateral ratio, debt and call price columns
@nbcks
Copy link
Contributor Author

nbcks commented Jan 28, 2018

screenshot from 2018-01-28 15-32-09
screenshot from 2018-01-28 15-32-34

@wmbutler wmbutler added [3] Bug Classification indicating the existing implementation does not match the intention of the design [4c] High Priority Priority indicating significant impact to system/user -OR- workaround is prohibitivly expensive labels Jan 28, 2018
@wmbutler wmbutler added this to the 180201 milestone Jan 28, 2018
@wmbutler wmbutler changed the title call price wrongly calculated for user shenxiaoyu521 [1] call price wrongly calculated for user shenxiaoyu521 Jan 28, 2018
@abitmore
Copy link
Member

Actually this is a core issue. That user's position was partially called, so showing a higher ratio, but the call price didn't change, so it will still be called at the original call price. bitshares/bitshares-core#343

@wmbutler
Copy link
Contributor

OK, so once the core issue is fixed, it's your believe that the UI will work as it's supposed to? If this is the case, I will leave this open but not put it into a Sprint.

@wmbutler wmbutler removed this from the 180201 milestone Jan 28, 2018
@nbcks
Copy link
Contributor Author

nbcks commented Jan 28, 2018

Ah that makes perfect sense since the UI seemed to be functioning quite well.

@nbcks
Copy link
Contributor Author

nbcks commented Jan 28, 2018

You might say that we should instead sort the call orders by collaterial ratio rather than call price for the margin positions tab in assets (I think they are sorted by call price presently)?

@wmbutler
Copy link
Contributor

Interesting thought. @abitmore what do you think about changing the sort to be the ratio?

@abitmore
Copy link
Member

I tend to update the call price field (in the core) directly when it's partially called, so call price and ratio will always match each other. But I'm not sure if it's technically practicable so far, or how hard to implement it. Will figure it out in next weeks.

@nbcks
Copy link
Contributor Author

nbcks commented Jan 29, 2018

I've made the change where it sorts by ratio, thoughts?

@abitmore
Copy link
Member

@nbcks I'd recommend don't change the sorting here at this moment. Perhaps better just add a warning info or something, telling users why it's showing like this.

@abitmore
Copy link
Member

If people can click the table header to sort by their own, would be useful. Anyway I don't think we need to change the default sorting.

@nbcks
Copy link
Contributor Author

nbcks commented Jan 30, 2018

You can change both the direction and column to sort by. What we CAN change is the default sort. Anyway, sorting by call price should be the same as sorting by CR. Given this, shouldn't we default the sort to collateral ratio instead of call price @abitmore ?

@abitmore abitmore changed the title [1] call price wrongly calculated for user shenxiaoyu521 call price wrongly calculated for user shenxiaoyu521 Jan 31, 2018
@abitmore
Copy link
Member

Different sorting has different purpose. If you've read the linked issue above, in the backend (right now), sorting by call_price is for margin calls, sorting by real collateral ratio is for force settlements. After the backend issue is fixed, both will return same result. I don't think it's wise to put efforts/time on changing default sorting right now, unless there are strong reasons showing that sorting by one field is much important than the other and need an emergency fix.

@wmbutler
Copy link
Contributor

wmbutler commented Feb 1, 2018

I agree with @abitmore. We are trying to fix a problem that will go away with no effort.

@nbcks
Copy link
Contributor Author

nbcks commented Feb 1, 2018

Okay, close the issue then?

@wmbutler wmbutler closed this as completed Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[3] Bug Classification indicating the existing implementation does not match the intention of the design [4c] High Priority Priority indicating significant impact to system/user -OR- workaround is prohibitivly expensive
Projects
None yet
Development

No branches or pull requests

3 participants