Closed grepsuzette closed 1 year ago
Some more info, using 100 symbols as below it works,
Works:
channels = [CANDLES]
f = FeedHandler()
f.add_feed( KuCoin( symbols=pairs[0:100], channels=channels, callbacks={CANDLES: CandleCallback(candle)}))
f.add_feed( KuCoin( symbols=pairs[100:200], channels=channels, callbacks={CANDLES: CandleCallback(candle)}))
...
f.add_feed( KuCoin( symbols=pairs[1100:1200], channels=channels, callbacks={CANDLES: CandleCallback(candle)}))
f.add_feed( KuCoin( symbols=pairs[1200:1300], channels=channels, callbacks={CANDLES: CandleCallback(candle)}))
as soon as >=101 symbols are used, it gives the {code:509, data:'exceed max permits per seconds'}
.
The labelling of the error is weird (suggests too much bytes sent per seconds).
python.py
has:
def __init__(self, **kwargs):
address_info = self.http_sync.write('https://api.kucoin.com/api/v1/bullet-public', json=True)
token = address_info['data']['token']
address = address_info['data']['instanceServers'][0]['endpoint']
address = f"{address}?token={token}"
self.websocket_endpoints = [WebsocketEndpoint(address, options={'ping_interval': address_info['data']['instanceServers'][0]['pingInterval'] / 2000})]
super().__init__(**kwargs)
if any([len(self.subscription[chan]) > 300 for chan in self.subscription]):
raise ValueError("Kucoin has a limit of 300 symbols per connection")
self.__reset()
For me on kucoin, a limit of 300 works for trades, but not for candles.
Describe the bug
While I encounter no problems with TRADE, it is different with CANDLES. I am getting this
'code': 509, 'data': 'exceed max permits per 10 seconds'
error.To Reproduce
Operating System: Linux Debian
Cryptofeed Version Pip installed, cryptofeed 2.2.0