catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

binance sell coins has residual position amount trig error

Open wkpzwy opened this issue 7 years ago • 5 comments

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, or other (please explain))
  • Python packages: $ pip freeze or $ 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

wkpzwy avatar Oct 03 '18 02:10 wkpzwy

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

EmbarAlmog avatar Oct 04 '18 09:10 EmbarAlmog

Some trades which sell entire position leave a very small amount in the position amount variable, leading to a crash.

wkpzwy avatar Oct 05 '18 01:10 wkpzwy

catalyst.exchange.exchange_errors.CreateOrderError:

wkpzwy avatar Oct 05 '18 01:10 wkpzwy

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."}

wkpzwy avatar Oct 05 '18 07:10 wkpzwy

  1. 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.

superluminance avatar Nov 16 '18 05:11 superluminance