GBTC Estimator Update

I spent some time this weekend working on my GBTC price predictor. The original idea behind this tool is to take the price action of BTC while the market is closed and use it to predict what will happen to the price of GBTC after the market opens. The original implementation uses the last close price of GBTC, and the price of BTC at the same time, then calculates the premium. It then retrieves the current price of BTC, then uses the calculated premium to determine what the current price of GBTC should be. It’s rather rudimentary, but serves as a quick and dirty calculator.

My hunch is that there are huge arbitrage opportunities to be found within the price action, especially when there are big moves in BTC’s price action. The big unknown, however, is the GBTC premium. The actual underlying value of a GBTC share is 0.009BTC, but the actual trading price fluctuates around 0.0012, so there’s some possibility to take advantage of this spread. We’re talking about the possibility of potential dollars in share price.

GBTC premium. NAV is <0.0009.

For example this morning, our calculation, based on the price of BTC at $7157, is that GBTC should be at $7.98-8.01 range. Here’s the current premarket spread.

The 7.82 bid order was quantity 800 about half an hour before open. Here’s the chart about five minutes after open.

The difficulty that we’re facing right now is matching the price action between the equity, GBTC, and the underlying crypto, BTC. For our inital purposes, it was enough to use the daily OHLCV data for the equity, and hourly data for the crypto. We only needed to track the crypto price at market close to get our initial premium value. But to do a proper arbitrage bot, we’ll need minute-by-minute data. This presents problems, since all of our work through the TDAmeritrade API has been via the REST API, and this work will involve streaming data via websockets, and likely some async programming.

It would be nice to be able to see the intraday price action of the GBTC premium. Right now our free-tier TradingView account only gives us the daily interval, so being able to chart this ourselves is one of our priority. From there we can calculate some sort of moving average and standard deviation to determine when a price is out of band, and represents an arbitrage opportunity. It might be possible to configure something similar with TradingView, but since they don’t support TDA brokerages, we would be subject to a fifteen minute delay on the GBTC data. There’s also the cost factor. As an OTC listing, GBTC trades still have fees associated with them, so any arbitrage situations will have to be large enough to offset the trade.

I’ve got lots of changes that I need to make to the code; right now I’m running into some testing issues related to monkeypatching out the API calls. I’m planning on doing some real time charting using the Bokeh library, and this will have it’s own set of issues, I’m sure.

Bitcoin vs. Coronavirus

It’s no secret that I am a huge bitcoin bull. For all my worries about risk and capital management with my financial investments, both equities and cryptocurrencies, I have thrown caution to the wind as far as bitcoin is concerned. I’d say that roughly two thirds of my total net worth is invested in either bitcoin or GBTC right now. Most of that is held directly in BTC in a hard wallet, and the rest via GBTC in my IRA.

About two months ago I started implementing a value averaging protocol to purchase GBTC. Each Monday, I would gauge the value of my GBTC holdings against a predetermined value, one-twentieth total capital times the number of weeks, and then place a buy or sell order, depending on whether I was above or below the target. The total capital that I planned for this deployment was about a third of my entire portfolio. I had set stops on several of my larger positions to gain cash, many of which triggered during the general market dip in 2019.

For the first fifteen weeks it was straight buy orders. I calculated the price that would trigger my max sell order, and on week eighteen, during the January run up, it triggered. Then the following week, I had a sell order. The last two weeks, as the price oscilated around the $10,000 mark, I was right on target, and didn’t have to place any large orders. During these few weeks, doubt began to creep and I found myself questioning the plan.

What if this was the start of the bull run to $50,000 or higher? Why would I sell? I questioned whether to break the plan and re-enter, or go even further and allocate even more than I had planned originally. I was able to squash this FOMO, and held firm. I had taken some profits, my position was up, and I would have at least another month to buy back in, as my profit taking had decreased my cost basis below my original target.

Weekly chart over the course of value averaging. Blue arrows indicate sell orders. Overall cost basis for period is 9.77/share.

And good thing I did. Effects of the Coronavirus caused a selloff in the markets, and bitcoin has fallen with it, about fifteen percent. I’m still holding to the plan, and will wait until Monday to buy back in. Patience, patience.

Also, I continue to accumulate BTC on a weekly basis, although on a much smaller scale. I’ve written a Python script to purchase a small amount through Gemini and transfer it to my hardware wallet. I’ve got one address for myself, and one for each of my children. The script alternates between them each week, placing buy orders and sending the proceeds to each of our addresses.

I plan on sharing this script via a Git gist or something shortly. It’s part of a larger trade planning library that I’m working on, and I’ve got to triple check that I’m not disclosing anything that shouldn’t be made public. I’ll do the same with the GBTC value averaging results, but that will be more difficult to scrub.

Firms I’m thinking about applying to

A recent Medium post on 2020 IPOs got me thinking about places that I’d like to work. Part of me has no desire to go back to work for a large company, I did four years with a Fortune 500 company, and while it was good for a while, the environment became toxic and I wound up self-destructing util they fired me. I haven’t had the best track record with any jobs up until my present position, to be honest. The place I’m at now isn’t ideal, but I guess I’d rather be a big fish in a small pond, so to say.

Now while I have no desire to go work for a retailer, or an exploitative company like Instacart, if I was to go back to work at a large firm and trade my freedom for a hefty package, these are some of the ones I would be interested in.

GitLab

One of the first companies on the list was GitLab. I’ve been a fan of theirs and have been using them over GitHub for the past few months. My university has an internal instance, and I’ve been using it a lot, figuring out how to use their CI/CD pipelines. They apparently have a culture of radical transparency, and have all of their guidebooks up online. Their interview and selection critiera are there, along with job responsibilities and performance metrics. Based on the compensation calculator, it looks like even a basic support position would be a step up from where I’m at today. It seems really appealing.

Stripe

Stripe has been doing very well in the payments space. They’ve got no plans to go public, but have a crazy valuation. They’ve got a lot of remote technical opportunities that could be interesting. On the downside, they recently discontinued support for Bitcoin payments, although the CEO remains optimistic about cryptocurrency in general.

Square

Not on the IPO since they went public in 2016. (Man did I miss that one…) Another payments company with several remote positions, as well as jobs in Atlanta, Denver, and Austin. Several front-end positions that I could qualify for, even with my limited experience. And the Cash App does Bitcoin, so it seems like it may be a good fit.

Asana

I used to be an advocate for Asana, but stopped using their software in favor of Basecamp. I originally skipped over them in consideration but just took a look at their job board. Nothing remote. I have no desire to move to San Fransisco, but if I wanted to move the family to Iceland it might be worth considering. I like how they have their values listed on their job postings, as well as this Day in the Life featuring one of their engineers.

Robinhood

I’m not a customer — get IRAs already! — but have been following them for some time and respect the efforts they’re doing to make investing more accessible. Fractional shares investing is a really good idea. And they offer crypto trading as well. No remote jobs available, but Denver is starting to sound like a good place to live. Go Broncos!

TDAmeritrade

Not on the original list, but I’m adding it here after hearing Junayna Tuteja, TD’s Head of Digital Assets and DLT on the On The Brink podcast. She makes it seem like a really great place to work. A quick look at their job board, however doesn’t match anything crypto-related. There’s a couple contract positions in Omaha and New Jersey, not two places I have any interest in moving to.

More economic and political news

The big news today seems to be a three percent pullback in the stock market due to Coronavirus fears, or the threat of a Sanders presidency, depending on who you ask. I wrote yesterday that Trump’s obsession with a health economy leading up to the election was leading forcing the Fed to inject liquidity into the markets, and that efforts were likely to fail at some point and lead us into a recession. What goes up, as they say… I also noted that the Coronavirus might be a big monkey wrench that throws us into global recession sooner than later. And while I haven’t bought face masks for my family yet, I am thinking about it.

$250,000 BTC?

This interview with Bitcoin bull Tim Draper was really interesting. The first two minutes are slow cause he just keeps repeating that the market’s are “frothy”, but then he gets into talking about bitcoin for several minutes. At one point he repeats his $250,000 price target for 2024, and is asked how much of his net worth is in crypto and he refuses to answer.

His point about the credit card fees versus Bitcoin is well-made also, as well as his arguments about banks in general. He throws out OpenNode as an example. Taking a quick look at it, they charge less than one percent per transaction, and even process the first $10,000 free of charge. They also have plugins for Shopify and WooCommerce. Neat!

Social Democracy vs. Unfettered Capitalism

I’ve been using Basecamp for several months lately, and have been using it with several clients lately. One of the founders, Jason Fried, has been on the Peter Attia pod a couple times since he started and I really appreciated the approach they take to running a business, work-life balance, and success. It really seemed like a breath of fresh air and a really healthy outlook.

A little over a year ago I participated in my first startup competition, and Angel investor Jason Calacanis was one of the keynotes. Afterward I got a bit caught up in the prospects and started listening to his The Week In Startups pod, but quickly burned out on it due to the number of episodes they put out and some general antipathy to the culture in general. So when I saw Fried’s co-founder, David Heinemeier Hasson, was a guest on TWIS, I added it to my feed and listened to it earlier today. I was not expecting what I heard.

Hasson is from Denmark, and the conversation quickly went to discussion about how America can “get to Denmark”, this is, providing citizens with basic services like healthcare and education for free. And Hasson is a pretty strong advocate for social democracy, and a fierce critic of exploitative capitalism, especially gig economy firms like Uber, of which Calacanis is an early-stage investor in. This was a really interesting conversation, and one that I will be sharing quite a bit with people in the run up to the Democratic primary here next week.

Selling in a bull market

We’re already a week into February; it seems like this year is flying along already. And what a crazy one it is. I’ve been spending a lot of time watching the price of Bitcoin; it seems like the bull market is here and ready to fulfil my dreams of wealth. Also, it seems like Sanders is in position to take the Democratic presidential nomination. On the other hand, Trump just got acquitted by the Senate, and the Democratic party seems to be doing everything they can to fuck things up.

I’ve been very low-key about crypto lately. I don’t talk to people much about in real life. I have fun with it on Twitter, but the fact is that if things go right, I don’t want people to know how much I’m involved with it. Keeping control of your bank is all fun and games until someone gets kidnapped. Someone on Twitter was bragging about being a member of the 10BTC club, and I warned them about OPSEC. They took the tweet down after.

I’ve done my best to protect my holdings. I’ve got redundant hardware wallets plus the private keys protected, but it’s starting to get to the point where I don’t feel entirely safe. I could literally make more from hodling this year than I do at my day job. That’s insane. Many months ago, during the depths of the bear market, I set some dynamic price targets to sell some of my holdings once things took back off using the Mayer Multiple (MM), or the price of BTC as a multiple of its 200-day exponential moving average. I’ve also posted the current MM chart and the TradingView PineScript I used to create it as well.

//@version=1
study("Mayer Multiple", overlay=false)

psma_length = input(100, title="Price SMA Length")
msma_length = input(250, title="Multiple SMA Length")


ma = sma(close, psma_length)
multiple = close / ma
mma = sma(multiple, msma_length)

plot(multiple, title='EMA Multiple', color=#891A0D, linewidth=3)
plot(mma, color=orange, linewidth=2)

Looking at the above chart, one can see that the price of bitcoin has usually peaked when the MM hits 1.9. The winter 2017 bull run peaked just under 2.9x. So a possible strategy would be to start selling as the MM approaches these numbers. I won’t be dumping my holdings at these points, rather I’ll probably start scaling out gradually. I’ve been using a dollar-cost averaging approach, or accumulating, every week, so I think I may start selling the same amount as the price reaches 1.55-1.60x, which is currently $12,900. However, I have made a decision to sell a significant portion of my holdings if we reach 2.88 like we did at the end of the last bull run. That would be just under $24,000. Of course those numbers are dynamic and will likely be much bigger if we take our time to get there. Otherwise, I assume we’ll have some sort of blow off top with opportunity to buy back in later.

I truly believe that Bitcoin represents the greatest financial opportunity that I’ve seen in my lifetime, and one of the main difficulties I’m struggling with is how to balance my risk. I’ve already got a majority of my net worth in crypto, and the temptation to go even further is strong. I’ve written about GBTC in the past; in the next week I’ll complete a 20-week value-averaging plan that I’ve been executing. It’s just hit it’s max payout target for the first time, and we are fully in the black. More about that next week.

That said, it’s hard finding a sell strategy. The important thing is to have a plan, and having the discipline to execute it. My hope is that I can use some of the longer-term trend indicators to build a cash reserve that I can redeploy during the next bear market. If we’re setting up for another multi-year parabolic bull run, then I want to make sure that I take profits and do so slowly enough that I don’t miss too much of the top.

Safe.Trade integration with CCXT

Cryptocurrency exchange automation library

I’m still operating a two year old crypto mining rig here at the house. For the couple months I’ve had it mining Arrow, a Zcash clone that has all of the non-private transactions turned off. I’ve accumulated quite a bit of it, and found out this past week that it was released on the Safe.Trade exchange. Me being me, I immediately went looking for the API docs to see what was available.

I have yet to sell any of the accumulated tokens since I turned the rig on, but feel like I have enough of a stockpile that it’s time for me to start selling some of it for Bitcoin. So what I would like to do is write a program that will interface with my Arrow mining wallet, see how much has been deposited in that day, and transfer said amount over to the Exchange. From there, place a market order, and transfer the proceeds to my bitcoin hard wallet.

Usually I would just open up Pycharm and start building an API wrapper for the exchange, but I’ve been using the excellent CCXT cryptoexchange libary, and wanted to try my hand at adding an exchange to that. The library is very well designed, exchanges are added via a single Javascript file that performs authentication and API calls to CCXTs unified specifications. It seems simple enough, but I haven’t done JS development in fifteen years.

I managed to download the CCXT Docker image and run the tests, but figuring out how to do test driven development in Node is going to be a bit more than I had originally bargained for. I’m going to have to spend a few days figuring out how to set things up and get in the flow.

Of course, yesterday was also the first day of school, so it’s going to be interesting figuring out how to fit all this in. I’m also still doing work with the Value Average and GBTC Estimators, so I’ll have to balance doing all that as well. Still, having a commit in the CCXT library would be like a badge of honor, so I’m going to give it a shot.

We will keep you posted.

Estimating GBTC price from BTC after-hours activity

Grayscale Bitcoin Trust (GBTC) is the name of a publicly traded OTC investment product listed on the public OTC markets. It’s a way for US investors to take a position in Bitcoin through brokerage and retirement accounts like IRAs. A lot of OG crypto-types scoff at the prospect of purchasing such an asset, since you don’t actually control the BTC or the private keys, but for some this is an attractive option, or an only one. I’ve been personally taking positions in GBTC over the past 3 or so years through my retirement IRA. One of the most underlooked qualities of GBTC through an IRA is that all transactions are tax-free. I can take profits in my IRA at any time without worrying about tax liability, which is not something I can say for my actual crypto holdings.

Two of the downsides of GBTC is that Grayscale takes a two percent management fee. This isn’t a big deal to me because of the expected gains in a bull run. The other is that there is a premium on GBTC over the underlying asset value. Each share of GBTC represents .00096884 Bitcoin, but the GBTC’s price is usually 30-10% higher than the value of the underlying asset.

One of the main differences between the equities and crypto markets is the fact that crypto is 24/7. Often, during times when BTC has made a big price movement, I’ve wondered what the corresponding change in the price of GBTC would be (and in my portfolio!) So, I have written a small Python package to calculate this that I call GBTC Estimator.

I have it setup to get public BTC prices from Gemini (via the excellent CCXT package). Right now it’s using IEX’s daily GBTC data (and required an IEX API key), so it only has access to daily OHLCV (open, high, low, close, volume) data. We take the close price of GBTC, and divide it by the price of BTC at the same time (4PM EST) to come up with the actual BTC per share. This number is then used with the current BTC price to come up with the estimated GBTC value.

This current version is run from the command line and returns the estimated price as well as the difference from the last close in dollars and percentage. I have plans to put this up as a website that updates automatically, but first I think I’m going to do some backtesting to see how accurate this is. I think there may be some arbitrage opportunities to be found here. I’ve already started refactoring and will have more updates to follow.

Becoming a Git-xpert

I have been trying to get a grip on the Pennykoin CLI code base for some time. One of the problems that I’ve had is that the original developer had a lot of false starts and stops, and there’s a lot of orphan branches like this:

Taken with GitKraken

If that wasn’t bad enough, at some point they decided to push the current code to a new repo, and lost the entire starting commit history. Whether this was intentional or not, I can’t say. It’s made it very tricky for me to backtrack through the history of the code and figure out where bugs were introduced. So problem number one that I’m dealing with is how to link these two repos together so that I have a complete history to search through.

Merging two branches

So we had two repos, which we’ll call pk_old and pk_new. I originally tried methods where I tried to merge the repos together using branches, but I either wound up with the old repo as the last commit, or with the new repo and none of the old history. I spent a lot of time going over my bash history file and playing with using my local directories as remote sources, deleting and starting over. Then I was able to find out that there was indeed a common commit between these two repos, and that all I had to do was add the old remote with the –tags option to pull in everything.

mkdir pk_redux
cd pk_refresh
git init
git remote add -f pk_new https://github.com/Pennykoin/Pennykoin-old.git --tags
git merge pk_new/master
git remote add -f pk_old https://github.com/Pennykoin/Pennykoin-old.git --tags

Now, I probably could have gotten away by just cloning the pk_new repo instead of initializing an empty directory and adding the remote, but we the end result should be the same. A quick check of the tags between the two original repos and my new one showed that everything was there.

The link between the two repos

Phantom branches

One of the things that we have to do as part of our pk_redux, as we’re calling it, is setup new repos that we actually have control over. This time around, everything will be setup properly as part of governance, so that I’m not the only one with keys to the kingdom in case I go missing. I want to take advantage of GitLab’s integrated CI/CD, as we’ve talked about before, so I setup a new group and pkcli repo. I pushed the code base up, and saw all the tags, but none of the branches were there.

The issue ultimately comes down to the fact that git branches are just pointers to a specific commit in a repository’s history. Git will pull the commits down from a remote as part of a fetch job, but not the pointers to those branches unless I physically checked them out. Only after I created these tracking branches on my local repo could I then push them to the new remote origin.

Fixing Pennykoin

So now that I’ve got a handle on this repo, my next step is to hunt some bugs. I’ll probably have to do some more work to try and de-orphan some of these early commits in the repo history, cause that will be instrumental in tracking down changes to the Cryptonote parameters. These changes are likely the cause for the boostrap issue that exists. And my other priority is figuring out if we can unlock the bugged coins. From there I’d like to implement a test suite, and make sure that there is are proper branching workflows for code changes.

Choosing when, and how to sell

Knowing when to sell is one of the problems I struggle with as a trader, both in equities and crypto markets. In the past, I’ve relied on what the Motley Fool has referred to as a ‘buy and hold forever’ strategy, and it’s worked out well for me with some of the bigger tech stocks. As someone who’s been focusing more on shorter time frames lately, I’ve been having less success. And after watching my crypto portfolio break six figures in the winter of 2017 before crashing almost ninety percent, I’ve been trying to find a way to ensure that I’m able to actually take some profits when my positions start taking those parabolic runs.

One of the interesting metrics around the USD price of Bitcoin is the Mayer Multiple, which is the multiple of the current BTC price over the 200-day moving average. Trace Mayer determined that, historically speaking, the best long-term strategy was to accumulate BTC when when the Mayer Multiple was under 2.4. For comparison, the last time we hit that level was late June of this year when BTC hit $14K. Now I have traditionally been one to dollar-cost average into BTC, weekly, but I had to stop my contributions for a variety of market and personal reasons, but one plan I have been thinking about is to sell a large share of my position when the MM hits 2.88. This is a number I cam up with just by looking at the charts, and is currently about $26,200.

So I was really interested by this strategy put together by former BlackRock portfolio manager Vishal Karir, on how to take profits before the next bitcoin recession. I’m not going to rehash the entire piece here, suffice to say it sets a static accumulation target, buys when the asset value is below this target, and sells when it’s above it. I wanted to do some backtesting with some of my assets and see what I came up with. So I wrote up the following code in a Google Collab doc so I could start playing around with it.

Instead of looking at BTC directly, I wanted to start by looking at the Grayscale BTC ETF, GBTC, so for this block we’re using Pandas wonderful datareader to pull quotes from AlphaVantage.

import os
from datetime import datetime
import pandas_datareader.data as web

!pip install ipywidgets
import ipywidgets as widgets
from ipywidgets import interact, interact_manual

os.environ['ALPHAVANTAGE_API_KEY'] = 'my_key'

f = ""

time_series = [
    ("Intraday Time Series", "av-intraday"),
    ("Daily Time Series", "av-daily"),
    ("Daily Time Series (Adjusted)", "av-daily-adjusted"), 
    ("Weekly Time Series", "av-weekly"), 
    ("Weekly Time Series (Adjusted)", "av-weekly-adjusted"),
    ("Monthly Time Series", "av-monthly"),
    ("Monthly Time Series (Adjusted)", "av-monthly-adjusted")
]  
     

def get_asset_data (ticker, time_frame="av-weekly", start_date="2017-01-01", end_date="2019-09-30"):
  global f
  f = web.DataReader(ticker,
                     time_frame, 
                     start = parse(start_date), 
                     end = parse(end_date))
  return f

interact_manual(get_asset_data, ticker="", time_frame=time_series)

We’re using f as a global for our dataframe. It stores the stock data. We’re also using ipywidgets to allow us to easily change parameters for the data we want to run against.


The next cell allows us to pass this previous dataframe to our backtest function. I wanted to play with various parameters such as the amount of capital available, the max contribution, and the ratio of max contributions to max sell amount.

def run_karir_target(price_data, capital, contribute=100, sell_factor=2):

  def get_asset_value(price):
    return (shares * price)
  
  def buy(amount, price):
    
    nonlocal shares, cash
    if amount > 0:
      if amount > contribute:
        amount = contribute
      action = "BUY"
    else:
      if amount < -sell:
        amount = -sell
      action = "SELL"


    num_shares = amount/price
    print("{} {} shares for {}".format(action, num_shares, amount))

    cash -= amount
    shares += num_shares

    
  f = price_data
  cash = capital
  contribute=contribute
  sell_factor = sell_factor
  
  shares = 0
  sell = sell_factor * contribute
  week = 1

  for i, j in f.iterrows(): 
    if cash < 0:
      print ("Out of cash!")
      break
    price = j['open']
    print("Week {}: {}".format(week,i))

    target = week * contribute
    value = get_asset_value(price)
    print("Target: {} Asset value = {}".format(target,value))

    difference = target - value
    # 0 - 500 = -500

    buy(difference, price)
    new_total = get_asset_value(price)
    total = cash + new_total

    print ("Total: {}, Cash: {}, Shares: {}, Asset Value: {}".format(total, cash, shares, new_total))  
    print()
    week += 1

Now there’s a lot here I will do later to clean up this code, making the params available via a widget as I did for the first function, but for now it works just fine. Here’s a test run with $100 contributed weekly from just after the beginning of the BTC bear market till now.

Week 1 and 2 of our backtest
The ‘bottom’.
We’re not including the entire run, but here’s where we end up.

So, not bad on our hypothetical run. That’s a gain of almost $4700 off of $3769 invested, or a 24% return. Now we’re cherry-picking, or course. At the bottom of the market, we would have had over $7K deployed at a break even. But Karir’s strategy opens up a whole slew of possibilities, and what may be a good rule of thumb for scaling out of positions. Since I’ve been able to get this package working, I’ve been looking at other investments that I’ve made in equities markets, and am starting to form some hypotheses that may help guide best practices for both entries and exits.

My next step, after cleaning up this code a bit, is to figure out a way to run some regression tests on the sell multiple. I think a dynamic variable may actually be more helpful in instances where the asset goes on a parabolic run. But the point here is that I have a framework that I can test my assumptions against.

It shouldn’t be too hard also to integrate Karir’s strategy for accumulation of BTC, as well as altcoin pairings as well. It’s an exciting strategy for investment, and one that can be automated via exchange and broker APIs. There may also be some variations that we can deploy, using this kind of targeted portfolio value as a way to layer limit orders. For this simulation we simply used the open price of the time period, but we could calculate the price an asset would have to be for us to sell it next week, and set some orders in the present period. If the high for that period hits that level, we could simulate the trade and see how that affects our gains.

I can’t wait to model this and put it to use.

Cryptoasset portfolio tools

I spent some time Sunday cleaning up all the old coding projects on one of my computers and uploading them to my GitLab page. Most of the repos are private, but I’ll talk about cryptomarketbot shortly. I had to go through everything to make sure all tokens and other identifiable information was moved out. I used the wonderful python_dotenv package for that.

Most of the packages related to campaign finance data, that will likely stay private until I’m ready to dox myself, or crypto or equities related stuff. There were a few commercial projects that I had parked on Bitbucket that have been moved. Now that I’ve been able to inventory what I have, I can start fleshing out the useful stuff a bit more and refining it to something useful for myself and others.

Cryptomarket Bot

Cryptomarket Bot, as I call it, is not particularly useful. I wanted to track the advance and declines in the top cryptoassests by market value, so I built a small function that queries the CoinMarketCap API and inventories the the top x coins and counts the number that have gone up or down. I think I had the idea while I was reading Alexander Elder’s book Trading For a Living, and it seemed easy enough to implement. I went and bundled that as a Twitter bot, but I haven’t been very motivated to maintain it. I suppose I should figure out a way to park it in a docker container where I can keep it running in-house, or push it to a Heroku hobby instance and leave it there. Maybe there are additional analyses that could be run, and the library could be triggered as a function call via a scheduler, cron or Celery, instead of a never ending Python script.

Finance libraries

I have a number of spreadsheets that I use to track my cryptoasset holdings. I have one for mining and masternodes, and a series of others that I use to track investments in alts that I’ve also started using to plan equities trades as well. The general idea follows Elder’s two percent rule, that no trade exposes you to more than two percent total portfolio loss. Calculating that number for a brokerage account is pretty simple, since everything is in cash or equities, but crypto is a whole other story. One has to determine whether portfolio value is going to be pegged against the dollar, or in terms of BTC, (I prefer the latter,) and many assets may have no direct pairings, such as new shitcoins that aren’t listed on exchanges, or ERC20 assets that are only pegged to Ether.

So while figuring out my risk profile for a ethbtc trade may be simple enough, determining that for something like IDEX staking is a bit more difficult. It’s also hard to separate long term buys, (dollar cost averaging BTC,) from more speculative plays like trying to swing-trade PIVX or something. I’ll be spending more time in this space walking through that decision-making process as I figure out ways to model my portfolio.

Tomorrow marks the start of the last quarter of 2019, and we’ll use the date to mark a new snapshot of my holdings, figure out what my strategy is for the quarter, and will walk through the trades as I plan them out, execute them, and track them. Stay tuned.