DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.21k stars 2.04k forks source link

binance order cost = amount * price should be > 0.001 BTC #900

Open nhancm opened 6 years ago

nhancm commented 6 years ago

System information

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in Zenbot or a feature request.

Source code / logs

An error occurred { Error: binance order cost = amount * price should be > 0.001 BTC {"code":-1013,"msg":"Filter failure: MIN_NOTIONAL"} at binance.handleErrors (/home/zenbot/zenbot/node_modules/ccxt/js/binance.js:627:19) at response.text.then.text (/home/zenbot/zenbot/node_modules/ccxt/js/base/Exchange.js:412:18) at at process._tickCallback (internal/process/next_tick.js:188:7) constructor: [Function: InvalidOrder] }

Binance API is down! unable to call buy, retrying in 20s [ { price: '0.00002340', size: '29.36043000', orig_size: '29.36043000', remaining_size: '29.36043000', orig_price: '0.00002340', cancel_after: 'day', product_id: 'ZRX-BTC', post_only: true, type: 'limit', side: 'buy' } ]

nhancm commented 6 years ago

Please apply a fix for check if a current account doesn't have enough balance >= 0.001 BTC let show warning or stop the bot. minimum order BUY/SELL limit at binance.com is 0.001 BTC. thanks

carolburri commented 6 years ago

this fix is not working for IOTA/BTC

my current settings are: { "id": "IOTABTC", "asset": "IOTA", "currency": "BTC", "min_size": "1.00000000", "max_size": "100000", "increment": "0.001", "label": "IOTA/BTC" },

Any help would be great!

sust4in commented 6 years ago

i have this issue too.

kroitor commented 6 years ago
mkuendig commented 6 years ago

could it be that the bot is confused with the trading fee via BNB tokens? the standard trading fee is 0.1% but with BNB present and BNB trading enabled it lowers to 0.05%. It seems the bot tries to deduct the trading fee and goes then in a retry loop of small orders that don't execute.

Update: The 99% buy and sell percentage currency amounts listed in the default conf-sample.js confused my bot. Have changed that. But I still think we should solve the above MIN_NOTIONAL issue.

Update2: I changed the 99% to 100% but then a new issue occured with insufficient funds. So falling back to 99% and just live with this annoying error. At least it trades. Here the output from my bot:

An error occurred { Error: binance order cost = amount * price should be > (0.001 BTC or 0.01 ETH or 1 BNB or 1 USDT){"code":-1013,"msg":"Filter failure: MIN_NOTIONAL"}

@abduegal Adding the core developer of the binance extension. He may know.

haxmeadroom commented 6 years ago

I'm having the same issue with binance.XMR-BTC . Tried buy_pct and sell_pct to 99%

kroitor commented 6 years ago

Please update ccxt to most recent version, this should be fixed already. Thx!

haxmeadroom commented 6 years ago

Hmm.. I still seem to be getting this from a git pull today.

DeviaVir commented 6 years ago

Pretty sure we didn't update ccxt to the most recent version yet, so that should not be too surprising.

haxmeadroom commented 6 years ago

Is this fixed in unstable and hasn't made it to master yet?

JaapSch commented 6 years ago

Still having the same error ... any word on the fix?

defkev commented 6 years ago

As this seems to be the most "active" issue on "insufficient funds" errors i sum the current state up here.

Matter of the fact is we currently have multiple problems with buy_order sizing, especially if the bot is set to buy at or near to 100% of our balance :point_right: buy_pct = 100

I already started working on this with yesterdays PR #1376 which separates buy order size calculation between 100% and non-100% orders. We will now "attempt" to calculate the expected fee (in currency) of 100% orders instead of relying on numbro. As rounding can make a significant difference between actually trading our complete balance vs. exceeding it and getting the exchange to accept or refuse our order respectively.

Further problems, i intend to look into in the following days, are:

  1. If an order times out (the market price moved to far from our order price) the bot will only adjust the price but not the size of the re-order, which inevitable will cause a balance problem if the price moved up. This has been reported, e.g. #1315

  2. Will doing #1376 i notice that at least CEXIO does in fact not accept maker buy_orders using the (lower) maker fee. Trying to create such an order (using their API and the frontend) with 100% of our balance will get rejected with a "insufficient funds" error as they expect the order to get sized using the (higher) taker fee. This has no impact on the actual fee paid, so if the taker order gets filled we only pay the taker fee and end up with a remaining currency balance even if set to buy_pct = 100 I dunno why they are doing it like this (maybe as a fail-safe?) and wherever this is limited to CEX alone. This has been reported (at least for CEX) with #923