3 min read

🦑 Automatically Track Kraken Cost Basis in Google Sheets

About 6 months ago I released a free Google Sheet that will automatically pull in your cryptocurrency trades from Coinbase Pro and Gemini (and a little help from a Python script and AWS automation) - the full tutorial to use this spreadsheet is in the video below

I architected the Google Sheet and Python script with the forethought that, one day, we'll probably want to see transactions from even more cryptocurrency exchanges added to the spreadsheet.

Today I'm releasing the code and spreadsheet updates that will make it possible to pull in your Kraken transaction data.

If you use Kraken feel free to grab the code and spreadsheet updates below. If you're interested in how this works I'll leave a brief description at the bottom of this post.

I'm not a Kraken power user in the same way that I am with Gemini, so if there are issues that come about with large numbers of transactions (or really anything else) feel free to DM me on Twitter @rhettre and I'll do my best to help you debug :)

Updated Kraken Code:

I built this script to populate trades made in any trading pair available on Coinbase Pro or Gemini into a Google Sheet so it would be easier to track trades, profitability, and cost basis. This could be extended to other exchanges. See [video](https://www.youtube.com/watch?v=hutDJ-FVatw) for full explanation.
I built this script to populate trades made in any trading pair available on Coinbase Pro or Gemini into a Google Sheet so it would be easier to track trades, profitability, and cost basis. This c...

Updated Base Sheet:

Google Sheets: Sign-in

Notes + Housekeeping:

I'll be updating major code packages through the blog from now on so consider subscribing (it's free!)

I plan to leave video updates for major release changes rather than making a new video for incremental code changes (because I don't think uploading very slightly different videos over and over again on YouTube is going to help the channel grow - it's boring 🤷🏻‍♂️)

The script changes for Kraken are very similar to the script methods we used for Coinbase Pro and Gemini - the big difference is that Kraken doesn't order their transactions IDs a way that I understood.

The transaction 'ordertxid' that came out of my Kraken were of the form: OQ2J2K-XPEAY-SSJ2DQ or OPLDN3-6V2VN-M64UNH.

It didn't seem obvious how to tell which one came first so I resorted to ordering them by the server time (rounded to the nearest integer - I don't expect that to be a problem but there might be a better way to order the transactions).

Ordering the transactions is important to make sure that the sheet is only ever updated with transactions that happen AFTER the most recent transaction in the sheet (for the given Exchange and Trading Pair / Symbol)

Hopefully this was helpful for some of you who are using Kraken - more spreadsheet updates coming soon.