cryptofeed icon indicating copy to clipboard operation
cryptofeed copied to clipboard

fix #838 kucoin websocket: raise if >100 symbols for candles

Open grepsuzette opened this issue 2 years ago • 1 comments

keep general limit of 300 for other types of channels

Description of code - what bug does this fix / what feature does this add?

  • [X ] - Tested
  • [ X] - Changelog updated
  • [ ] - Tests run and pass
  • [ ] - Flake8 run and all errors/warnings resolved
  • [ ] - Contributors file updated (optional)

Test

from cryptofeed.defines import TRADES
from cryptofeed.defines import CANDLES
from cryptofeed.exchanges import KuCoin
from cryptofeed.feedhandler import FeedHandler
from cryptofeed.callback import TradeCallback
from cryptofeed.callback import CandleCallback

async def candle(*args):
    print(args)
    
pairs = KuCoin.info()['symbols']
f.add_feed( KuCoin( symbols=pairs[0:100], channels=[CANDLES], callbacks={CANDLES: CandleCallback(candle)}))
f.add_feed( KuCoin( symbols=pairs[100:200], channels=[CANDLES], callbacks={CANDLES: CandleCallback(candle)}))
f = FeedHandler()
  • pairs[0:101] raises an exception (similar to the 300 limit in the non-CANDLES case)
  • pairs[0:100] works

Without this fix,

  • pairs[0:101] fails see #838

grepsuzette avatar May 02 '22 03:05 grepsuzette

@grepsuzette the tests are failing. I'm not sure if this is because kucoin limited the number of subs or not, but it used to support that many. I know its not working for candles, but does it impact trades and other data channels?

bmoscon avatar May 09 '22 23:05 bmoscon

as this PR is quite old and no one has resolved the issues with it, closing

bmoscon avatar Nov 05 '23 16:11 bmoscon