Giter VIP home page Giter VIP logo

kucoin-websocket's Introduction

kucoin-websocket

Multi-threaded KuCoin WebSocket with self-management mechanisms to ensure stable streaming at all times. More control and abstraction than the native kucoin-python-sdk.

Note This package is still under development and probably will not contain the full functionality described under KuCoin documentation!

Features

Subscription Strategy

According to KuCoin documentations, maximum number of batch subscriptions is 100 topics per 10 seconds. KuCoin policy is to ignore the rest of the subscriptions if the limitation is violated. To avoid this behavior, a configurable Backoff Strategy is used to keep congestion low while allowing for asynchronous subscription.

Auto-connect on Errors

There are numerous errors that can occur during the stream (KuCoin errors) that can interrupt the stream flow. Most of the errors are TimeOut or ConnectionClosed and such errors are generally not a big concern due to network volatility, so the WebSocket tries to reconnect at most 5 times before giving up.

Auto-Token Renewal

Currently, KuCoin tokens expire after 24 hours (KuCoin FAQ) and the stream is stopped immediately. To overcome this, WebSocket details like token and endpoint are renewed after an interval, so that the connection stays alive at all time. Default interval is set to 12 hours to leave no room for error.

Limitless Subscriptions

KuCoin has a limitation of maximum 300 active subscriptions at the time (KuCoin FAQ). To scale the subscriptions, multiple WebSockets are automatically created on parallel threads that at most 200 subscriptions. (to my experience, better not challenge the threshold ^_^)

Credits

๐Ÿค Contribution

Your contributions are welcomed, as always!

kucoin-websocket's People

Contributors

keivanipchihagh avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.