Can't sell amounts of crypto with more than 3 decimals
I am trying to sell a "0.00031300" of DOGE to USDT by running the following command:
order = client.order_market_sell(symbol='CAKEUSDT', quantity=0.00031300)
and getting the following error
Traceback (most recent call last):
File "C:\Users\tomi-\PycharmProjects\pythonProject1\test.py", line 31, in <module>
order = clientbinance.order_market_sell(symbol='CAKEUSDT', quantity=0.00031300)
File "C:\Users\tomi-\PycharmProjects\pythonProject1\venv\lib\site-packages\binance\client.py", line 1539, in order_market_sell
return self.order_market(**params)
File "C:\Users\tomi-\PycharmProjects\pythonProject1\venv\lib\site-packages\binance\client.py", line 1483, in order_market
return self.create_order(**params)
File "C:\Users\tomi-\PycharmProjects\pythonProject1\venv\lib\site-packages\binance\client.py", line 1345, in create_order
return self._post('order', True, data=params)
File "C:\Users\tomi-\PycharmProjects\pythonProject1\venv\lib\site-packages\binance\client.py", line 323, in _post
return self._request_api('post', path, signed, version, **kwargs)
File "C:\Users\tomi-\PycharmProjects\pythonProject1\venv\lib\site-packages\binance\client.py", line 265, in _request_api
return self._request(method, uri, signed, **kwargs)
File "C:\Users\tomi-\PycharmProjects\pythonProject1\venv\lib\site-packages\binance\client.py", line 260, in _request
return self._handle_response()
File "C:\Users\tomi-\PycharmProjects\pythonProject1\venv\lib\site-packages\binance\client.py", line 313, in _handle_response
raise BinanceAPIException(self.response)
binance.exceptions.BinanceAPIException: APIError(code=-1013): Filter failure: LOT_SIZE
I can't round this number to 3 decimals because if I do that I get the following output 0.0.
This is really bad since I can make exact transactions if I need to round every single time I want to sell or buy something.
I also didn't find an option to buy/sell the max amount possible with any command.
@fortoken01 try to see limits in get_exchange_info or get_symbol_info
As Alex said, this is to do with Binance's rules. The smallest amount of Doge you can trade is 0.1, and the minimum order has to be worth 10 USDT. More here: https://www.binance.com/en/trade-rule
sorry for the issue, I noticed it hours later of making this issue. well it kinda sucks to not being able to make queries with full sizes cause the fee binance takes from trading disrupts values like 1.000
You also have the option of using BNB for fees on your trades which keeps your amounts of other crypto cleaner.
I have also created a blog post going into detail about the Spot filters.
https://sammchardy.github.io/binance/2021/05/03/binance-order-filters.html