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.

[Kraken] Orderbooks are getting crossed under load

See original GitHub issue

KrakenOrderbookExample

` List<CurrencyPair> currencyPairs = Lists.list(CurrencyPair.BTC_USD, CurrencyPair.LTC_USD, CurrencyPair.ETH_USD, CurrencyPair.BTC_EUR);

    currencyPairs.forEach(cp -> {
        krakenExchange
                .getStreamingMarketDataService()
                .getOrderBook(cp)
                .subscribe(
                        s -> {

// LOG.info(“Received {}”, s);

                            if (s.getBids().get(0).getLimitPrice().compareTo(s.getAsks().get(0).getLimitPrice()) >= 0)
                                LOG.error("CROSSED book");
                        },
                        throwable -> {
                            LOG.error("Fail to get ticker {}", throwable.getMessage(), throwable);
                        });

    });

`

CROSSED book is hit after a few seconds

With one book it is fine, discovered in my system, a few days/weeks ago. Now replicated here.

@nielsdraaisma

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
nielsdraaismacommented, Jun 2, 2021

Update on this, this was a tricky to resolve as some of the unsubsribe/subscribe logic didn’t work as expected, resulting in the orderbook cutoff not to work as expected. The implementation as proposed in https://github.com/knowm/XChange/pull/4063 works as expected and I have seen various succesfull checksum pickups followed by reconnects as expected, with zero crossed books in the resulting stream.

2reactions
mdvxcommented, May 31, 2021

What ever the bug, I think it effects more than just Kraken, I saw similar on another exchange

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to maintain a valid order book - Kraken Support
Delete messages change the price levels within the order book by removing the affected price level (from the order book entirely, not just...
Read more >
1. Order Book, Limit Order, Market Order - Kraken Futures
Welcome to the Kraken Futures "Introduction to Crypto Futures" series!The goal of this series is to share a simple introduction to the key ......
Read more >
Interpreting an Order Book (example Kraken.com)
... your BTC position and increase your USD position by selling the pair. You can just multiply by the number of decimals to...
Read more >
Crypto Arbitrage Trading: How to Make Low-Risk Gains
Here, instead of an order book system where buyers and sellers are matched ... before going ahead with cross-exchange arbitrage trades.
Read more >
Octopus Kraken Cross Stitch Pattern Beach Ocean ... - Etsy
Listed on Sep 24, 2022. ... Please contact the seller about any problems with your order. ... Kraken Cross Stitch Pattern , Octopus...
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