futures api duplicating orders issue

Hi guys,
I am trying to make futures bot in python using the python-binance lib
but I am always receiving the following problem after some times. (lets say 1 hour of work (about 30 orders)):
I am sending main order, stop loss order and take profit order and I am listening to the websocket.
Sometimes one of this orders get duplicated. The log here shows the duplication of the main order and the stop loss order (but I have seen many other variances of this issue)
Here is my output log:

WebHook data–>{‘tv_strategy_name’: ‘1s_strategy’, ‘tv_loss[%]’: -0.2, ‘tv_profit[%]’: 0.2, ‘tv_side’: ‘BUY’, ‘tv_oposite_side’: ‘SELL’, ‘tv_timestamp’: 1656682688, ‘tv_ticker’: ‘BINANCE:BTCBUSDPERP’, ‘tv_last_price’: ‘19261.6’, ‘tv_profit’: 19300.1, ‘tv_loss’: 19223.1, ‘delay_tv_pc[ms]’: 1, ‘pc_time’: 1656682689, ‘symbol’: ‘BTCBUSD’}
{‘BTCBUSD’: False, ‘ETHBUSD’: False, ‘BNBBUSD’: False, ‘ADABUSD’: False, ‘XRPBUSD’: False, ‘DODGEBUSD’: False, ‘SOLBUSD’: False, ‘FTTBUSD’: False}
2022-07-01 16:38:09
2022-07-01 16:38:10
order side->BUY,last price ->{‘BTCBUSD’: ‘19258.8’, ‘ETHBUSD’: 0, ‘BNBBUSD’: 0, ‘ADABUSD’: 0, ‘XRPBUSD’: ‘0.3122’, ‘DODGEBUSD’: 0, ‘SOLBUSD’: 0, ‘FTTBUSD’: 0},TP->7966730493, SL->7966730374
main order->{‘orderId’: 7966730214, ‘symbol’: ‘BTCBUSD’, ‘status’: ‘NEW’, ‘clientOrderId’: ‘v9Lnp44sRkXuv8DrV400fC’, ‘price’: ‘0’, ‘avgPrice’: ‘0.0000’, ‘origQty’: ‘0.001’, ‘executedQty’: ‘0’, ‘cumQty’: ‘0’, ‘cumQuote’: ‘0’, ‘timeInForce’: ‘GTC’, ‘type’: ‘MARKET’, ‘reduceOnly’: False, ‘closePosition’: False, ‘side’: ‘BUY’, ‘positionSide’: ‘BOTH’, ‘stopPrice’: ‘0’, ‘workingType’: ‘CONTRACT_PRICE’, ‘priceProtect’: False, ‘origType’: ‘MARKET’, ‘updateTime’: 1656682691009}
TP->{‘orderId’: 7966730493, ‘symbol’: ‘BTCBUSD’, ‘status’: ‘NEW’, ‘clientOrderId’: ‘SrgGBPQq2XPEjlACQmHLwj’, ‘price’: ‘19300.1’, ‘avgPrice’: ‘0.0000’, ‘origQty’: ‘0.001’, ‘executedQty’: ‘0’, ‘cumQty’: ‘0’, ‘cumQuote’: ‘0’, ‘timeInForce’: ‘GTC’, ‘type’: ‘LIMIT’, ‘reduceOnly’: True, ‘closePosition’: False, ‘side’: ‘SELL’, ‘positionSide’: ‘BOTH’, ‘stopPrice’: ‘0’, ‘workingType’: ‘CONTRACT_PRICE’, ‘priceProtect’: False, ‘origType’: ‘LIMIT’, ‘updateTime’: 1656682691518}
SL->{‘orderId’: 7966730374, ‘symbol’: ‘BTCBUSD’, ‘status’: ‘NEW’, ‘clientOrderId’: ‘b5bA8cA6zjbh5EysEJntIc’, ‘price’: ‘0’, ‘avgPrice’: ‘0.0000’, ‘origQty’: ‘0.001’, ‘executedQty’: ‘0’, ‘cumQty’: ‘0’, ‘cumQuote’: ‘0’, ‘timeInForce’: ‘GTC’, ‘type’: ‘STOP_MARKET’, ‘reduceOnly’: True, ‘closePosition’: False, ‘side’: ‘SELL’, ‘positionSide’: ‘BOTH’, ‘stopPrice’: ‘19223.1’, ‘workingType’: ‘CONTRACT_PRICE’, ‘priceProtect’: False, ‘origType’: ‘STOP_MARKET’, ‘updateTime’: 1656682691265}
setting TP 7966730493 and SL 7966730374 for deal 7966730214
setting in_trade reg to true
{‘BTCBUSD’: True, ‘ETHBUSD’: False, ‘BNBBUSD’: False, ‘ADABUSD’: False, ‘XRPBUSD’: True, ‘DODGEBUSD’: False, ‘SOLBUSD’: False, ‘FTTBUSD’: False}
{‘s’: ‘BTCBUSD’, ‘c’: ‘E3YlGcOmsIdps9UPN8CP6q’, ‘S’: ‘BUY’, ‘o’: ‘MARKET’, ‘f’: ‘GTC’, ‘q’: ‘0.001’, ‘p’: ‘0’, ‘ap’: ‘0’, ‘sp’: ‘0’, ‘x’: ‘NEW’, ‘X’: ‘NEW’, ‘i’: 7966729467, ‘l’: ‘0’, ‘z’: ‘0’, ‘L’: ‘0’, ‘T’: 1656682690250, ‘t’: 0, ‘b’: ‘0’, ‘a’: ‘0’, ‘m’: False, ‘R’: False, ‘wt’: ‘CONTRACT_PRICE’, ‘ot’: ‘MARKET’, ‘ps’: ‘BOTH’, ‘cp’: False, ‘rp’: ‘0’, ‘pP’: False, ‘si’: 0, ‘ss’: 0}
{‘s’: ‘BTCBUSD’, ‘c’: ‘E3YlGcOmsIdps9UPN8CP6q’, ‘S’: ‘BUY’, ‘o’: ‘MARKET’, ‘f’: ‘GTC’, ‘q’: ‘0.001’, ‘p’: ‘0’, ‘ap’: ‘19257.6000’, ‘sp’: ‘0’, ‘x’: ‘TRADE’, ‘X’: ‘FILLED’, ‘i’: 7966729467, ‘l’: ‘0.001’, ‘z’: ‘0.001’, ‘L’: ‘19257.6’, ‘n’: ‘0.00577728’, ‘N’: ‘BUSD’, ‘T’: 1656682690250, ‘t’: 223587873, ‘b’: ‘0’, ‘a’: ‘0’, ‘m’: False, ‘R’: False, ‘wt’: ‘CONTRACT_PRICE’, ‘ot’: ‘MARKET’, ‘ps’: ‘BOTH’, ‘cp’: False, ‘rp’: ‘-0.03162500’, ‘pP’: False, ‘si’: 0, ‘ss’: 0}
{‘s’: ‘BTCBUSD’, ‘c’: ‘gIPNZrOsW1KfVTqH1SKmBN’, ‘S’: ‘SELL’, ‘o’: ‘STOP_MARKET’, ‘f’: ‘GTC’, ‘q’: ‘0.001’, ‘p’: ‘0’, ‘ap’: ‘0’, ‘sp’: ‘19223.1’, ‘x’: ‘NEW’, ‘X’: ‘NEW’, ‘i’: 7966729653, ‘l’: ‘0’, ‘z’: ‘0’, ‘L’: ‘0’, ‘T’: 1656682690503, ‘t’: 0, ‘b’: ‘0’, ‘a’: ‘0’, ‘m’: False, ‘R’: True, ‘wt’: ‘CONTRACT_PRICE’, ‘ot’: ‘STOP_MARKET’, ‘ps’: ‘BOTH’, ‘cp’: False, ‘rp’: ‘0’, ‘pP’: False, ‘si’: 0, ‘ss’: 0}
{‘s’: ‘BTCBUSD’, ‘c’: ‘v9Lnp44sRkXuv8DrV400fC’, ‘S’: ‘BUY’, ‘o’: ‘MARKET’, ‘f’: ‘GTC’, ‘q’: ‘0.001’, ‘p’: ‘0’, ‘ap’: ‘0’, ‘sp’: ‘0’, ‘x’: ‘NEW’, ‘X’: ‘NEW’, ‘i’: 7966730214, ‘l’: ‘0’, ‘z’: ‘0’, ‘L’: ‘0’, ‘T’: 1656682691009, ‘t’: 0, ‘b’: ‘0’, ‘a’: ‘0’, ‘m’: False, ‘R’: False, ‘wt’: ‘CONTRACT_PRICE’, ‘ot’: ‘MARKET’, ‘ps’: ‘BOTH’, ‘cp’: False, ‘rp’: ‘0’, ‘pP’: False, ‘si’: 0, ‘ss’: 0}
{‘s’: ‘BTCBUSD’, ‘c’: ‘v9Lnp44sRkXuv8DrV400fC’, ‘S’: ‘BUY’, ‘o’: ‘MARKET’, ‘f’: ‘GTC’, ‘q’: ‘0.001’, ‘p’: ‘0’, ‘ap’: ‘19256.2000’, ‘sp’: ‘0’, ‘x’: ‘TRADE’, ‘X’: ‘FILLED’, ‘i’: 7966730214, ‘l’: ‘0.001’, ‘z’: ‘0.001’, ‘L’: ‘19256.2’, ‘n’: ‘0.00577686’, ‘N’: ‘BUSD’, ‘T’: 1656682691009, ‘t’: 223587882, ‘b’: ‘0’, ‘a’: ‘0’, ‘m’: False, ‘R’: False, ‘wt’: ‘CONTRACT_PRICE’, ‘ot’: ‘MARKET’, ‘ps’: ‘BOTH’, ‘cp’: False, ‘rp’: ‘0’, ‘pP’: False, ‘si’: 0, ‘ss’: 0}
{‘s’: ‘BTCBUSD’, ‘c’: ‘b5bA8cA6zjbh5EysEJntIc’, ‘S’: ‘SELL’, ‘o’: ‘STOP_MARKET’, ‘f’: ‘GTC’, ‘q’: ‘0.001’, ‘p’: ‘0’, ‘ap’: ‘0’, ‘sp’: ‘19223.1’, ‘x’: ‘NEW’, ‘X’: ‘NEW’, ‘i’: 7966730374, ‘l’: ‘0’, ‘z’: ‘0’, ‘L’: ‘0’, ‘T’: 1656682691265, ‘t’: 0, ‘b’: ‘0’, ‘a’: ‘0’, ‘m’: False, ‘R’: True, ‘wt’: ‘CONTRACT_PRICE’, ‘ot’: ‘STOP_MARKET’, ‘ps’: ‘BOTH’, ‘cp’: False, ‘rp’: ‘0’, ‘pP’: False, ‘si’: 0, ‘ss’: 0}
{‘s’: ‘BTCBUSD’, ‘c’: ‘SrgGBPQq2XPEjlACQmHLwj’, ‘S’: ‘SELL’, ‘o’: ‘LIMIT’, ‘f’: ‘GTC’, ‘q’: ‘0.001’, ‘p’: ‘19300.1’, ‘ap’: ‘0’, ‘sp’: ‘0’, ‘x’: ‘NEW’, ‘X’: ‘NEW’, ‘i’: 7966730493, ‘l’: ‘0’, ‘z’: ‘0’, ‘L’: ‘0’, ‘T’: 1656682691518, ‘t’: 0, ‘b’: ‘0’, ‘a’: ‘19.3001’, ‘m’: False, ‘R’: True, ‘wt’: ‘CONTRACT_PRICE’, ‘ot’: ‘LIMIT’, ‘ps’: ‘BOTH’, ‘cp’: False, ‘rp’: ‘0’, ‘pP’: False, ‘si’: 0, ‘ss’: 0}

As you can see from the WebSocket, this order 7966729653 and 7966729467 that are placed, has not been requested by the HTTP command. I am printing all orders request and they are not amongst them. My stop loss order is 7966730374 and this 7966729653 is a duplicate.
My main order is 7966730214 and this 7966729467 is duplicate.

I am placing my orders with the following python code:

main_order = client.futures_create_order(symbol=ver4_part1_flask.data2[‘symbol’],side=ver4_part1_flask.data2[‘tv_side’], type=“MARKET”,quantity=self.amount[ver4_part1_flask.data2[‘symbol’]])
stop_loss_order = client.futures_create_order(symbol=ver4_part1_flask.data2[‘symbol’],side=ver4_part1_flask.data2[‘tv_oposite_side’],type=“STOP_MARKET”, quantity=self.amount[ver4_part1_flask.data2[‘symbol’]], reduceOnly=True,stopPrice=ver4_part1_flask.data2[‘tv_loss’])
take_profit_oder = client.futures_create_order(symbol=ver4_part1_flask.data2[‘symbol’],side=ver4_part1_flask.data2[‘tv_oposite_side’],type=“LIMIT”, timeInForce=‘GTC’, reduceOnly=True,quantity=self.amount[ver4_part1_flask.data2[‘symbol’]],price=ver4_part1_flask.data2[‘tv_profit’])
print(f"order side->{ver4_part1_flask.data2[‘tv_side’]},last price ->{self._last_price},TP->{take_profit_oder[‘orderId’]}, SL->{stop_loss_order[‘orderId’]}")…

Maybe the API does not like 3 HTTP requests at the same time ?
I saw that there is similar topic, but this guy baxsmaxbax, he is able to see that the 1st order is rejected then he places 2nd order, then the first gets filled and he is left with 2 orders.
My case is somehow different.
I will be glad if someone can help here.strong text

Thanks for feedback. I would suggest to contact customer support, they should be able to give more details of this order 7966729653 or any that you are confused with.

If there is no one who has similar problem, I will check the answer of dino as a solution in order to close this topic.