'python_binance api buy order buys slightly different amount

Let's say I want to buy 0.072 coins of 'XMRUSDT'. And executed buy order like following:

buy_market = client.create_order(symbol='XMRUSDT', side='BUY', type='MARKET', quantity=0.072)

and

print(buy_market['executedQty']) # prints 0.072.

But if check on binance app, actually 0.071928 coins was bought not 0.072.

So when my bot decided to sell, it have to sell 0.071 not 0.072.(bceause of lot size). So 0.000928 coins being left unsellable. This issue happens all the time.

This issue happens all the time, so on my portfolio coins being left is being unsellable being stacked continuously.

Is there any way to solve this problem?

Thanks



Solution 1:[1]

It’a not a Python or python_binance problem. It happens so, because your tokens are not sold in one batch. When you create a buy/sell order, binance finds matching orders by rate and sells your tokens in small portions. What you can do, is increase your bot precision to lower the amount of your leftovers

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Max Koniev