bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.14k stars 666 forks source link

How are request rate limits implemented in cryptofeed. I looked into the feedhandler code, exchange code and some individual exchanges code - couldnt find it. #1033

Closed INFINITY-RESEARCH-CODE-BASE closed 2 months ago

INFINITY-RESEARCH-CODE-BASE commented 2 months ago

Im trying to persist trade and L2 data for around 300 symbols in a single exchange (PERPs).

2024-05-08 23:59:45,712 : ERROR : GATEIO_FUTURES.http.202: Status code 429 for URL https://api.gateio.ws/api/v4/futures/usdt/order_book?contract=LPT_USDT&limit=100&with_id=true 2024-05-08 23:59:45,712 : ERROR : GATEIO_FUTURES.http.202: Headers: <CIMultiDictProxy('Date': 'Wed, 08 May 2024 15:59:45 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'openresty', 'X-Gate-RateLimit-Requests-Remain': '0', 'X-Gate-RateLimit-Limit': '200', 'X-Gate-RateLimit-Reset-Timestamp': '1715183994', 'X-Out-Time': '1715183985859542', 'X-In-Time': '1715183985856356')> 2024-05-08 23:59:45,713 : ERROR : GATEIO_FUTURES.http.202: Resp: {"message":" Request Rate Limit Exceeded (003)","label":"TOO_MANY_REQUESTS"}

bmoscon commented 2 months ago

the library doesnt in a lot of cases, it likely doesnt for this exchange.