Seungjun
Seungjun

Reputation: 984

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

Upvotes: 0

Views: 204

Answers (1)

Max Koniev
Max Koniev

Reputation: 141

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

Upvotes: 1

Related Questions