Hi
i have 1000 USDT in my spot wallet.
On the pair HOT/USDT.
i’m trying to place a marker buy order with the ‘cummulativeQuoteQty’ value of my last sell order filled(500 USTD for example) as “quoteOrderQty”.
But the buy order is filled fully with 1000 USDT not 500 USDT.
The piece of my code :
trades_sell_amount_fiat = client.get_all_orders(symbol=‘HOTUSDT’)[-1][‘cummulativeQuoteQty’]
trades_sell_amount_fiat_decimal = Decimal(trades_sell_amount_fiat).quantize(Decimal(‘0’), rounding=decimal.ROUND_DOWN) ## → The last amount value of my sell order (500 USDT)
buyOrder = client.order_market_buy(symbol = pairName, side = ‘buy’, quoteOrderQty = trades_sell_amount_fiat_decimal)
I tried and tested so many times but no success…and that cost me a lot of fees :))
I have also this error message :
BinanceAPIException: APIError(code=-2010): Account has insufficient balance for requested action.
And despite the error message, the order is still filled and fully.
Please and thanks for your help !