Repository navigation
Fix Binance futures L2_BOOK stream name for the default 250ms interval - #1136
Merged
bmoscon merged 1 commit intoSep 26, 2026
Merged
Conversation
bmoscon
approved these changes
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of code - what bug does this fix / what feature does this add?
BinanceFuturesandBinanceDeliverylist'250ms'invalid_depth_intervals. Withdepth_interval='250ms',_stream_names()subscribes to<symbol>@depth@250ms. Binance accepts that subscription but never sends data on it, soL2_BOOKproduces nothing and no error is raised.250ms is Binance's default diff-depth speed on the futures endpoints, and it's served on the bare
<symbol>@depthstream. This PR adds adefault_depth_intervalclass attribute:'250ms'onBinanceFuturesandBinanceDelivery,NoneonBinanceBase._stream_names()leaves out the suffix when the configured interval equals it. Spot is unchanged;@1000msand the bare stream both work there.Live check on 2026-09-26, median gap between
Eof consecutive events:fstream /publicbtcusdt@depthfstream /publicbtcusdt@depth@250msfstream /publicbtcusdt@depth@100msfstream /publicbtcusdt@depth@500msdstreambtcusd_perp@depthdstreambtcusd_perp@depth@250msstream.binance.combtcusdt@depth@1000msWith this branch, a
FeedHandlerwithBinanceFuturesandBinanceDeliveryatdepth_interval='250ms'received L2_BOOK deltas every 252 ms and 260 ms (median over 12 s).tests/unit: 68 passed; the new test fails on master for the two 250ms cases)ruff checkpasses on changed files; flake8 shows only existing E501/W391 in untouched lines)