rabol
October 1, 2024, 10:20am
1
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×tamp=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 ?
albin
October 2, 2024, 2:13am
2
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.
rabol
October 2, 2024, 7:03pm
3
Got the point, I was looking at the wrong filer, my bad
rabol
October 3, 2024, 6:18pm
4
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.:
# Filters
Filters define trading rules on a symbol or an exchange.
Filters come in two forms: `symbol filters` and `exchange filters`.
## Symbol filters
### PRICE_FILTER
The `PRICE_FILTER` defines the `price` rules for a symbol. There are 3 parts:
* `minPrice` defines the minimum `price`/`stopPrice` allowed; disabled on `minPrice` == 0.
* `maxPrice` defines the maximum `price`/`stopPrice` allowed; disabled on `maxPrice` == 0.
* `tickSize` defines the intervals that a `price`/`stopPrice` can be increased/decreased by; disabled on `tickSize` == 0.
Any of the above variables can be set to 0, which disables that rule in the `price filter`. In order to pass the `price filter`, the following must be true for `price`/`stopPrice` of the enabled rules:
* `price` >= `minPrice`
* `price` <= `maxPrice`
* `price` % `tickSize` == 0
**/exchangeInfo format:**
```javascript
This file has been truncated. show original
To see what filters are configured on which symbol, please refer to ExchangeInfo on Testnet.
Thank you.
rabol
October 4, 2024, 4:33am
6
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 ?
rabol
October 4, 2024, 9:32am
7
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