Describe the bug
In cryptofeed v2.4.1, the KuCoin exchange adapter constructs WebSocket subscription topics with a space after the colon delimiter:
KuCoin’s WebSocket API requires the topic to be formatted without whitespace:
As a result, KuCoin returns:
{'id': '1', 'type': 'error', 'code': 400, 'data': 'topic /market/match: BTC-USDT is invalid'}
This affects both single-symbol and multi-symbol subscriptions and causes all trade subscriptions to fail.
To Reproduce
Small reproducible example:
from cryptofeed import FeedHandler
from cryptofeed.defines import TRADES
from cryptofeed.exchanges import KuCoin
async def trade(t, receipt_timestamp):
print(t)
fh = FeedHandler()
fh.add_feed(
KuCoin(
symbols=["BTC-USDT"],
channels=[TRADES],
callbacks={TRADES: trade},
)
)
fh.run()
Observed error:
WARNING: KUCOIN: error from exchange {
'id': '1',
'type': 'error',
'code': 400,
'data': 'topic /market/match: BTC-USDT is invalid'
}
Inspection of cryptofeed/exchanges/kucoin.py (v2.4.1) shows:
'topic': f"{chan}: {','.join(...)}"
The space after : results in an invalid topic string per KuCoin’s API grammar.
Expected behavior
The KuCoin adapter should emit:
without whitespace after the colon, matching KuCoin’s documented topic format.
Subscriptions should succeed and trades should stream normally.
Screenshots
N/A
Operating System:
Linux (reproduced on x86_64)
Cryptofeed Version
2.4.1 (installed from PyPI via pip)
Describe the bug
In cryptofeed v2.4.1, the KuCoin exchange adapter constructs WebSocket subscription topics with a space after the colon delimiter:
KuCoin’s WebSocket API requires the topic to be formatted without whitespace:
As a result, KuCoin returns:
This affects both single-symbol and multi-symbol subscriptions and causes all trade subscriptions to fail.
To Reproduce
Small reproducible example:
Observed error:
Inspection of
cryptofeed/exchanges/kucoin.py(v2.4.1) shows:The space after
:results in an invalid topic string per KuCoin’s API grammar.Expected behavior
The KuCoin adapter should emit:
without whitespace after the colon, matching KuCoin’s documented topic format.
Subscriptions should succeed and trades should stream normally.
Screenshots
N/A
Operating System:
Linux (reproduced on x86_64)
Cryptofeed Version
2.4.1 (installed from PyPI via pip)