binance sell coins has residual position amount trig error
Dear Catalyst Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
- Operating System: (Windows Version or
$ uname --all) - Python Version:
$ python --version - Python Bitness:
$ python -c 'import math, sys;print(int(math.log(sys.maxsize + 1, 2) + 1))' - How did you install Catalyst: (
pip,conda, orother (please explain)) - Python packages:
$ pip freezeor$ conda list
Now that you know a little about me, let me tell you about the issue I am having:
Description of Issue
- What did you expect to happen?
- What happened instead?
Here is how you can reproduce this issue on your machine:
Reproduction Steps
...
What steps have you taken to resolve this already?
...
Anything else?
...
Sincerely,
$ whoami
Hi @wkpzwy , Please provide more information on the issue you are experiencing, it is advisable to follow the guidelines provided when opening a new issue.
Embar
Some trades which sell entire position leave a very small amount in the position amount variable, leading to a crash.
catalyst.exchange.exchange_errors.CreateOrderError:
catalyst.exchange.exchange_errors.ExchangeRequestError: Request failed: binance {"co│catalyst.exchange.exchange_errors.ExchangeRequestError: Request failed: binance {"c de":-2010,"msg":"Account has insufficient balance for requested action."}
- the small residual amount was introduced when Binance deducts fee from the position. 2. It triggers error when you try to flat your position but the residual amount is smaller than the minimum trading size (roughly equal to 0.01* eth) required by the exchange. To solve 1, I would recommend using BNB for fees. For 2, I would assert orders that I send having quantity larger than min trading size.