Category: Investing Insight

Investing insight to make you a better investor.

Bitcoin's Secret Sauce

or: How I Learned to Stop Worrying and Love Nation State Attacks.

Bitcoin’s secret sauce, and how it works, was on full display these last few weeks. Bitcoin was designed to work against the most powerful of adversaries, and boy – did the adversary show up!

batman-v-superman-dawn-of-justice_bb788b6f

The China Syndrome

A few months ago, 45% to 75% of Bitcoin mining happened inside China. Then the Chinese government banned it.

There are anecdotal accounts from people on the ground are seeing Bitcoin mining operations being shut down by law enforcement agents. And there are similar accounts from people on the ground elsewhere in the world where containers full of mining hardware are being shipped to, lock, stock and barrel.

And then there is the Bitcoin blockchain – the source of absolute truth.

I have a copy of the Bitcoin blockchain on my computer, and could actually run the numbers myself and see that the production of Bitcoin blocks slowed down dramatically. Here’s a plot of how long it took, on average, to find 2016 blocks from 12-May-2014 to 18-July-2021.

Bitcoin blocks, on an average, are supposed to be generated once every 600 seconds. But you can see the spike in this number on the graph towards the end, going all the way up to 832 seconds. This means that during that period, the total number of active miners went down dramatically, and that led to the inter-block average-gap increasing equally dramatically from 600 seconds to 832 seconds.

Putting the anecdotal and canonical sources of data together, we can be reasonably certain that the Chinese mining ban lead to a global drop in Bitcoin mining.

Does it matter?

Not really. Miners come, miners go – Bitcoin chugs along. That is what it is designed to do. Bitcoin targets a block production rate of 600 seconds per block. If Bitcoin’s design had been naïve, whenever its dollar value went up, more miners would enter the system to make more money, and blocks would arrive faster than 600 seconds. Similarly, if its value went down (or if governments kicked them out), miners would leave the system, and blocks would arrive much slower than 600 seconds. The block production rate on either side of 600 would persist, and reflect the total number of miners in the system.

But no, that’s not what happens. No matter how many miners are in the system, it always takes around 600 seconds to mine a block. This is done through the difficulty adjustment algorithm, also known as Satoshi’s stroke of genius.

Difficulty Adjustment a.k.a Bitcoin’s Secret Sauce

Before we get to the difficulty adjustment algorithm, we have to first understand why keeping the inter-block interval of 600 seconds is important. Bitcoin works because everyone can check whether their perceived ownership of their own Bitcoin is fact or fiction. To check this, you need access to Bitcoin’s data? Where is this data? How big is it? How do I access it? Bitcoin’s data is not held by some central custodian, or a bank. It’s held by everyone who is interested. It includes all transaction from the genesis block onwards – from January 2009. But storing everything with everyone sounds crazy – and to be honest, it is crazy. But the more you think about it, the more you realize that there are no other easier ways of doing self-validation, other than offloading the “do I control my money or not?” question to someone else – and trusting them. Bitcoin prefers the opposite: self-validation.

So, if we accept the crazy idea that everyone stores a copy of the blockchain, we have a fundamental tradeoff – the blockchain cannot get very big (by growing very fast). It also cannot stay static: new transactions need to be added every so often to facilitate economic activity. Currently, the blockchain is around 377 GB, and growing at around 50 GB per year. If it grows too fast, not everyone will be able to hold their own copy. If it doesn’t grow fast enough, there is not enough transaction space to accommodate the demand for transactions. Under these constraints, Satoshi decided that a 1MB block every 10 minutes is a good tradeoff. To keep this tradeoff constant, blocks cannot be generated slower or faster.

What happens if Bitcoin’s value skyrockets and everyone wants to be a miner? Remember that a miner who generates a new block gets to keep the newly minted Bitcoin that comes out of each block. So, if the value of Bitcoin goes up, expect more miners to materialize. To accommodate this, Satoshi designed a simple algorithm that makes mining harder or easier depending on how long it takes to generate the previous 2016 blocks.

The Bitcoin protocol contains a positive number called “difficulty”, whose value is currently 13,672,594,272,814. This number controls how hard or easy it is to mine a block. Let’s say the total time taken to mine the previous 2016 blocks was greater than 2016 times 600 seconds, by a factor of X. This difficulty number is then adjusted lower by the same factor X. If the time taken to mine the previous 2016 blocks was lower, the difficulty number is adjusted upwards – again by the factor X. That’s it.

As far as “algorithms” go, this is as simple as it gets. It’s middle school level arithmetic. Other than combining existing ideas from cryptography and distributed systems, Satoshi’s only novel contribution was this middle school level formula. The genius, as they say, is in the simplicity of it.

When these erstwhile Chinese miners turned down their mining hardware around end of June/beginning of July 2021, Bitcoin’s mining difficulty dropped from 19 trillion to 14 trillion, by around 5 trillion – which is around 28%. The reduced difficulty made it easier for the remaining online Bitcoin miners to start generating blocks every 10 minutes again. The next 2016 block average was 630 seconds. Voila!

As Bitcoin’s value increased from 0 to wherever it is today, miners have only entered the system – and have rarely left. Difficulty has always gone up – to accommodate this increase in value. So, how does this difficulty number actually make it easier or harder to mine a Bitcoin block?

The Proof of Work Function

Bitcoin, famously, relies the “partial hash-preimage puzzle” to build its Proof of Work function:

You double hash data from the block you want to generate, and check if that hash value is less than the target on the right hand side of the equation. If it’s not, you change the block data, and try again, and again, and again, and again.

For example, if I double hash make-believe block-data, say the string “Bitcoin forever!”, I get the number:

99399038078883646938846821706752581723151100264172406332358249387420489004987.

The current value of the target is:

1971823790658122626473078926498088015421759366553927680.

So, it doesn’t work. I need to keep trying the function again and again with different block-data to hit gold. The actual previous Bitcoin block’s hash was 888160945014446794317532755205888398236464272495427689, which is under the required target, and that miner struck gold – so to speak.

If the difficulty number goes up, the mining target goes down, and finding block-data that double-hashes to a number lower than that target gets harder. It’s like tossing a 6 sided dice and wanting to hit a number less than or equal to 1. It happens only once every 6 times. If difficulty were to reduce, the target would move to a number less than or equal to 2. That happens every 3 times – mining just got easier.

Why go into the nitty gritty details of this function, with all the associated arithmetic and probability? I want to get into the properties that this unique function has, that makes it ideal for Bitcoin mining – and resisting nation state attacks.

Parameterizability: The function provides very fine degree of control over how much harder or easier we want the function evaluation to be. If you increase or decrease the difficulty number, the function becomes easier or harder to evaluate, respectively.

Memorylessness or Progress-free ness: Even if you have already run the function a million times, it still doesn’t give you any advantage over the next run. Each run of the function is what is called a Bernoulli trial – with the odds of hitting gold the same no matter how many times you have tried in the past. This makes sure that larger miners have no other advantage than just the larger chance of producing a block. If this property weren’t there, the largest miner would *always* win, even if they had just 0.0001% more power than the next largest miner.

The other incredible advantage of Memorylessness is that a miner can be turned off, put in a container, shipped elsewhere and plugged back in. The only loss the miner incurs is the Bitcoin that could have been mined in that interim time when the machine was turned off. Most physical objects being built, or even computations that are being performed on computers rely on previous data or “progress” that has been done, stored and retrieved, so that we can continue the process further. Shutting down something abruptly, without needing to store any state of progress, and starting elsewhere without any extraneous loss is not that common. This allows Bitcoin miners to be incredibly mobile and seek out the cheapest electricity wherever it exists. They are, in the true sense, plug-and-play.

Hard to compute, but easy to verify: To get the double-hash value which is under the target needs millions of trials of the function. But once someone finds it, the rest of us can verify it immediately with just a single iteration of the function. This, again, makes decentralization possible – where all of us can run the Bitcoin software on our computers and check that the miners are doing the right thing.

Replacing this function is not that easy. Most attempts have kept the general idea, and have tinkered with the specifics.

Conclusion

A nation state the size of China attacked Bitcoin where it’s supposed to hurt: Bitcoin Mining and all they managed to get in return was a giant shrug of indifference by the protocol. Yet another instance of Bitcoin living up to its promise of being designed to last forever. This self-adjusting nature of Bitcoin – that makes it change itself based on market conditions, with no one central entity being in charge – separates it from all other forms of money. Fiat money always has a central planner. Bitcoin has a protocol.


Our crypto series in reverse-chronological order:


Indians Investing Abroad

Make LRS work for you

There are quite a few reasons why Indians would want to invest overseas. Education, retirement and emigration are frequently cited as top priorities. In the past, the only way to do this was through the Liberalised Remittance Scheme (LRS) route. However, with Indian mutual funds finally waking up to increasing demand from investors, does investing in international public market securities through this process still make sense?

Liberalised Remittance Scheme

The Indian Government, through its various regulatory and enforcement arms, have traditionally tried to keep Indians from sending money abroad. The problem has always been that populist policies used to win elections end up choking growth and stoking inflation. This leads to investors pulling funds away from India – aka, capital flight. One way to stem the tide is to try and trap Indian capital within India.

We use the word “try” because we are all aware about the hawala network that thrives to this day because of these policies. Thankfully, the process of liberalization has slowly, in baby steps, opened the doors for Indians to legally remit funds abroad.

The Reserve Bank of India (RBI) sets the rules governing these fund transfers that banks need to follow. And banks are supposed to report and track these transactions both at the individual and aggregate levels. Given the paperwork involved, most banks require you to make a trip to a “designated” branch office and execute the instruction in-person. The whole process is cumbersome, requires paperwork and takes an hour or two to complete.

Not only is LRS is painful, it is also expensive.

Most people fixate on bank fees and GST but that’s only part of the story. The biggest scam is the exchange rate given by the bank – it is the worst possible rate that they can give you while still being compliant with rules & regulations. If you compare the “google” rate with the final transfer rate, you’ll find that the drag is about 3%

So, why do it?

More Choice, Less Cost

The US ETF market went through a decade-long price war that drove vanilla cap-weighted fees to almost zero.

For example, if you want to invest in the S&P 500 index, then Vanguard’s VOO ETF charges you 3bps for the privilege whereas Motilal’s index fund charges 50bps. If you consider the tax differential and the transfer knee-cap, you break-even by year 7. So, if you are a passive, buy & hold investor with a long enough time horizon, LRS makes more sense.

While costs are important, so are choices. You can access strategies beyond what Indian mutual funds deign to offer in the local market. For example, there are a ton of factor strategies available through ETFs that are probably never going to be launched in India.


Previously:

ETFs for Asset Allocation

The United States of ETFs


Lower Transaction Costs

Indian policy makers love to ape Western European policies without giving a second thought to its appropriateness given our stage of growth. One such self-goal has been the STT – Securities Transaction Tax – that taxes transactions rather than profits. And yes, we tax both short-term and long-term capital gains. Sort of like a dare: We’ll see how you’ll make money trading.

Fortunately, the US has avoided shooting itself in the foot so far.

Lets say, you fall in the 30% income tax slab. You have a trading strategy that makes 20% returns in both markets. The strategy turnsover the portfolio “x” times. Given 0.01% STT in India and zero brokerage in the US, what is “x” for you to be indifferent in Year 1?

If you turn over your portfolio more than 60 times, you would be better off deploying that strategy in the US rather than India.

If you set the gross returns to zero, the required turnover drops to 30.

However, if you only trade infrequently, then LRS may not the best way to go. For example, a 40x turnover strategy will need 3 years to be indifferent.

Basically, if you are going to trade frequently, doing it in the US makes a lot more sense.

Caveats

LRS ensures that you will need a Chartered Accountant to do you taxes. You need to account for the dividends you have received, report your net personal assets, etc. So this route doesn’t make sense for small accounts.

If you don’t share your trading and banking passwords with your next-of-kin, then you need to be worried about US Estate laws. The U.S. has jurisdiction over U.S.-situated assets and requires executors for nonresidents to file an estate tax return if the fair market value at death of the decedent’s U.S.-situated assets exceeds $60,000. Directly investing in U.S.-situs assets as a non-U.S. investor creates potential U.S. estate tax liabilities.1

Conclusion

We feel that the LRS route is attractive both for a buy & hold investor as well as an active investor with an edge. However, one should get into it knowing the trade-offs involved.


If you are looking for simple, pre-canned investment strategies to invest in the US, check out freefloat.us


The United States of ETFs

Just can’t get enough.

For the longest time in the US, actively managed mutual funds ruled the roost. Then came Jack Bogle with his index fund and the ceaseless mantra of “costs and taxes matter” and the dynamic shifted, slowly at first and then suddenly, in favor of indexing. It was only a matter of time before people figured out the tax loophole of ETFs and now, there are over 2500 ETFs listed in the US.


Previously: ETFs for Asset Allocation


The Tax Loophole

Unlike in India, where mutual funds are “pass through,” US mutual fund investors pay capital gains tax on assets sold by their funds. When there are large-scale redemptions, say, during a market melt-down, funds are forced to sell their holdings. This generates capital gains taxes, meaning that investors have to pay tax on assets that had fallen sharply in value1.

ETFs​, on the other hand, don’t have to subject their investors to such harsh tax treatment. ETF providers offer shares “in kind,” with authorized participants serving as a buffer between investors and the providers’ trading-triggered tax events.

A Plethora

Of the ETFs that survive today, the number of launches every year has trended higher.

While Equity ETFs dominate launches, the share of fixed income, alternatives, etc. has increased as well.

Most of the AUM resides in “vanilla” strategies – typically market-cap based.

The winner HAS taken all

Plot the assets of each ETF, in billions, in log-scale and you can tell that this is a game of scale.

Of the total 2577 ETFs, 2022 (78.5%) have less than a billion dollars in assets. You need to filter for $10 billion and up to just see the x-axis.

The top 3 issuers: Blackrock, Vanguard and SSGA manage ~80% of all ETF assets.

Where there is an ETF, there’s an Index

Until last year, ETFs were supposed to be a “passive” entity. There were no “actively managed” ETFs. In order to be passive, an ETF needed to follow an index. And indices had to be rules based – however convoluted the rules. And issuers needed a third-party to provide the index.

The rise of ETFs (and passive investing, in general) put index providers in the middle of all the a action. They became a crucial cog in world finance that can make or break entire economies. So powerful, in fact, that China blackmailed MSCI to include its domestic stocks in its Emerging Markets Index, which is tracked by close to $2 trillion in assets2. And India has been working on inclusion of Indian sovereign bonds in global bond indices3.

We can see industry consolidation here as well. The top 5 index providers control ~75% of ETF AUM (more if you include index funds.) S&P Global and MSCI are as close to “pure-play” index providers as you can get and their stock market performance is off-the-charts.

Fee Squeeze and Innovation

The problem with index ETFs/funds is that buyers only care about two things: expense ratio and tracking error. This resulted in a massive fee war that saw the vanilla-passive industry consolidate around Blackrock and Vanguard. For example, Vanguard’s S&P 500 ETF’s expense ratio is 3bps.

So, what next?

International ETFs

The first wave was ETFs providing international diversification. However, the “home-bias” is pretty strong with AUM under international ETFs barely making a quarter of the total.

On a weighted average basis, these ETFs charge about 30bps. However, since these are mostly cap-weighted, the fee-war is just as intense here.

Leveraged/Inverse ETFs

Many investors have mandates that prevent them from trading derivates outright. This is especially true for Indian investors taking the LRS route to invest in the US. However, Wall Street has your back.

Leveraged ETFs give you 2x or 3x the daily returns of a benchmark index like the S&P 500 or the Nasdaq 100. Feeling bearish? Inverse ETFs do the opposite.

Caveat: These are NOT buy-and-hold investments and are more suitable for day-traders. The discussion requires a separate post.

On a weighted average basis, these ETFs charge about 100bps. While lucrative, they are mostly niche.

Active ETFs

An ETF’s tax-free wrapper make it an order of magnitude more attractive than an identical mutual fund. New issuers/managers have taken advantage of this and launched actively managed ETFs.

On a weighted average basis, active ETFs charge about 50bps. These are still early days for this category – they barely make 5% of total ETF assets. Liquidity and tracking errors during market crisis are yet to be tested.

Conclusion

There is a plethora of choices when it comes to ETFs in the US. If you plan to wander away from the plain-vanilla stuff, please take the time to read the prospectus and understand how it works.

If you are looking for simple, pre-canned investment strategies to invest in the US, check out freefloat.us

Global Equities Momentum

A slice of Dual Momentum

Gary Antonacci created the Global Equities Momentum (GEM) model that applied dual momentum to stock and bond indices. It toggles between stocks and bonds using 12-month trailing returns. And when it toggles to “stocks,” it chooses between US equities and International (ex-US) equities based on whichever posted higher returns in the previous 12-months. The model uses the S&P 500 index as a stand-in for US equities and the WORLD ex USA index for international stocks.

Investors can use the ETFs SPY/VOO for the S&P 500, SCHF for World ex-US DMs and AGG for bonds while replicating this strategy.

The best part about this strategy is its simplicity. It takes just 3 inputs and anybody can set it up on Google Sheets. Execution is as simple as it gets because at any given point in time, it is long just one ETF. Also, given that it uses a 12-month look-back, it is less prone to whiplashes, resulting in a lower trading frequency.

Specifications & Expressions

When you automate systematic strategies, you need to nail down its exact specifications. In this case, they are mainly: inputs, look-back periods and traded instruments.

The original version of the Strategy uses the S&P 500 and World ex-US both for inputs and as proxies for the traded instruments. However, there is no reason why they both should be the same. Also, what is so magical about a 12-month look-back period anyway? Why can’t it be 6 -months, a month or an average of the last 6-months?

The Strategy only describes a broad idea with one set of Specifications and Expressions out of a multitude. It can (and should) be adapted to fit one’s risk profile and investment horizon.

The Momentum Expression

The easiest tweak to the original strategy is to swap out the traded equity instruments with their momentum counterparts.

At the final step, when it comes to executing the trade, you can use MTUM, the US Momentum ETF instead of SPY/VOO and IMTM, the DM ex-US Momentum ETF instead of SCHF.

Long-only momentum ETFs are highly correlated to their market-cap counterparts but have the potential to juice returns in bull-markets. Since we are trend-following anyway, why not go a step further up the risk-curve and embrace momentum as well?

This is the basic idea behind our Global Equities Momentum I strategy.

The Look-Back Specification

Picking a look-back for trend-following strategies is fraught with data-mining bias. One could potentially test 100s of periods and pick one that gave the best results historically. The data-mined look-back could even work in forward tests but inexplicably, and suddenly, fail in real portfolios.

The safest thing to do would be to not change the look-back periods outlined in the original research. However, the world would’ve changed since its first publication. How do you strike a balance between the two?

This is what we’ve tried to do in our Global Equities Momentum II strategy.

Long look-backs are slow at reacting to rapidly changing markets. Some might say that this is a bug while some might argue that this is a feature. Shorter look-backs, on the the other hand, can react faster but are prone to head-fakes and whiplashes.

The second version of our GEM strategy tries walk the fine line by taking the average of 6- through 12-month returns. It tries to hew close to the original research while acknowledging that the world has gotten faster since it was first published.

No Free Lunch

While the strategy adapts to the broad, slow-moving macro theme of US equity under-performance vis-à-vis rest-of-the-world (were it to occur,) it is not immune to getting whiplashed due to short and steep market dislocations like the COVID crash of March 2020. The strategy got into bonds just when the equity markets were recovering and stayed there until well-after. It is simply not possible to avoid all landmines when it comes to investing.

While we ran our back-tests, we tried a fair amount of permutations and combinations. Some where discarded in spite of having better risk-adjusted returns because they lacked internal consistency. While some slipped into data-mining territory in spite of our best efforts to avoid it. Readers interested in the process and the code can read through our GEM Collection.



Related: ETFs for Asset Allocation

Synthetic Indices

Popular indices, like NIFTY 50 & MIDCAP 150, are useful if you are benchmarking long-only portfolios. However, if you have a long-short portfolio, then you need a long-short benchmark.

When Are Contrarian Profits Due To Stock Market Overreaction? (Lo, MacKinlay, 1990) describes a naïve portfolio construction process that is fit for purpose.

For momentum, portfolio weights are in proportion of excess returns over an equal-weighted index and for mean-reversion, they are the inverse.

For example, if you subtract the returns of each of the components of the NIFTY 50 index with the returns of NIFTY 50 EQUAL-WEIGHT index and divide by 50, you end up with the portfolio weights for the next day. Each look-back period used to calculate returns will produce a different set of weights (and a different synthetic index.)

As impractical as constructing such a portfolio may seem, they are useful as a benchmark for long-short mean-reversion/momentum portfolios. Here are index returns since April 2020 with 20- and 50-day look-backs.

This is especially interesting if you are looking at market dislocations and subsequent recoveries. Here are indices since June 2019 with 5-, 20- and 50-day look-backs.

Counter-intuitively, naïve mean-reverting long-short seems to out-perform momentum.