BitShares Forum

Main => General Discussion => Topic started by: inarizushi on May 12, 2015, 09:38:09 pm

Title: Wrong short amounts displayed in the GUI
Post by: inarizushi on May 12, 2015, 09:38:09 pm
Something is wrong with shorts.
I'm shorting well over price feed to buy orders. I've placed an order to short 0.07 bitBTC, and I end up shorting 0.059 (transaction id : #37336fec).

(http://img11.hostingpics.net/thumbs/mini_502422short1.png) (http://www.hostingpics.net/viewer.php?id=502422short1.png)

(http://img11.hostingpics.net/thumbs/mini_372628short2.png) (http://www.hostingpics.net/viewer.php?id=372628short2.png)

I had the same issue with a bitSILVER short and with a bitUSD short.

However, when I short a bitUSD to cover orders at the price feed, the amount is good.

It doesn't really make sense, I hope this is not a serious bug.
Title: Re: Wrong short amounts
Post by: zerosum on May 12, 2015, 09:48:32 pm

well it makes sense..in a way.

Not intuitive but correct.  not a bug - a design decision.
Title: Re: Wrong short amounts
Post by: inarizushi on May 12, 2015, 09:52:16 pm
Okay, if it's a design decision and not a bug that's good news to me, but could you please enlighten me ? Since the price is over the price feed, there is more collateral than required, so that's not the problem, and I don't get what is.
Title: Re: Wrong short amounts
Post by: zerosum on May 12, 2015, 10:10:07 pm
if you want to short

A= amount of  bitAsset you wanna sell:

C = sell price * A * 2

and put the result (C) in the collateral field.

 [disregard what the GUI is saying about the amount you are selling]

This way you will sell exactly the amount of bitAsset you wanna sell.

hope this helps.



and btw, I do not find this very logical either! I however expressed my opinion in the 0.9.0 feedback thread, instead of opening a bombastic new thread like "Wrong Short Amount".
Title: Re: Wrong short amounts displayed on the GUI
Post by: inarizushi on May 13, 2015, 07:07:17 am
if you want to short

A= amount of  bitAsset you wanna sell:

C = sell price * A * 2

and put the result (C) in the collateral field.

 [disregard what the GUI is saying about the amount you are selling]

This way you will sell exactly the amount of bitAsset you wanna sell.

hope this helps.



and btw, I do not find this very logical either! I however expressed my opinion in the 0.9.0 feedback thread, instead of opening a bombastic new thread like "Wrong Short Amount".

- This helps. And it actually is very logical, I do see now the problem that is solved by that, but the auto-completion should have been consistent with it.
- Anyway, if the collateral amount and the shorted amounts are right, what is displayed in the GUI is wrong : that's an issue to fix because it will confuse people
- Reacting in the 0.9.0 feedback was obviously the right thing to do, sorry for that.
Title: Re: Wrong short amounts displayed in the GUI
Post by: xeroc on May 13, 2015, 07:14:10 am
paging @svk who should be able to fix this issue in the GUI
Title: Re: Wrong short amounts displayed in the GUI
Post by: svk on May 13, 2015, 07:36:30 am
I'll have a look. It's strange that the price limit isn't being respected though. @tonyk2 so you're saying the collateral autofill is incorrect?

Edit: From looking at the code it seems the collateral is being calculated using the feed price even if you've set a price limit, I suppose that needs to take into account the price limit..
Title: Re: Wrong short amounts displayed in the GUI
Post by: pc on May 13, 2015, 12:32:14 pm
See also https://github.com/BitShares/bitshares/issues/1541
Title: Re: Wrong short amounts displayed in the GUI
Post by: Troglodactyl on May 13, 2015, 12:54:40 pm
See also https://github.com/BitShares/bitshares/issues/1541

Thanks, I was just about to link that.

The weird part to me is that collateral is determined at time of order placement based on the price feed, but the quantity of BitAsset is determined at time of execution based on sale price.  It seems to me that choosing to overcollateralize your short should be a separate issue from setting a premium on its price.  Minimum collateral should be feed * margin call ratio, and starting collateral should be 2 * feed + sale price, instead of 3x sale price as it is now.

This may not be worth dealing with depending on the plans for replacing BitAssets.
Title: Re: Wrong short amounts displayed in the GUI
Post by: zerosum on May 13, 2015, 02:15:55 pm
I'll have a look. It's strange that the price limit isn't being respected though. @tonyk2 so you're saying the collateral autofill is incorrect?

Edit: From looking at the code it seems the collateral is being calculated using the feed price even if you've set a price limit, I suppose that needs to take into account the price limit..

I suspect the GUI auto-fill was left as it was in v 0.8.0 of the client. They changed the rules in 0.9.0 so the result.
SVK, as for changing it to reflect the new rule, it is up to you - I honestly prefer the rule to be changed to what it was before, because:

if  A = shorting price - feed ; all prices in BTS/bitAsset;

Before if you short above the feed the over-collateralization was A
Total collateral = 2*feed+(feed+A) = 300%*feed price +A

With the new rule the over-collateralization is 3*A
Total collateral = 2*(feed+A)+(feed+A) = 300%*feed price +3A