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

Using max_taker_vol with sell resulted into StartFailed swap on balance check. #888

Closed
artemii235 opened this issue Apr 2, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@artemii235
Copy link
Member

I tried to trade using this combination and the swap failed. Need to check and fix it.

@artemii235 artemii235 added the bug Something isn't working label Apr 2, 2021
@artemii235 artemii235 self-assigned this Apr 2, 2021
@artemii235
Copy link
Member Author

artemii235 commented Apr 2, 2021

Could not reproduce it, will check again.

@samurai321
Copy link

samurai321 commented Apr 4, 2021

possibly after adding the fees the amount required is larger than the amount available.

a rounding or lack of it error.

maybe the same bug as the one when the swap fails and it gives you a incredibly long number as the amount you are trying to swap.
ex. #765

@artemii235
Copy link
Member Author

@samurai321 Thanks for your comment. The problem was different a bit - balance check at swap start didn't use the 10% dex fee discount when maker coin is KMD. I have fixed it.

Incredibly long numbers are fine as we use rational numbers, and some of these can't be represented as finite decimal (e.g. 1/3).

artemii235 added a commit that referenced this issue Apr 7, 2021
* WIP.

* WIP.

* WIP. Found and fixed the bug. TODO refactor.

* Finalize the tests and fix. Refactor.

* Remove pub for TakerSwapPreparedParams fields.

* Add MarketMakerIt::start_with_envs to avoid passing empty slice everywhere.
@artemii235
Copy link
Member Author

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants