binance / binance-connector-java

Simple Java connector to Binance Spot API
MIT License
399 stars 173 forks source link

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

Open mrksph opened 5 months ago

mrksph commented 5 months 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 5 months ago

@aisling-2