-
Notifications
You must be signed in to change notification settings - Fork 37
ERROR: -1013, Filter failure: LOT_SIZE #7
Comments
yes, this may happen either because it is lower than minimal order allowed or it can be also because you are using incorrect precision that is not allowed for this market |
LOT_SIZE issue can be solved by https://www.binance.com/api/v1/exchangeInfo parsing. |
@chongjae yes, exchangeInfo endpoint will be added. But this API wrapper tend to be pretty low level. |
exchangeInfo() was added in todays Release 1.0.8 Example of how LOT SIZE could be retrieved, is added to the README |
When I switch out "BNB" for other coin names, I get "no value" error for some of them |
Can't Binance server just omits extra decimals in requests' lot size? |
This took me by surprise but the reason is that maybe you are using decimal precision with say 5 for symbols and maybe you should use 6. So be careful and note how much decimal precision you use. .. at least that was my case and it works. Another way to find out is https://www.binance.com/api/v1/exchangeInfo parsing, but a quick trick is also to use the mobile app by counting the decimals for a quick solution, but of course it is not the best, of anyways I hope this helps someone else like me. Good luck ! :D |
Here, I have found and used the following code that works well in a lot of cases:
but for certain coins, no float value from 15 decimal places down to 0 will solve this problem for me. Anyone have any ideas? Is Kraken or Bittrex a better overall option in terms of automated/api algotrading? |
https://www.binance.com/api/v1/exchangeInfo for BTCUSDT returns:
I`m trying to place order with "quantity=0.00197505" (8 decimal places) and API returns:
If I try to put "quantity=0.001975" (6 decimal places) - API works fine. Could someone explain me what is wrong? How can I get possible decimal places before call |
@VolodymyrLavrenchuk check exchangeinfo full response: {
"symbol": "BTCUSDT",
"status": "TRADING",
"baseAsset": "BTC",
"baseAssetPrecision": 8,
"quoteAsset": "USDT",
"quotePrecision": 8,
"quoteAssetPrecision": 8,
"baseCommissionPrecision": 8,
"quoteCommissionPrecision": 8,
"orderTypes": [
"LIMIT",
"LIMIT_MAKER",
"MARKET",
"STOP_LOSS_LIMIT",
"TAKE_PROFIT_LIMIT"
],
"icebergAllowed": true,
"ocoAllowed": true,
"quoteOrderQtyMarketAllowed": true,
"isSpotTradingAllowed": true,
"isMarginTradingAllowed": true,
"filters": [
{
"filterType": "PRICE_FILTER",
"minPrice": "0.01000000",
"maxPrice": "1000000.00000000",
"tickSize": "0.01000000"
},
{
"filterType": "PERCENT_PRICE",
"multiplierUp": "5",
"multiplierDown": "0.2",
"avgPriceMins": 5
},
{
"filterType": "LOT_SIZE",
"minQty": "0.00000100",
"maxQty": "9000.00000000",
"stepSize": "0.00000100"
},
{
"filterType": "MIN_NOTIONAL",
"minNotional": "10.00000000",
"applyToMarket": true,
"avgPriceMins": 5
},
{
"filterType": "ICEBERG_PARTS",
"limit": 10
},
{
"filterType": "MARKET_LOT_SIZE",
"minQty": "0.00000000",
"maxQty": "84.18997572",
"stepSize": "0.00000000"
},
{
"filterType": "MAX_NUM_ORDERS",
"maxNumOrders": 200
},
{
"filterType": "MAX_NUM_ALGO_ORDERS",
"maxNumAlgoOrders": 5
}
],
"permissions": [
"SPOT",
"MARGIN"
]
}
{
"filterType": "LOT_SIZE",
"minQty": "0.00000100",
"maxQty": "9000.00000000",
"stepSize": "0.00000100"
} Your quantity |
I just came across this problem myself. I am a noob at python and and coding in general , most of the code I keep seeing as a solution for this seems overly complicated but I figured it out on my side atleast.
then when placing an order, for quantity just go, for ex: "round(11.0/current_price, decimal)" |
hey i am facing the same issue. could you please tell me how to solve this error? |
this code part working prettily but you have to be know some times give 0.0 quantity value. |
Hello I think that the best solution use the Binance Online information thought: https://www.binance.com/api/v1/exchangeInfo and I created the following function to limit the stepsize per token
The function Truncate is the next:
I noticed that there were several tokens with stepsize to only whole value, You will careful with that. |
The solution for this is simple, using this quoted answer as an example for this context. Imagine the You need to divide the 0.00197505 / 0.00000100 = 1.975,05 If the division gives a remainder of zero e.g. You don't have to worry about the previous workarounds which truncate stuff and is too much work for a simple solution like this. |
LOT SIZE give you the amount of decimals you should set.
that means that if you have 0.0011 it will fail, you can only send in this case 3 decimals. |
When I try to place an order I get this error:
How can I resolve this?
The text was updated successfully, but these errors were encountered: