cryptonomex / graphene-ui

Cryptonomex Graphene front end (wallet and decentralized exchange)
https://bitshares.openledger.info
MIT License
156 stars 100 forks source link

Order price is reverted after changing trade amounts. #831

Closed destenson closed 8 years ago

destenson commented 8 years ago

When placing an order, I often click on an open order to pre-fill the blanks of the order form, then change the values to what I want. If I want to sell, I'll click the lowest open ask offer to auto-fill the field with that price. Then, I change it to the price I want to sell for, but when I fill in either the Amount or Total fields, the price reverts to the price of the existing open order. I think, when that price field is manually changed, it's value should remain when the other fields are changed.

svk31 commented 8 years ago

Could you clarify this a bit more please? I'm not sure I understand correctly, cause I can't reproduce the issue. Step by step would be nice.

destenson commented 8 years ago

I recorded a short video demonstrating the issue. https://youtu.be/256FXg6cKe0

On Mon, Apr 25, 2016 at 9:31 AM, Sigve Kvalsvik notifications@github.com wrote:

Could you clarify this a bit more please? I'm not sure I understand correctly, cause I can't reproduce the issue. Step by step would be nice.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/cryptonomex/graphene-ui/issues/831#issuecomment-214430923

svk31 commented 8 years ago

Ok, that's a duplicate of https://github.com/cryptonomex/graphene-ui/issues/771, it's due to margin calls not using the "correct" price but instead takes the feed price. I've been trying to fix it this evening but it's tricky getting those price calculations right, especially without having open margin calls to work with.

destenson commented 8 years ago

I don't know if they are the same bug exactly. To workaround mine, I would make the Amount box auto-fill with "1" (if empty) in the on-click handler for the Price box. It would be a simple fix if I knew where to put the code.

I'm pretty sure that wouldn't fix the other bug (#771) you're working on, though.

destenson commented 8 years ago

a0d42b1078e9255da3e66a4f67f54edd37fba671 fixes my issue and now it behaves exactly as I expected it to in the first place. If any of the inputs change, the others update as expected. And the order on that side of the trade is still incomplete by default, so you can't accidentally buy when you meant to sell, etc.

svk31 commented 8 years ago

I'm still not sure I get what the issue was but it seems to still be working ok I'm merging your PR :+1: