Skip to content

fix(ws): use Binance USD-M /market stream path for swap feeds - #421

Closed
buildwithpnj wants to merge 1 commit into
OpenByteInc:mainfrom
buildwithpnj:fix/binance-usdm-ws-paths-and-audit
Closed

buildwithpnj wants to merge 1 commit into
OpenByteInc:mainfrom
buildwithpnj:fix/binance-usdm-ws-paths-and-audit

Conversation

@buildwithpnj

Copy link
Copy Markdown
Contributor

Summary

Updates PublicMarketPriceFeed._url for Binance USD-M futures (swap) streams from the retired root path wss://fstream.binance.com/stream?streams=... to wss://fstream.binance.com/market/stream?streams=... so @markPrice@1s swap feeds receive live ticks instead of falling back to REST polling.

Related issue

Changes

  • Updated host in backend_api_python/app/services/market_price_stream.py (_url) to "wss://fstream.binance.com/market" when swap is true (keeping spot on wss://stream.binance.com:9443).
  • Added test_binance_public_price_feed_uses_market_prefix_for_swap in backend_api_python/tests/test_market_price_stream.py.

Test plan

  • Relevant pytest tests pass (pytest --noconftest tests/test_market_price_stream.py tests/test_execution_stream_adapters.py -q — 44 passed in 0.42s; ruff check --select F,E9 passed)
  • Commit signed off (Signed-off-by) for DCO

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binance USD-M WebSocket streams send nothing on the legacy fstream paths, so live prices and perp candles always fall back to REST

2 participants