Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

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

Open
nhancm opened this issue Dec 17, 2017 · 11 comments
Open

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

nhancm opened this issue Dec 17, 2017 · 11 comments

Comments

@nhancm
Copy link

nhancm commented Dec 17, 2017

System information

  • Have I written custom code (as opposed to using zenbot vanilla):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Zenbot version: 4.0.5
  • NodeJS version: v8.9.3
  • Python version: 2.7.12
  • Exact command to reproduce: ./zenbot.sh trade

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' } ]

@DeviaVir DeviaVir added the bug label Dec 17, 2017
@nhancm
Copy link
Author

nhancm commented Dec 17, 2017

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
Copy link

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
Copy link

sust4in commented Dec 24, 2017

i have this issue too.

@DeviaVir DeviaVir reopened this Dec 28, 2017
@mkuendig
Copy link
Contributor

mkuendig commented Dec 30, 2017

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
Copy link
Contributor

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

@kroitor
Copy link

kroitor commented Jan 19, 2018

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

@DeviaVir DeviaVir added enhancement and removed bug labels Jan 19, 2018
@haxmeadroom
Copy link
Contributor

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

@DeviaVir
Copy link
Owner

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

@haxmeadroom
Copy link
Contributor

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

@JaapSch
Copy link

JaapSch commented Feb 11, 2018

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

@defkev
Copy link
Contributor

defkev commented Feb 19, 2018

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 👉 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. buy fails when buy_pct = 100 #1315

  2. Will doing Improve buy order size calculation #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 cexio.btc-usd Place order error: Insufficient funds #923

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants