April 19, 2024

The smartest bitcoin miner, part 1

Estimating the cost of hash power is one of the oldest and most mysterious topics in the world of mining. Economic andgame-theoretic aspects of algorithmsThere have been several scientific papers and industry studies devoted to proof-of-work, but most of them oversimplify the situation or make unrealistic assumptions about how the hashpower market actually works.

In this article I will try to show thatmanaging hashing power is akin to managing an investment portfolio, and I will also talk about the problems with reflecting significant aspects of the portfolio when assessing the cost of hash power. We will look at how the popular scoring mechanism works and the flaws of modern heuristics. I will also parameterize the hash capacity portfolio and show how the bottom line changes when testing a wide range of assumptions. I conclude by highlighting the importance of a standardized and correct system for estimating the cost of hashpower and that this is not just a theoretical exercise, but a fundamental step in developing good risk management practices for the hashpower industry.

"You will be much better in control of the situation if you realize how much you are not in control of it,"

— Benjamin GrahamIntelligent investor.

Fair value of hashing power

Why mine when you can just buy coins on the open market?

This is the most common reaction when someonehears about mining for the first time. It is no secret that it was the enormous financial gain that spurred the initial interest in mining and accelerated the formation of a multi-billion dollar industry around it. A successful miner can produce bitcoins at a price below the spot price, and, accordingly, has the ability to build a position at a large discount compared to buying on the open market.

However, the low cost of production by no meanscase is not a permanent condition. Over the years, competition intensified and the market cycle became too unclear to predict. The "discount" that miners are so spoiled for can turn into heavy losses at any moment. Is mining still a more profitable way to get digital coins than buying them on the open market? Given the number of variables involved, it is useless to try to make a timeless generalization on this score. Nevertheless, we can break the market cycle into several archetypal phases and try to assess the profitability of the most common mining and trading strategies in each of them.

Let's start in 2018, which was extremely unfortunate formost miners. In a previous article, I described the first three quarters of it as the "disposal [hardware]" phase of the mining cycle, when the price of the coin falls while the hash power of the network continues to rise.

Hypothetically, having purchased 10 at the beginning of the yearpetahash/sec. hashrate in the form of the Antminer S9, the miner would have spent a total of $1.85 million on 690 pieces of equipment, given that these machines were then selling for $2,675/piece. Assuming the machines depreciated linearly over 24 months and the total cost of electricity to a miner was $0.0507/kWh (industry average rate in China, courtesy of GMR), then we can test the profitability of three popular strategies:

  1. Moderate: the miner sells enough coins toPay daily electricity bill ($ 941.38) plus cover daily depreciation of equipment ($ 2563.54). If the mining income per day is less than the total cost ($ 3709, 01), then the miner sells only enough coins to cover the electricity bill. The rest is added to his BTC position.
  2. Long BTC (Long BTC): the miner sells just enough coins to cover the daily electricity bill ($ 941.38), all remaining coins are added to his long position.
  3. Sell ​​Daily: miner immediately sells all mined coins forU.S. dollars. Its sole purpose is to arbitrate on the difference between the spot price of coins and the cost of their production. It is worth noting that this strategy is not tax efficient and results in constant slippage. For simplicity of modeling, I will not take these factors into account.

Now let's compare the profitability of these miner strategies with buying coins on the open market. Consider two simple buying strategies:

  1. Upfront Purchase: on the first day of the mining evaluation period (01.01.2018), a number of coins is purchased that is roughly equivalent to the total capital cost + annual operating costs ($ 1.845.750 + $ 941.38 * 365) at the spot price for that day ($ 13465). The purchased coins are simply held until the end of the evaluation period. For the sake of simplicity, I will not account for the significant slippage that occurs when buying so many bitcoins.
  2. Dollar Cost Averaging: number of purchased coins conditionallyequivalent to the same costs (total capital + annual operating costs), but purchased at the same notional cost ($2.26 million / 365) daily throughout the valuation period.

During that year the daily costThe production of one coin ($3,709.01 cost divided by the number of coins mined per day) exceeded its market price around July and continued to rise in the second half of the year, making mining unprofitable for a long time. As can be seen from the result, after a year of bear market, the strategydaily saleled to the least financial losses, and the strategylong on BTC- to the greatest.

This is because the strategydaily salethe only one with no unrealized gains and losses. Other strategies, to one degree or another, imply the constant presence of a long position in an asset. During the phasedisposal of stocks [equipment]when mining profitability is steadily declining, an unrealized position is likely to result in a loss at the end of the valuation period.

In practice, reasonable miners would simply turn offequipment, if mining would bring losses for such a long time. If the miner had stopped working at the end of July, its losses would have been much smaller. If he had also stuck to the strategydaily sale, then I would even make a profit:

StrategiesmoderateAndlong BTCat the same time would remain unprofitable, albeit inless than buying coins on the open market. Losses here are associated mainly with capital costs for equipment. The miner bought it for $1.84 million, but was able to resell it for only $738 thousand (excluding transaction slippage, transportation costs and taxes). The profit from the mined bitcoins did not compensate for the depreciation of the equipment.

In both of these examples the strategydaily saleseems to be the safest. But what happens in the opposite phase of the market cycle, when mining revenues are constantly rising?

After the phaseshaking off the marketat the end of 2018, the first half of 2019 turned out to be quite successful for miners. Having carried out the same analysis for the period from 01/01/2019 to 06/30/2019, we see that the strategydaily sale, the most defensive of those studied, would be the least profitable, while aggressive strategieslong on BTCAndpre-purchasewould bring 50% more profit.

* Equipment lifecycle adjusted to 12 months at the beginning of 2019.

Easily determine the most winning strategybackdating. Applying aggressive strategies when the overall market is depressed requires conviction and a deep understanding of macroeconomic conditions. This especially applies to strategypre-purchase, implying a one-time placement of all capital on the first day.

The middle of 2019 was also a transitional year.the period when new generation machines appeared on the market. Usually, miners sell old hardware to replace it with more efficient models. In this example, miners could actually sell old machines for even more than the previous purchase price thanks to the raging price rally.

Hypothetically, if a miner sold all 690 Antminer units and used the proceeds of $271K to buy Whatsminer M20 for the second half of the year, the result could be like this:

And this is how the results for the whole of 2019 could look like:

While if the miner had not changed equipment and continued to work on Antminer S9 until the end of the year, the results would have been much more modest:

In practice, miners are usually not tied toone specific work algorithm for the entire period. They are flexible enough to change their strategy whenever they think the market trend has changed. In addition, they can supplement mining with trading strategies and / or borrow coins to increase the profitability of the equipment. For example, a miner can sell coins and fix mining profits on days that exceed production costs, and buy coins on the open market on days when they are below production costs. Choosing the right combination of strategies at different stages of the mining cycle has a significant impact on your bottom line. The purpose of this exercise is not to articulate a generalized winning strategy or to prove that mining is strictly more profitable than buying coins on the open market, but to show that managing mining is essentially akin to managing an investment portfolio.

Here are the simplest and mostcommon mining strategies. A lazy miner who uses one simple strategy throughout the entire market cycle will extract a different amount of value from hash power than one that varies strategies depending on the phase of the market. There are countless strategies for managing hash power, but the manufacturer will charge the same price for the hardware regardless of the strategies used by the buyer. Although the price is the realized data point, the value here depends on the user. Ideally, the price of the machines should represent the average distribution of value for all possible strategies, but this is not possible. So how does the hashpower industry value mining hardware? What exactly is the hashpower price? And more importantly, how should miners estimate the hashpower cost so that it best matches their underlying data and circumstances?

Hashpower cost heuristic

In today's market in the valuationhashpower is dominated by hardware makers such as Bitmain, MicroBT, and Canaan. They are the only suppliers of new hardware and have complete control over the initial production of machines that produce hashing power. The first priority of manufacturers is to cover all their costs, which is less related to the cryptocurrency market and more to supply chain management. The selling price of their products can be adjusted according to market demand, provided that it guarantees a certain profit relative to the cost of production. Sometimes manufacturers can artificially lower the price in order to outperform competitors in sales. In short, producer prices do not reflect the theoretical fair value of the hashing power, they are directly influenced by business decisions, rather reflecting the state of affairs within the issuing company.

In the first part of The Alchemy of Hash Power, I already said that the most popular metric for estimating the cost of hash power isnumber of days to break even(hereinafter referred to as DDB).It shows how many days it takes for a piece of equipment to break even, taking into account the current price of the asset, complexity, commissions and all operating expenses. Each miner has a valueDDBfor the same machine will be different due to differences in initial conditions and production processes. Miners are countingDDB, based on your own total kWh and capacity costs. Manufacturers cannot account for all miner costs, so the starting point for the number they calculate isDDBare always the average market total costs.This is always a very rough estimate as it is extremely difficult to collect the necessary data and conditions are constantly changing. Miners with different capacities and cost structures come and go. Manufacturers perform this exercise based on their best guess of total miner costs and set the hardware price based on a reasonable rangedays to break even.

But what are the industry average costs they use as input? We can try to reconstruct them using historical hardware price data.

Using the discounted cash flow method,We can test historical equipment prices to find the underlying assumptions used by manufacturers to price the machines they produce. For example, the retail price of Antminer S9 in January 2018 was $2,675.

Assuming the life cycle of Antminer S9 is 24 months, we can calculate the historical profitability of one machine:

Then we reconstruct the total costs like thisso that the sum of all the given values ​​of free cash flow for each day equals the purchase price. Assuming an annualized Weighted Average Cost of Capital (WACC) of 12.5%, we get:

To get daily expenses of$1.57, the total electricity cost for S9 should be $1.57 / 24 / 1.365 = $0.048/kWh. That is, for such a machine, purchased at this price, to pay off, the total costs of the miner should not exceed $0.048/kWh. The result above is calculated for the strategydaily sale(No. 3). Repeating this analysis for other strategies, we find that for the payback of the machine atmoderatestrategy, the total costs should not exceed 0.017 $/kWh, and with the strategylong BTC— 0.01 $/kWh. That is, in practice, the actual “break-even threshold” for the total costs of miners was in the range of 0.01–0.048 $/kWh.

This is significantly lower than the rate availablemost miners in early 2018. This makes sense intuitively. At that time, the price of BTC was just reaching all-time highs, the complexity of the network was just beginning to catch up, and the S9 was the best mining machine available on the market. The final determinant of price is still the supply / demand ratio.

Applying the same method to the prices of cars in othermoments in time, you can draw up the table below with the break-even values ​​for the total mining costs. Here, the total costs are the average of all three strategies:

On the other hand, if the industry averagesthe total cost per kWh was $ 0.0507, what would be the fair value of the machines at that point in time? Again, the fair price here is the average of all three strategies under consideration:

* Premium / discount refers to the price of the car relative to its fair value
(data: hashrateindex.com)

Please note that this analysis does not take into account changes in the industry average rate or WACC, as their exact values ​​are difficult to estimate.

The point of analysis is not to define a certainabsolute fair value. As stated, the fair value for each miner is different due to the different operating costs and strategies employed. However, even with an assumed industry average rate, it can be demonstrated how wildly inefficient the pricing of mining machines is. During a bull market, manufacturers significantly overpriced equipment, and during a bear market, they were forced to liquidate it at a discount. This is consistent with the empirical data we see in the mining market. During price rallies, the value of mining equipment sometimes rises even faster than the price of a coin. This behavior is at odds with the fundamental principle that machine prices should rise more slowly given expectations of future increases in network complexity. After all, hardware prices are driven by supply and demand, and the hashpower market is extremely illiquid.

When testing historical hardware prices, we see that quantity-based pricing heuristicsdays to break evencannot sufficiently take into accountvolatility of mining profitability. To estimate the fair value of machines today, it is necessary to model the profitability of mining over some perspective using tools or valuation systems that can adequately reflect wild fluctuations in results.

A more advanced approach is totreat hashpower as a form of call option. The principle of this approach starts with considering the profitability of mining equipment as the underlying asset. There are three components to mining profitability: price, difficulty, and commissions. Calling an option on the bitcoin price is already quite difficult, but a derivative that includes these three elements is much more complicated. Describing Black-Scholes theory for options on multiple underlying assets is straightforward in theory: additional considerations include correlated random walks and the corresponding multivariate version of Ito's lemma. Establishing a correlation matrix between these three variables, however, is not an easy task.

As mentioned in previous articles of thisseries, price and hashpower are cross-correlated with varying time lags. Due to the delay in response, when studying the relationship between hash power and price over a short time frame, the correlation appears to be minimal. Therefore, it is tempting to simply model the hashrate paths as a process that is completely independent of price. However, financially, hashpower is derived from Bitcoin, and over a fairly long time frame, these two time series have a positive correlation. On the other hand, the dynamics of transaction fees is even more difficult to model. While intuitively at some level, transaction fees are related to the price of the coin and the hash rate of the network (inversely proportional), they are mainly driven by the level of on-chain activity, which is an exogenous factor. This is why the correlation matrix will not give meaningful results here.

Total transaction fees collected (purple curve), BTC price (black curve) and average Bitcoin hash rate (green curve)
(: Glassnode)

But once assumptions have been made about the distribution of the underlying assets, the estimate of the value of hash power during the periodNbecomes equivalent to the series cost estimateEuropean call options with zero strike and daily expiration. In other words, as long as the mining hardware is connected to the network, the hash power represents a contract that is executed daily, converting into the underlying asset, which is the mining income. The contract value is the depreciation of the equipment plus operating expenses. The option premium of the entire package should theoretically equal the price of the machine plus the present value of all operating expenses incurred during the periodN.

Where:

  • V is the fair value of the car;
  • Ci is the cost of a call option on mining income, with maturity on day i;
  • T is daily operating expenses.

This approach has a critical flaw. In this formula, contracts for the dayiand for a dayi-1are assessed independently. Actually payout per dayi-1must set the initial condition forcontract expiring the next day. Any approach to estimating the value of hash power that is based on option pricing and simply sums all the values ​​over a period will run into this path dependency problem. Each value will be an independent estimate.

</p>

Estimating Cost Using Numerical Methods

Path dependency is not a problem whenusing numerical methods. Instead of evaluating each day across 10,000 trials, we use the same 10,000 trials across all of them. The Monte Carlo method is useful in simulating complex dynamics by generating random numbers. The expected payoff in a risk-neutral world is calculated using a sampling procedure. The result is then discounted at the risk-free interest rate. Using Monte Carlo methods, we can simulate the profitability of the latest generation of mining machines over the next two years and compare their fair value with today's market prices.

As a first step we will need to dosome assumptions about the price trajectory. Numerous studies (English, PDF) argue that diffusion jumps are the best way to describe the price distribution of Bitcoin. We use the jump diffusion model (PDF) to simulate 10,000 likely price movements over the next two years. In a stochastic simulation, each movement represents a separate path.

The diffusion shock model consists of twomain parts: diffusion (geometric Brownian motion) and jumps (usually Poisson distribution). For simplicity of modeling, we assume that there is some threshold probability of jumps. When jumps occur, the magnitude follows the normal distribution.

When calibrating based on historical price data, we use the following model parameters:

  • permanent bias: 10%;
  • bias standard deviation: 2.50%;
  • jump probability: 5.00%;
  • average jump value: 0.10%;
  • jump standard deviation: 5.00%.

Sample 100 paths for the first year

In addition to the price of the coin, you need to projectalso hash power of the network and calculate mining income. Modeling hashpower is more difficult than the price trajectory because not all hashpower units are the same. Although every miner on the network calculates hashes for the same algorithm, the amount of power consumed varies from machine to machine. A simplified model of the current network hash rate is abstracted from the presence of several classes of equipment efficiency, each of which behaves differently with the development of the market. Stratification of our model by efficiency class shows the composition of machines in the mining market and, therefore, allows us to roughly predict how they will behave over time.

Unlike price data, collect inthe required amount of reliable information about mining is extremely difficult. The only way to get close to this is to interview as many miners, distributors and manufacturers as possible. David from General Mining Research conducted a survey of major manufacturers and distributors in China and came up with the following assessment of the market composition as of 11/01/2020:

(: own data provided by GMR)

This snapshot formed the basis for the initialstates of the projection model. Using the estimated industry average total cost of electricity, we can calculate the break-even threshold for each level and roughly understand how many cars are likely to drop if the price drops below the break-even threshold. Taking $ 0.0507 / kWh as the estimated total rate, we can outline four possible scenarios based on different price levels:

(: own data provided by GMR)

It is worth emphasizing that this only providesbasic understanding of hash rate projection. With a sharp rise in prices, old low-cost cars available on the secondary market can be connected to the network, and manufacturers can also speed up the production of new models.

Based on the above scenarios, we can derive a linear function to describe the relationship between the price of a coin and the hash power of the networky = 4544x + 6e07. For simplicity, let's assume that over the next six months, hashrate growth follows a function of the 14-day average price of Bitcoin with an offset termdW... As the parameters of the offset time, weset a mean of 2.5% and a standard deviation of 5%. In addition, based on our estimate of vendor sales, we expect hashrate to grow at 200 petahesh / sec over the next six months. We simulate the hardware latency by including a constant 20-day response latency in the calculation. This means that the hash rate only reacts to price movements that occurred at least 20 days ago. This is how the full function looks like:

The trajectory patterns look like this:

In reality the relationship between hashpowerand the cost is confusing and complex. Using a linear function to describe them is like projecting a chaotic system onto a low-dimensional subspace. There are many options for how this function can break. This is the same problem I talked about with the correlation matrix and option pricing methods. However, this construction allows us to conveniently include latency in our calculations and is therefore a significant improvement over the assumption that hashpower and price are two completely independent distributions. This makes it easier to control the projection.

To further refine our estimates, we canapply Monte Carlo analysis using Markov chains. Unlike the simple Monte Carlo method, which extracts independent samples from a distribution, the Markov chain Monte Carlo extracts samples in such a way that each one depends on an existing sample. It is better suited for multidimensional problems than conventional Monte Carlo simulations. The exact construction of the algorithm is beyond the scope of this article.

Having received the price projection and the hash rate forecast forover the next two years, you can calculate the profitability of mining in the same way as we backtest historical prices for hashpower. Compared to two years earlier, when lending against cryptocurrency collateral was rare, today this market has grown into a large industry. Secured loans are one of the most common services that miners often rely on. Estimating the weighted average cost of capital (WACC) to date, it can be assumed that the rate should have become noticeably better. We can reduce it to 10% from 12.5% ​​in the 2018 analysis.

Based on total energy costs inof $0.0507/kWh, and a discount rate of 10%, a fair value distribution can be obtained. The final result is the average of all 10,000 trials. Additionally, we estimate that Antminer S19 Pro and Whatsminer M30s will still have 20% residual value after two years.

Needless to say, it shouldn'tbe perceived as the final verdict as to whether the equipment is overpriced or underpriced. The mean and standard deviation in the distribution of prices, the function between hash power and price, latency, total cost, discount rate, and residual value can all significantly affect the outcome of this estimate. For example, simulations with total costs of $ 0.07 / kWh and $ 0.03 / kWh will yield the following results:

It can be seen that at high total costs(left) prices for more efficient machines (Antminer S19 and Whatsminer M30s) are closer to their fair value than prices for lower tier machines. With low total costs (right), the prices of the less efficient machines (Antminer S17 and Whatsminer M20s) get better. This shows that given a reasonably competitive overall cost, a miner can also benefit from using less efficient machines.

In our model, we have provided a switch,which disconnects the equipment from the network if the mining profitability remains below the cost level for 14 days in a row. In the real world, miners rarely turn machines on and off based on short-term profitability. In most cases, they have agreements with the host of the datacenter on the minimum electricity consumption per month. Even after profitability falls below zero, most miners tend to wait for the downtrend to be confirmed before taking any action. Due to the laboriousness of the data center and the illiquidity of the machine market, miners are forced to focus on longer-term trends rather than short-term price movements. In recent years, the growth in the number of service providers in the secured lending market has also strengthened the ability of miners to weather bad times. Rather than selling large quantities of coins, miners have the option of pledging coins or equipment they own in order to get a fiat loan to pay for expenses. However, this is a theoretical lower bound for mining losses. Miners cannot lose more than capex plus cumulative operating expenses.

As with call options, the morethe volatile the underlying index is, the higher the theoretical value of the instrument. You can see how the results change when the parameters of the diffusion jump model change. When volatility is suppressed, the theoretical value of the machines plummets. With high volatility, the theoretical value rises rapidly:

</p>

* Based on total costs of $ 0.0507 / kWh

This analysis is based on the strategydaily sale(No. 3).As with backtesting, the fair value that can be "unlocked" by producing hash power is somewhere in the fair value range for strategies 1, 2, and 3. Given that the Monte Carlo model simulates 10,000 paths, each of which has completely different paths, one strategy should be sufficient to cover all types of market phases.

Future without block reward

Another variable that has a significantthe impact on the profitability of mining is fees. If we assume that the size of commissions will grow linearly by 5% and 10% per year, then the fair value of cars will increase significantly:

* Based on total costs of $ 0.0507 / kWh

In fact, the trend in the size of commissions is muchis more sporadic, and its relationship with other endogenous variables is less obvious. Modeling the trend in commission rates requires a completely separate allocation. In addition, there are many ways to improve the accuracy of the model:

  1. As already mentioned, use Monte Carlo with Markov chains to somewhat neutralize the curse of dimension.
  2. Introduce a dynamic lag based on four archetypal market cycles, use the Poisson process to simulate surges.
  3. Use hashrate-weighted average total cost instead of industry median cost.
  4. Use statistical methods to calibrate parameters.
  5. Use machine learning tools to describe the relationship between hashpower and price.
  6. Include projected fees in mining profitability calculation.
  7. Apply agent-based modeling to behaviorminers. Agent modeling is a technique for modeling complex systems to gain a deeper understanding of their behavior. It is widely used in high frequency trading or risk analysis of smart contracts. Under this system, each miner is treated as a “user” with different strategies and a different base price. Then we can define a few simple types of reactions (buy more cars, sell cars, buy cars plus wait 30 days, etc.) and build a library of "user behavior" options. This would allow us to model much more complex interactions in the hashpower marketplace.

Myron Scholes said: “All models have flaws. But this does not mean that they cannot be used as decision-making tools. "

Like the Black-Scholes model, the simulation modelIs a mechanism that, trying to reflect the real world in a short description, simplifies its intricate interconnections and intricacies. This reduction makes the model usable, but at the same time limits its usefulness. And in this sense, it is important to understand exactly what its limitations are, and that models in general represent only probabilities, and not reliable knowledge.

Nevertheless, the model can serve as a starting point.point for users who have already formed their understanding of the market. Like any predictive model, simulation models are only as good as the assumptions made by the user. Modeling tools are used today to turn these views of the future into a price for something that will be exposed to that version of the future.

Why is it important? What is the point of developing a theory of asset pricing in a market that is clearly driven by supply and demand?

Valuation is more than justtheoretical exercise. In the case of Bitcoin, where mining becomes completely dependent on fees, competition will bring very little advantage and there will be no predictable element in calculating mining profitability, how can we ensure that miners continue to produce hashpower? The answer lies in maintaining the stability of ongoing investment in mining equipment to increase the network security budget. This is very important because without sufficient hash power, the entire system becomes vulnerable to attacks, rendering the settlement guarantees provided by Bitcoin useless. An accurate scoring system is the first step in testing a wide range of assumptions, market behavior and appropriate planning. Estimating the cost of mining is the foundation of good risk management for mining organizations that are already becoming systemically important and “too big to fail”.

 

</p>