Skip to content

feat: split USDⓈ-M futures WebSocket URLs into public/market/private#701

Open
pcriadoperez wants to merge 4 commits intoccxt:masterfrom
pcriadoperez:feat/futures-ws-url-split
Open

feat: split USDⓈ-M futures WebSocket URLs into public/market/private#701
pcriadoperez wants to merge 4 commits intoccxt:masterfrom
pcriadoperez:feat/futures-ws-url-split

Conversation

@pcriadoperez
Copy link
Copy Markdown
Contributor

@pcriadoperez pcriadoperez commented Apr 6, 2026

Summary

  • Migrates USDⓈ-M Futures WebSocket connections from legacy wss://fstream.binance.com/ws to the new dedicated endpoints per Binance announcement (2026-03-06):
    • /public — depth, partialDepth, rpiDepth (high-frequency order book data)
    • /market — aggTrades, candles, ticker, allTickers, liquidations, allLiquidations, allMarkPrices, customSubStream
    • /private — futuresUser (listenKey-based user data streams)
  • Adds granular config options: wsFuturesPublic, wsFuturesMarket, wsFuturesPrivate
  • Existing wsFutures option remains as blanket override for backward compatibility
  • Legacy URLs will be permanently retired on 2026-04-23

Binance is retiring the legacy fstream.binance.com/ws endpoint on
2026-04-23. This migrates to the new dedicated endpoints:

- /public  → depth, partialDepth, rpiDepth (high-frequency order book)
- /market  → aggTrades, candles, ticker, liquidations, markPrices, etc.
- /private → user data streams (listenKey-based)

Adds wsFuturesPublic, wsFuturesMarket, wsFuturesPrivate config options.
The existing wsFutures option remains as a blanket override for all three.
Adds all streams from Binance's endpoint mapping that were not
previously implemented:

Public:
- futuresBookTicker, futuresAllBookTickers

Market:
- futuresMarkPrice (individual symbol, supports 1s update speed)
- futuresContinuousCandles (pair + contractType klines)
- futuresCompositeIndex (index composition data)
- futuresContractInfo (contract listing/status changes)
- futuresAssetIndex, futuresAllAssetIndex (multi-assets mode)
@pcriadoperez pcriadoperez marked this pull request as ready for review April 6, 2026 01:31
…ix flaky checkFields test

Shared functions (candles, ticker, allTickers, aggTrades) now explicitly
route futures variator to endpoints.futuresMarket instead of relying on
endpoints.futures coincidentally pointing to /market/ws.

Also fix checkFields to use `field in object` instead of `t.truthy(value)`
so fields with valid falsy values like `trades: 0` don't cause failures.
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.

1 participant