binance / binance-connector-java

MIT License
368 stars 157 forks source link

Set the Update Speed for Web Sockets Stream API? #112

Open mrksph opened 1 month ago

mrksph commented 1 month ago

Hi,

Looking the documentation for Web Socket Stream API I can see that the Update Speed for most of the streams is 1000ms which I think is too high.

Inspecting the Binance home page with the devtools I can see they are using the following stream image

So I was thinking if there is a way to configure the update speed for a given stream? I see that the current api exposes separate methods for each stream so it would involve including a new parameter to specify the update speed, if possible

E.g.:

webSocketStreamClient.allRollingWindowTicker("1h", "3000", (event) -> {
        try {
            symbolDataSocketHandler.broadcast(event);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
});
mrksph commented 1 month ago

@aisling-2