ninjabot icon indicating copy to clipboard operation
ninjabot copied to clipboard

Update orders status with user data stream

Open rodrigo-brito opened this issue 2 years ago • 3 comments

In the discussion https://github.com/rodrigo-brito/ninjabot/discussions/130, @davidxiao suggest to use Binance user stream instead of orders polling.

When we have orders with status PENDNG, the bot will poll from Binance the order status each second. It can be replaced by a stream that receive updates from Binance.

We found the logic here: https://github.com/rodrigo-brito/ninjabot/blob/1a3585bedbaf66ba35e9377635877aa688e5a1e0/order/controller.go#L278-L287

rodrigo-brito avatar Apr 02 '22 00:04 rodrigo-brito

hi, @rodrigo-brito ,

to confirm:

use Binance user stream as alternative? or replace polling with Binance user stream?

just in case there are any scenarios beyond my thoughts where polling is better, so keep polling is necessary,

davidxiao avatar Apr 02 '22 00:04 davidxiao

I think we can replace it.

rodrigo-brito avatar Apr 02 '22 01:04 rodrigo-brito

sorry, i can not work on this because i am busy with my other staff, considering it's only improvement and not urgent, so maybe close it,

davidxiao avatar May 15 '22 05:05 davidxiao