Why do I get MARKET_LOT_SIZE error ?

Hi

I’m trying to place a market sell order

POST https://testnet.binance.vision/api/v3/order?quantity=85266&symbol=ADAEUR&side=SELL&type=MARKET&timestamp=1727777286521&signature=xxx

But I get this error:

{“code”:-1013,“msg”:“Filter failure: MARKET_LOT_SIZE”}

I checked the lot size and it’s like this:

{“filterType”:“LOT_SIZE”,“minQty”:“0.10000000”,“maxQty”:“900000.00000000”,“stepSize”:“0.10000000”}

So what am I doing wrong ?

Hey,
When requesting information for the ADAEUR symbol using the exchangeInfo endpoint, the following filter data is returned:

{
     "filterType": "MARKET_LOT_SIZE",
     "minQty": "0.00000000",
     "maxQty": "55402.36485355",
     "stepSize": "0.00000000"
}

Since your request exceeds the maxQty in your request, you are encountering a MARKET_LOT_SIZE error.

Got the point, I was looking at the wrong filer, my bad

Hmm… I still get an error:

{
“maxQty”:“46558.79708333”,
“minQty”:“0.00000000”,
“stepSize”:“0.00000000”,
“filterType”:“MARKET_LOT_SIZE”
}

Client error: POST https://testnet.binance.vision/api/v3/order?quantity=46558.79708333&symbol=ADAEUR&side=SELL&type=MARKET resulted in a 400 Bad Request response:
{“code”:-1013,“msg”:“Filter failure: LOT_SIZE”}

As one can see, the quantity is exactly the same as the maxQty, now it looks the system is also looking at the LOT_SIZE filter ?

So what are the rules ?

Hi Rabol,

When placing an order, all applicable filters are taken into consideration.

LOT_SIZE takes into account the quantity for any order.
MARKET_LOT_SIZE takes into account for MARKET orders specifically.

So you have to pass both as well as the other filters that are configured for that symbol.

To understand how to pass those filters, please refer to this document.:

To see what filters are configured on which symbol, please refer to ExchangeInfo on Testnet.

Thank you.

Thanks a lot for pointing me in the right directions, I’ll make sure that I do some more reading!

Where do I see which filter applies to an order ?

Hello,

I a little help, please

I have not been able to figure out which filters that I have to apply to a SELL order and if I always have to apply the same filters or if the filters is depending on the symbol, so I have applied MARKET_LOT_SIZE and LOT_SIZE, but I still get an error:

All info is from TESTNET

The balance on my account DOTEUR 7063.33

I apply the MARKET_SIZE_LOT filter
{
“maxQty”:“1598.54137500”,
“minQty”:“0.00000000”,
“stepSize”:“0.00000000”,
“filterType”:“MARKET_LOT_SIZE”
}

so I reduce the qty to 1598.54137500

I then apply the LOT_SIZE filter
{
“maxQty”:“90000.00000000”,
“minQty”:“0.01000000”,
“stepSize”:“0.01000000”,
“filterType”:“LOT_SIZE”
}

which then result in a quantity of 1598.54

I then try to create the order:

https://testnet.binance.vision/api/v3/order?quantity=1598.54&symbol=DOTEUR&side=SELL&type=MARKET`
resulted in a 400 Bad Request
response: {“code”:-1013,“msg”:“Filter failure: MARKET_LOT_SIZE”}

So my questions ar now, why does this fail ?

Do I always apply MAKET_LOT_SIZE and LOT_SIZE filter or is it depending on the symbol?

Thanks

LOT_SIZE filter is applicable to all orders. MARKET_LOT_SIZE is applicable only to market orders.

When both filters are configured, both are applied to market orders. However, when filter parameter is zero, this means the filter is not enforced for this parameter.

E.g., with configuration like this:

{
  "filterType": "LOT_SIZE",
  "minQty": "0.01000000",
  "maxQty": "90000.00000000",
  "stepSize": "0.01000000"
},
{
  "filterType": "MARKET_LOT_SIZE",
  "minQty": "0.00000000",
  "maxQty": "1333.14853556",
  "stepSize": "0.00000000"
},

the restrictions are like this, based on the order type:

Order type minQty maxQty stepSize
MARKET 0.01 1333.14853556 0.01
any other 0.01 90000.00000000 0.01

Hi

Thanks for your reply, but if you look at my example, I do use the market_size_lot and the lot_size, and the value I try to sell is 1598.54 which is within the step size of the lot size filter and is lower than the maxQty of the market_size_lot, which is why I don’t understand why I get the MARKET_LOT_SIZE error.

I might have misunderstood something :slight_smile:

Kind regards

It does look like that true.

But it also seems that maxQty value of the filter is changing. Right now it’s 1333.14853556. Could it be that you tried sending a sell order when the quantity was already updated? Then an order for 1598.54 should not have passed the filter.