How to lower latency with cryptocurrency trading server with Kraken exchange

Learn the Secret

GetĀ  our 2 Free Books

Get these now which land directly to their inbox.
Invalid email address
(Last Updated On: January 18, 2021)

Here are some questions regarding my services and courses: (here are some tips on where to setup a remote cloud traing server)

Here is the links (for now):

Access the DVD and Private Chat server

dvd

Here is the Python infrastructure course talked about (this link will also change in the in near term)

Here is the set of queries from someone:

Get some free tech trading book https://quantlabs.net/

Talk to me about your trading https://quantlabs.net/questions/

Get lifetime access to our private chart server? https://quantlabs.net/dvd/

Here is the corespondent

Hi Bryan,

Ok, I have done enough solo work… I’m ready to jump in the Quant Lab team!

Ok, so based on what you wrote,

without having the exact implementation details that you do use, your python algo trading class is covering :

Fibonacci, Bollingers and how to calculate a trend line like the one your script reportTA generates (and much more, I assume)

and the course would give good knowledge on how to do it myself. Correct?

2. I did ask Kraken reps themselves about what someone could do to have good latency with their service and they told me the following:

Low Latency Options


For our exchange REST and WebSocket APIs, we recommend hosting your API client at AWS in California.

Of course, as you know, AWS sucks. They offer only old platforms like CentOS 6 (based on 2.6.32 kernel!)

The problem is that Kraken is behind Cloudflare. When you do a DNS lookup on their servers, you get a Cloudflare IP. Their network topology is totally opaque to regular net tools. You either have insider knowledge from Cloudflare, or you figure it out with trial and errors. Let me show you something.

ping numbers from MTL:

$ ping ws-auth.kraken.com

PING ws-auth.kraken.com (104.16.212.191) 56(84) bytes of data.

64 bytes from 104.16.212.191 (104.16.212.191): icmp_seq=1 ttl=60 time=0.652 ms

64 bytes from 104.16.212.191 (104.16.212.191): icmp_seq=2 ttl=60 time=12.8 ms

64 bytes from 104.16.212.191 (104.16.212.191): icmp_seq=3 ttl=60 time=0.430 ms

64 bytes from 104.16.212.191 (104.16.212.191): icmp_seq=4 ttl=60 time=0.449 ms

64 bytes from 104.16.212.191 (104.16.212.191): icmp_seq=5 ttl=60 time=0.488 ms

64 bytes from 104.16.212.191 (104.16.212.191): icmp_seq=6 ttl=60 time=0.461 ms

64 bytes from 104.16.212.191 (104.16.212.191): icmp_seq=7 ttl=60 time=0.484 ms

^C

— ws-auth.kraken.com ping statistics —

7 packets transmitted, 7 received, 0% packet loss, time 6010ms

rtt min/avg/max/mdev = 0.430/2.258/12.844/4.322 ms

ping from vultr LAX site:

$ ping ws-auth.kraken.com

PING ws-auth.kraken.com (104.16.215.191) 56(84) bytes of data.

64 bytes from 104.16.215.191 (104.16.215.191): icmp_seq=1 ttl=58 time=0.783 ms

64 bytes from 104.16.215.191 (104.16.215.191): icmp_seq=2 ttl=58 time=0.860 ms

64 bytes from 104.16.215.191 (104.16.215.191): icmp_seq=3 ttl=58 time=0.794 ms

64 bytes from 104.16.215.191 (104.16.215.191): icmp_seq=4 ttl=58 time=0.412 ms

^C

— ws-auth.kraken.com ping statistics —

4 packets transmitted, 4 received, 0% packet loss, time 3004ms

rtt min/avg/max/mdev = 0.412/0.712/0.860/0.175 ms

That looks like pretty solid #s right, they fool you. They represent the ping time you get from the nearest Cloudflare proxy.

I use Kraken WS updates ts and I measure the difference between a book entry introduction and the order open timestamp as reported by the exchange ack msg (assuming my bot reaction time is negligeable. it is by being less than 1ms).

From Montreal, I was having interval of 140ms

So far since this morning, the best RTT that I did measure from LAX was 60ms.

It is much better but I’m not yet 100% satisfied as, again with the help of Kraken updates timestamps, I know that some traders are able to get roughly a 35-40ms RTT…

If there is more than 1 trader doing triangular arbitrage, the fastest one reap it all…

Yes, it is very tough… The concept is simple but there is a lot of problems in the details…

I have been on it for the last year and it starts to work… I have worked out most of the pitfalls.

3. I’ll take a look at Lnode but TBH, I don’t really care about customer service… I mostly care about the product and I have been impressed a lot by vultr. In less than in an hour, I was up and running with a fresh server install with exactly the same environment than my dev env. My previous server in mtl was CentOS 7 (My webserver) and it was pain to rebuild my bot for that different env. With vultr machine, I just need to upload the binary that I have compiled on my desktop and it works out of the box with the added security benefit of not having to move my source code containing my secret sauce and my exchange accoutn keys on a different machine.

I need to find the data center that is going to provide me a latency that is less than 10ms… If I can find that, I’ll do my own customer service šŸ˜‰

Hey, I have found this blog:

https://www.sissoftwarefactory.com/blog/

very interesting stuff…

To wrap things up:

1. Is your python algo trading course is going to meet my needs of learning the indicators that you show in your videos?

2. What is the product granting access to your signal service?

Last fall summer didn’t quite exactly answer the question that I have.

The Python scripts that you do show in the video,

ccxt_market_data2.py

reportTA.py

I am interested in learning in the indicators that you do use:

The Fibonacci levels

Bollinger bands

The green Trend line that you draw in the *Trend.png

So do you confirm that in the “DVD” product, you will teach those topics (and perhaps also maybe share those 2 scripts)?

Beside the purchase of the DVD, what else do I need to purchase to be granted access to the signal service?

And why 2 distinct sets of signals? Binance ones arent good on Kraken and vice-versa??

BTW, after having viewed your video yesterday, I did create a ArchLinux VM with Vultr in the LAX region.

It did reduce my latency with Kraken from 140ms RTT with my Montreal server to something between 20-30ms RTT!

Lately, I was getting front-runned systematically on most of my triangular arbitrage trades, that was not fun…

I feel like now it is going much more profitable…

My setup is up and running but it hasn’t been triggered yet…(This strategy gets triggered in burst. It can be very quiet and start trading like crazy for short periods)

I’m very eager to see it in action! I did refine my system since last email exchange… I was struggling to reach $xx monthly trade volume. I got that milestone in the first few days of 2021 and I am about break the $xxx level… However, there is more volume than profit… (Not good)…

I need help from a team of liked minded individuals… I’m ready to join your team

Bottomline, I benefitted big time of that video. Thanks a lot! (I didn’t know about Vultr and they are much better than AWS…)

And, this is to be considered… I have way too much power on the VM. I took the 3 CPU High frequency setup. This thing is a beast. In fact, you don’t have 3 CPUs, you get 6 with the Hypethread thing… Despite processing millions of updates, I do use less than 10% CPU out of 600%!

If you have a hard time finding the right environment… Setting you an account on my VM could maybe be an option…

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!
This entry was posted in Bitcoin Crypto Currency, Quant Development on by .

About caustic

Hi i there My name is Bryan Downing. I am part of a company called QuantLabs.Net This is specifically a company with a high profile blog about technology, trading, financial, investment, quant, etc. It posts things on how to do job interviews with large companies like Morgan Stanley, Bloomberg, Citibank, and IBM. It also posts different unique tips and tricks on Java, C++, or C programming. It posts about different techniques in learning about Matlab and building models or strategies. There is a lot here if you are into venturing into the financial world like quant or technical analysis. It also discusses the future generation of trading and programming Specialties: C++, Java, C#, Matlab, quant, models, strategies, technical analysis, linux, windows P.S. I have been known to be the worst typist. Do not be offended by it as I like to bang stuff out and put priorty of what I do over typing. Maybe one day I can get a full time copy editor to help out. Do note I prefer videos as they are much easier to produce so check out my many video at youtube.com/quantlabs