(feat) Add BingX spot candles and complete trading rules - #8450
Open
aMoonshine wants to merge 2 commits into
Open
aMoonshine wants to merge 2 commits into
aMoonshine wants to merge 2 commits into
Conversation
Register BingXSpotCandles in CandlesFactory ("bing_x"), which was
previously missing (official docs list Spot Candles Feed as
"Not built").
REST: GET https://open-api.bingx.com/openApi/spot/v2/market/kline with
dashed symbol (BTC-USDT), HB interval names, ms epoch startTime/endTime,
limit<=1440; rows arrive newest-first and are reversed into ascending
10-column candles.
WS: wss://open-api-ws.bingx.com/market, subscription
{"id": <uuid>, "reqType": "sub", "dataType": "<PAIR>@kline_<interval>"},
BingX interval vocabulary (1min..60min, 2hour..12hour, 1day, 3day,
1week). Frames are gzip-compressed; decompression reuses
decompress_ws_message from the bing_x connector utils. 1M is excluded
(BingX WS has no monthly kline). Rate limits mirror the bing_x
connector pools (GET/GET_BURST/GET_MIXED) for shared-throttler dedup.
Tests cover REST params, newest-first reversal, WS subscription
payload, WS field mapping (data.K), ack/text frame handling and gzip
decompression, plus factory registration.
Greptile SummaryAdds BingX spot candle support and broadens BingX trading-rule discovery to all active exchange symbols.
Confidence Score: 5/5The pull request appears safe to merge, with no concrete blocking or independently actionable non-blocking issue established. The new candle feed follows the shared factory, historical normalization, live-update, and throttling contracts, while the trading-rule change consistently uses active exchange metadata without an established downstream regression.
|
| Filename | Overview |
|---|---|
| hummingbot/connector/exchange/bing_x/bing_x_exchange.py | Loads active-symbol rules directly from exchange quantity and notional fields while removing per-symbol ticker requests; no actionable defect was established. |
| hummingbot/data_feed/candles_feed/bing_x_spot_candles/bing_x_spot_candles.py | Implements BingX REST and WebSocket candle normalization in the shared feed contract; reviewed lifecycle paths reveal no concrete failure. |
| hummingbot/data_feed/candles_feed/bing_x_spot_candles/constants.py | Defines endpoint, interval, result-limit, and linked-throttling configuration for the new feed. |
| hummingbot/data_feed/candles_feed/candles_factory.py | Registers the BingX spot candle implementation under the expected connector name. |
| test/hummingbot/data_feed/candles_feed/bing_x_spot_candles/test_bing_x_spot_candles.py | Covers REST parameters and ordering, WebSocket subscription vocabulary, field mapping, ignored frames, and gzip decompression. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CandlesConfig: bing_x] --> B[CandlesFactory]
B --> C[BingXSpotCandles]
D[BingX REST klines] --> C
E[BingX gzip WebSocket klines] --> C
C --> F[Ascending ten-column candle series]
G[BingX exchange info] --> H[BingXExchange]
H --> I[Active-symbol trading rules]
Reviews (1): Last reviewed commit: "(fix) load all BingX trading rules from ..." | Re-trigger Greptile
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.
Summary
Adds complete BingX spot market-data support for Hummingbot:
CandlesFactory("bing_x": BingXSpotCandles)Upstream, BingX is listed as "Not built" for the Spot Candles Feed, and its trading-rule formatter previously filtered to already-configured pairs only.
Implementation
hummingbot/data_feed/candles_feed/bing_x_spot_candles/GET https://open-api.bingx.com/openApi/spot/v2/market/kline— dashed trading pair (BTC-USDT), Hummingbot interval names, millisecondstartTime/endTime,limitcapped at 1440. BingX returns rows newest-first; the parser reverses them into ascending 10-column candles.wss://open-api-ws.bingx.com/market— subscription{"id": <uuid>, "reqType": "sub", "dataType": "<PAIR>@kline_<interval>"}using the BingX dataType vocabulary (1min, 3min, 5min, 15min, 30min, 60min, 2hour, 4hour, 6hour, 8hour, 12hour, 1day, 3day, 1week). Frames are gzip-compressed; decompression reusesdecompress_ws_messagefrom the existingbing_xconnector utils (no new dependency).1Mis intentionally not offered: BingX WS has no monthly kline, so a monthly feed would silently never stream.bing_xconnector request pools (GET / GET_BURST / GET_MIXED) so a shared throttler deduplicates when the connector is attached to the feed.1hour/1M, push shape{"code":0,"data":{"e":"kline","s":"BTC-USDT","K":{...}}}, gzip framing, no client ping required).Trading rules
data.symbols, rather than filtering byself.trading_pairs.minQty,maxQty,minNotional,tickSize, andstepSizevalues.Testing
data.K, ack/text frames ignored, gzip decompression, and factory registration).aiohttp 3.14.x+aioresponses 0.7.9(latest published release),test_fetch_candlesfails identically for ALL candle feeds (pre-existing ecosystem incompatibility, unrelated to this PR). Tests are green againstaiohttp 3.12.15+aioresponses 0.7.9.