-
Notifications
You must be signed in to change notification settings - Fork 217
[binance] Possible to reduce the depth for the order book stream? #393
Comments
Hello @andrewlin0410 . In order to do that the BinanceStreaming implementation must support it or you can add it yourself. |
@andrewlin0410 the order book is 1000 prices deep at the moment I think. Do you want it smaller or larger? |
Smaller.
…On Fri, Aug 30, 2019, 2:06 AM Graham Crockford ***@***.***> wrote:
@andrewlin0410 <https://github.com/andrewlin0410> the order book is 1000
prices deep at the moment I think. Do you want it smaller or larger?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#393?email_source=notifications&email_token=AGNKPMKAORFSUVB4V224GDTQHDPKBA5CNFSM4IR3ZCH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5RCDUI#issuecomment-526524881>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGNKPMIEPDY7SIZENITECC3QHDPKBANCNFSM4IR3ZCHQ>
.
|
So you mean I have to change the library to do this?
…On Sat, Aug 31, 2019, 12:36 AM Andrew Lin ***@***.***> wrote:
Smaller.
On Fri, Aug 30, 2019, 2:06 AM Graham Crockford ***@***.***>
wrote:
> @andrewlin0410 <https://github.com/andrewlin0410> the order book is 1000
> prices deep at the moment I think. Do you want it smaller or larger?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#393?email_source=notifications&email_token=AGNKPMKAORFSUVB4V224GDTQHDPKBA5CNFSM4IR3ZCH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5RCDUI#issuecomment-526524881>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGNKPMIEPDY7SIZENITECC3QHDPKBANCNFSM4IR3ZCHQ>
> .
>
|
There is no way to limit the size of the order book on the Binance websocket API (I'm not sure that it would even be possible for them to add the feature due to the way the websocket updates work). It's not really an xchange-stream issue. If you need a limited order book, I suggest that you do so after the fact in your application code: add a |
Oh, just as a warning though: the above is only safe if your observable chain is single-threaded. |
If you add @Depth# to the web socket call you can change it. I hope you
guys enable the feature for library users to add this without changing the
library.
…On Sat, Aug 31, 2019, 1:28 AM Graham Crockford ***@***.***> wrote:
Reopened #393 <#393>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#393?email_source=notifications&email_token=AGNKPMMK2KQGYP3X4KRMLNDQHITS7A5CNFSM4IR3ZCH2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOTLSXUJQ#event-2598730278>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGNKPMIZKTZBVYENADKNIGTQHITS7ANCNFSM4IR3ZCHQ>
.
|
Hm, managing dropping orders off the end of a differential stream when you're not getting the full book sounds "hard". You notice that they still suggest fetching the entire book (1000 depth) for the initial snapshot. It'd need a lot of testing, which means someone needs to submit a PR who needs the problem solved. I don't yet understand the reason why you need this. Do you need to limit the bandwidth? Why is it not good enough just to strip off the orders you don't need afterwards? |
It would be useful to limit the initial snapshot from rest api. When you subscribe to many orderbooks, you'll hit rest api rate limit. Smaller orderbook snapshots allow you to make more calls. https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#order-book |
Assuming that you have a clever enough rate limiter plugged into It's an easy PR in theory, if someone wants to do it. I have a feeling that it's slightly trickier than it sounds though because of the need to manage the bottom of the order book as orders move on/off. |
Hi I wonder if I can set parameters like depth for order book streaming for Binance. Thanks in advance!
The text was updated successfully, but these errors were encountered: