{ code: -1013, msg: 'Filter failure: LOT_SIZE' }

This may be an already asked question but the solution provided does not help me to fully understand what I am doing wrong.
I am working directly on the mainet.
The issue happens when I try to create limit orders. Please check the bellow code.
I need help figuring out what could be the cause of the problem and how to solve.
Here the code that sends the request:

      let params = {
        symbol: symbol,
        side: side,
        type: "LIMIT",
        timeInForce: "GTC",
        quantity: format(quantity),//sprintf("%.8f", quantity)
        price: format(price),
      };
      this.checkParams(params, [
        "symbol",
        "side",
        "type",
        "timeInForce",
        "quantity",
        "price",
      ]);

The created URL looks like this:
/api/v3/order?symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=0.00187064&price=26308.79000000&timestamp=1695102965102&signature=82600d68e7dc58c79e76f887ca17872e7dec858cfe24d020521e033b6150b220
Thanks!!!

Hi,

To understand why you’re getting that error you can do the following steps:

  1. Fetch the LOT_SIZE filter for the BTCUSDT trading pair using the Binance API. You can do this by making a GET request to the following endpoint:
    https://api.binance.com/api/v3/exchangeInfo
  • This will give you a response containing information about all trading pairs, including the LOT_SIZE filter.
  1. Once you have the LOT_SIZE filter information for your specific pair (BTCUSDT), check if your specified quantity (0.00187064) falls within the allowed range and precision defined by the filter.
  • Ensure that the quantity is within the minQty and maxQty limits.
  • Ensure that the quantity conforms to the stepSize (the allowed increment/decrement) specified by the filter.

Eg. for BTCUSDT, the relevant values are:

  • minQty: 0.00001000
  • maxQty: 9000.00000000
  • stepSize: 0.00001000

So in this particular situation, your quantity of 0.00187064 doesn’t conform to the stepSize which is why you’re receiving that error.

Hope that helps!

2 Likes

Hi, would it be possible to add this to the docs? the only mention about this status code is unrelated to precision mismatch

2019-03-12

Rest API

  • X-MBX-USED-WEIGHT header added to Rest API responses.
  • Retry-After header added to Rest API 418 and 429 responses.
  • When canceling the Rest API can now return errorCode -1013 OR -2011 if the symbol’s status isn’t TRADING.
  • api/v1/depth no longer has the ignored and empty [].
  • api/v3/myTrades now returns quoteQty; the price * qty of for the trade.

Thanks!

1 Like