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

Order cancellation fee error #3486

Closed
abitmore opened this issue Apr 3, 2022 · 11 comments · Fixed by #3492
Closed

Order cancellation fee error #3486

abitmore opened this issue Apr 3, 2022 · 11 comments · Fixed by #3492

Comments

@abitmore
Copy link
Member

abitmore commented Apr 3, 2022

Describe the bug

Why the fee to be paid is coming up in "bullion" and not BTS?

To Reproduce
Steps to reproduce the behavior:
"Just cancelling my orders and re-doing them because their about to expire, It's not doing it to all of them but more than just 1"

Expected behavior
Fee in BTS.

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
"bug looks very random, had to cancel a lot of orders, before the fee asset switched"

@abitmore
Copy link
Member Author

abitmore commented Apr 3, 2022

"bug looks very random, had to cancel a lot of orders, before the fee asset switched"

@sschiessl-bcp
Copy link
Contributor

Reproducable?

@xiangxn
Copy link
Contributor

xiangxn commented Apr 6, 2022

image

I have not been able to reproduce the issue either, it may be related to the data of a single account.

For example: when there is no BTS in the account, the fee is other assets.
image

@abitmore
Copy link
Member Author

"When i want to cancel 1 order,it's not working,no chance of canceling.But when i select 2 orders to get canceled in the same time,then it works good."

@abitmore
Copy link
Member Author

It seems to happen on the market page.

@xiangxn
Copy link
Contributor

xiangxn commented Apr 11, 2022

@abitmore
Copy link
Member Author

The default cancellation fee asset should be the one configured in settings by the user, which is not always BTS. If the account has no sufficient balance of that asset to pay the fee, or the fee pool of that asset is not usable, then use the fallback logic.

@xiangxn
Copy link
Contributor

xiangxn commented Apr 15, 2022

I have dealt with this issue, if you have time you can review and merge.
@sschiessl-bcp @abitmore

sschiessl-bcp added a commit that referenced this issue Apr 23, 2022
* fix 3486

* introduce raiseIfInsufficient to reduce duplicate code

* default to given preference if nothing else has balance

* forgot to adjust myopenorders catch

* fix  subscript overflow

* fix 3486

Co-authored-by: Stefan <toleantech@gmail.com>
@sschiessl-bcp sschiessl-bcp added this to To do in 5.0.220701 Release via automation Apr 23, 2022
@abitmore abitmore reopened this Apr 24, 2022
5.0.220701 Release automation moved this from To do to In progress Apr 24, 2022
@abitmore
Copy link
Member Author

Reopening for review.

@abitmore
Copy link
Member Author

I think the patch #3492 might work in most cases, the most useful part is the logic "can't pay fee, show user his chosen default".

But it is not perfect.

  • It checks the fee pools each time, rather than cumulatively.
  • The additional (accumulative) balance check has no fallback logic but only throws an exception. This code actually helps nothing, because the user may know that the balance is insufficient too even without the code.

That said, I'm fine to keep the status quo by now. @sschiessl-bcp what do you think?

@sschiessl-bcp
Copy link
Contributor

The fix helps in a case where the user sees that he is able to pay the fee, but actually can't, because it's too many orders.

5.0.220701 Release automation moved this from In progress to Done Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants