Futures: placed and executed orders notifications

Hello, I’m developing futures Python bot, and I’m curios which code can in realtime update me on just executed futures orders, and which code can update me on successful placement of new order?
I’m tending to use this module:

from binance.websocket.futures.websocket_client import FuturesWebsocketClient as WebsocketClient

but at the moment I’m a bit lost. Can anybody help? Thanks in advance

Which library are you referring to?

Chai, I’m trying to use GitHub - Binance-docs/binance-futures-connector-python

but I’m open to consider any other options. I just need instant notifications on executed orders and ability to check that new order was successfully placed in order book.

If somebody can share blocks of Python code for this it will be very helpful.

You can listen to new order using the user data stream, example is shown via above link

Thanks a lot, Chai! I have added

ws_client.start()

ws_client.user_data(
listen_key=response[“listenKey”],
id=1,
callback=message_handler,
)

and I have all I need in user_data variable.

Unfortunately it’s now working stable - I’m getting orders only for about an hour, after that I’m getting only pages of such logging (without any updates on executed orders):

INFO:root:Received Pong from server
INFO:root:Received Pong from server
INFO:root:Received Ping from server
INFO:root:Responded Pong to server
INFO:root:Received Ping from server
INFO:root:Responded Pong to server
INFO:root:Received Ping from server
INFO:root:Responded Pong to server
INFO:root:Received Ping from server
INFO:root:Responded Pong to server

I have tried to execute each 30 minutes command client.ping() but it doesn’t help. What I should do to keep this notifications stable for weeks? Shall I still execute client.ping() with some interval and shall I do something each 24 hours?

You can check it GitHub - PiyushDixit96/binance-futures-fill-notification: [binance future order trade fill notification] Telegram Notification for Binance future positions.