Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update orders status with user data stream #131

Open
rodrigo-brito opened this issue Apr 2, 2022 · 3 comments
Open

Update orders status with user data stream #131

rodrigo-brito opened this issue Apr 2, 2022 · 3 comments
Labels
env/core kind/improvement Refactorings, improvements and tunning

Comments

@rodrigo-brito
Copy link
Owner

rodrigo-brito commented Apr 2, 2022

In the discussion #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:

ticker := time.NewTicker(c.tickerInterval)
for {
select {
case <-ticker.C:
c.updateOrders()
case <-c.finish:
ticker.Stop()
return
}
}

@rodrigo-brito rodrigo-brito added kind/improvement Refactorings, improvements and tunning env/core labels Apr 2, 2022
@davidxiao
Copy link

davidxiao commented Apr 2, 2022

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,

@rodrigo-brito
Copy link
Owner Author

I think we can replace it.

@davidxiao
Copy link

davidxiao commented May 15, 2022

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/core kind/improvement Refactorings, improvements and tunning
Projects
None yet
Development

No branches or pull requests

2 participants