question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There are some bugs in the Kucoin exchange

See original GitHub issue

Exchange Kucoin Subscription type Level2orderbook Describe the bug The l2snapshot event doesn’t emit the market, like all other exchanges do. This is a simple fix at line 399: this.emit("l2snapshot", snapshot); -> this.emit("l2snapshot", snapshot, market);

Second bug / feature is that with Kucoin or the code emits orderbook updates one by one? Simple test is to do the following: kucoin.on("l2update", (update, market) => { console.log(“Handling response”); setTimeout(()=>console.log(“After response”), 0); });` And then you often see multiple “handling response” without an after response after? It also seems weird if kucoin sends every orderbook update one by one? While documentation suggests multiple updates might come in one message? https://docs.kucoin.com/#level-2-market-data

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bmancini55commented, Aug 15, 2020

The plan is by end of this upcoming week. The Kucoin L3 support and a few other issues are on the remaining list before we cut this next huge release.

0reactions
WoutervDijkcommented, Aug 20, 2020

@bmancini55 I have tried your L3 prototype OB and I have also built one myself, but both of them lose quite a lot of messages it seems. I think at least every minute (so the sequenceId gets out of sync). To recreate the bug, just run your code and you should have an “out of sync, expected ${ob.sequenceId + 1}, got ${update.sequenceId}” error fast. const ccxws = require("ccxws"); const KucoinOrderBook = require("ccxws/src/orderbooks/KucoinOrderBook"); let market = {id: "BTC-USDT", base: "BTC", quote: "USDT"}; let updates = []; let ob; const client = new ccxws.Kucoin(); client.subscribeLevel3Updates(market); client.on("l3snapshot", snapshot => { ob = new KucoinOrderBook(snapshot, updates); }); client.on("l3update", update => { // enqueue updates until snapshot arrives if (!ob) { updates.push(update); return; } // validate the sequence and exit if we are out of sync if (ob.sequenceId + 1 !== update.sequenceId) { console.log(out of sync, expected ${ob.sequenceId + 1}, got ${update.sequenceId}); process.exit(1); } // apply update ob.update(update); }); ^^ The exact code I ran. The only thing I found about it as of right now, was someone who used python : https://github.com/Kucoin/kucoin-api-docs/issues/44#issuecomment-477105864

EDIT: Running on Node v14.7 on Windows 10

~~Really random guess, could be a fault in WS package and this could be the fix? https://github.com/websockets/ws/commit/e1349c047d7f1c120ca606364e35d5c4c627c599~~ Tried it myself didn’t work unfortunately

Could you reopen the issue please or should I open a new issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kucoin down? Current problems and outages - Downdetector
Real-time problems and outages for Kucoin. Is the website down? Trading not working? Here you see what is going on.
Read more >
Hacken & KuCoin: pentests and bug bounties as CEXs' keys ...
KuCoin's team introduced some fixes recommended by Hacken and during the first remediation check, our specialists detected 24 security flaws ...
Read more >
Get 24/7 Customer Service from KuCoin Support Team
Looking for support on KuCoin? Get your problems solved quickly through the help center. Our customer service is available 24/7 all year round....
Read more >
Register & Login Issues - KuCoin
If you are new to the platform, this article will guide you on registering an account and logging in to access the service...
Read more >
KuCoin Security Incident Update
KuCoin Security Incident Update ... Dear KuCoin Users,. We detected some large withdrawals since September 26, 2020 at 03:05:37 (UTC+8). According ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found