A wise Bitcoin miner should understand changes in revenue through models

A wise Bitcoin miner should understand changes in revenue through models

Loading

It may not be comprehensive, but it is useful to simulate changes in the mining revenue of Bitcoin miners through models.

Written by: Leo Zhang, Jack Koehler, Karim Helmy; the former two work at Anicca Research, a research organization for computing power and derivatives, and the latter is a data research analyst at Coin Metrics

This article is the second in the series of “Smart Bitcoin Miners”. The previous one is ” A Smart Bitcoin Miner Should Operate Hash Power Like a Management Investment “, by Anicca Research and Singapore Hash Power and Derivatives Investment and Trading Agency General Co-authored by Mining Research (GMR).

“Of course, anyone who tries to generate random numbers in a deterministic way is living in sin.”

John von Neumann

Overview

When it is difficult to test hypotheses through experiments, models can be used to simulate changes in returns. Bitcoin mining is opaque and highly capital-intensive, but if numerical simulation is the mainstay and qualitative analysis is supplemented, it will be easier to study the industry. It is expensive to rush to invest in mining under the premise that the market changes cannot be determined, but it is very cheap to build a model before actual operation.

In the first part of this series, we established a Monte Carlo model to simulate the fair value of the mining machine and its sensitivity to different market parameters. We have proved that due to the poor liquidity of mining machines, the market price of computing power often deviates from its theoretical fair value.

Reference reading:

“A wise Bitcoin miner should operate computing power like a management investment

In the previous article, we use the jump-diffusion (Jump-Diffusion) process on the future price trajectories were modeled using a linear function and to describe how the global count of force in response to price changes. But as discussed in several of our articles, the dynamic relationship between computing power and price goes beyond a simple linear relationship. In order to improve the representativeness of our framework, we must use the whole network computing power as a unit method to improve accuracy, and model from a bottom-up perspective.

Reference reading:

Bitcoin Mining’s Three Body Problem

In this article, we characterize the mining machine as several prototypes based on the type of mining machine , total operating costs and mining strategy . Each miner prototype has different profit margins and risk considerations . As mining revenue fluctuates, each mining union generates profits or losses, and the profits or losses will prompt them to decide to increase or decrease the number of operating mining machines.

Under this framework, the change of network computing power is not only a function of price changes, but also the sum of the decisions output by all miners with different economic and risk characteristics.

The code base of the model is completely open source and can be obtained here .

Users can insert their own assumptions and view the performance of their mining business in the future. In this article, we will introduce the model in detail, explain how to use it, and give some interesting findings from the analysis of five scenarios.

Conway’s Game of Life

We model the network computing power as the sum of the output of a single miner. This method is based on an agent-based simulation technique . Agent-based modeling originated from John Von Neumann’s early research on cellular automata in the 1950s and became popular due to John Conway’s “Game of Life” .

A wise Bitcoin miner should understand changes in revenue through models Image source: Teb’s Lab

Reference reading:

Agent-based modeling

How I optimized Conway’s Game Of Life

Play John Conway’s Game of Life

This is a turn-based simulation that takes place on a two-dimensional grid of cells . A pre-specified and decisive rule is responsible for governing the interaction between neighboring cells. Each round, the state of the cell will change according to the state of its neighboring cells: if the cell has exactly three living neighbors, they will be resurrected; if there are two or three living neighbors, they can survive, otherwise they will death.

“Game of Life” is an original example of an agent-based model, which is a type of simulation in which decisions are made by participants sharing a global state. In “Game of Life”, cells are agents, and their decision-making revolves around survival or death. The result depends entirely on the initial state of the board, and the state of the board may evolve in a non-intuitive way.

Agent-based modeling has greatly evolved from Conway’s “Game of Life”. Today, agent-based simulation is widely used in ecology , economics , quantitative finance, and smart contract analysis .

Reference reading:

Insights from the study of complex systems for the ecology and evolution of animal populations

The profitability of Bitcoin mining depends on the price of Bitcoin , the total computing power of the network , and to a lesser extent the transaction costs (so far). The second factor in calculating profitability, the network computing power, depends on whether other miners plan to run or shut down the machine. Therefore, the forecast of miners’ profitability must be iterative, and this problem is very suitable for agent-based modeling.

Assuming that the price of Bitcoin is completely independent of network computing power, we can model the price as an independent geometric Brownian motion. Each day in the time series can be regarded as a round; at the beginning of each round, the price and global computing power are input into the decision-making process of the miner agent.

Reference reading:

Geometric Brownian motion

According to their profit margins , each miner expands or reduces the scale of their operations by changing the number of machines they run, and announces the computing power of their operations. The sum of the computing power output of each miner therefore becomes the new global computing power.

A wise Bitcoin miner should understand changes in revenue through models

Mine work as an agent

Modeling the mining work as an agent is essentially parameterizing the input variables in mining economics. In The Alchemy of Hashpower (The Alchemy of Hashpower), we put forward the concept of the reflexivity of computing power: every mining operation will be severely affected by physical conditions and the operator’s subjective perception of the market.

Reference reading:

The Alchemy of Hashpower

Although it is impossible to cover all decision-making factors, we believe that the type of mining machine , cost basis and strategy should be the main factors that determine the behavior of miners. In the miner category, we set these factors as parameters.

Machine type

In the real world, a mining operation usually involves many different types of mining machines. For the sake of simplicity, we let each miner prototype use a single miner type throughout the analysis process. In this version of the simulation, we support the following types of miners:

A wise Bitcoin miner should understand changes in revenue through models

Cost basis: total electricity bill and energy consumption

Throughout the simulation process, each miner was assigned an average total power . Energy consumption for miners: the number of mining machines * mining machine type consumption.

Every day, the operating expenses incurred by miners are equal to: energy consumption/1000 total electricity costs 24.

We also specify a total electricity cost distribution , which determines the number of mining machines related to the miner prototype at the time of initialization.

In this version, we provide the following default layers. The user can customize it before running the simulation.

A wise Bitcoin miner should understand changes in revenue through models Forecast based on best effort

Strategy

  • Long Bitcoin

  • Clear every day

Each miner is assigned a strategy during initialization . In practice, miners can use a wide range of strategies, as long as their perception of market conditions changes, they can switch between these strategies.

For the sake of simplicity, we model each miner following the same strategy throughout the simulation. In “The Intelligent Bitcoin Miner, Part I” (The Intelligent Bitcoin Miner, Part I), we introduced these two strategies and evaluated their performance in different market cycles.

Reference reading:

“A wise Bitcoin miner should operate computing power like a management investment

Long Bitcoin means that miners only sell enough Bitcoin to cover operating expenses every day, and keep the rest of their income in Bitcoin.

Every day clearing means that miners immediately convert all assets into U.S. dollars.

The strategy of the miners determines how their USD positions and Bitcoin positions are allocated. When using the bullish bitcoin strategy to calculate the profit of miners, unrealized gains need to be considered. Unrealized income is calculated based on Bitcoin position * Bitcoin price.

Based on the combination of these three variables, we decompose the miner’s world into 11 types of mining machines, 7 electricity cost tiers, and 2 strategies, for a total of 154 prototypes .

At the time of initialization, we provided the default stratification and price data of mining machines on the market based on data from Hashrate Index , General Mining Research and some other sources. Users can customize before simulation:

A wise Bitcoin miner should understand changes in revenue through models Price data: Hashrate Index, General Mining Research. Percentage of computing power: estimates based on various sources

Reference reading:

Bitcoin runs on Hashrate

https://www.gmr.xyz/

Electricity fee distribution and mining machine stratification are the inputs of the number of mining machines for each miner. This represents the number of mining machines in the mining industry. It should be noted that in practice, these two distributions are not statistically independent as assumed in the model—for example, old miners like S9 are more likely to be operated by miners who can obtain cheaper electricity. .

At the beginning of the simulation, the sum of the computing power of all miners’ mining machines is scaled to roughly equal the current network computing power level, which is collected from * Coin Metrics**.

Reference reading:

https://charts.coinmetrics.io/network-data/

In order to track the performance of miners, we have added a simple account balance and historical profit calculator to the miner category.

  • Account Balance
    1. USD position
    2. Bitcoin positions
    3. Hash power position

The initial computing power position is the number of miners’ mining machines * mining machine type computing power.

  • Profitability

    1. Daily profit
    2. Profit in the last 30 days
    3. All profit

With the development of the market, profitability determines the behavior of the miners. We will introduce this mechanism in the next section. The profit in the last 30 days and the total profit are the sum of the extended profit.

Below are all the data entries of an example miner class. The code of the miner class can be found in the agents.py file.

A wise Bitcoin miner should understand changes in revenue through models

Reference reading:

https://github.com/khelmy/intelligent-bitcoin-miner/blob/main/agents.py

Utility function for miners

When the expected profitability is high, miners may want to buy more mining machines. When the expected future profitability is negative, they may shut down some mining machines to reduce operating expenses. We need to accurately define how miners increase or decrease their computing power.

In reality, there will be many external factors that drive miners to decide to buy or shut down mining machines, such as whether they can finance from outside, or even whether they are too tired. For the sake of simplicity, we model the miner’s historical profit as the main input in the miner’s decision-making process.

The decision-making process takes the profit of the last 30 days as input and calculates the result used to generate the operation. The calculation process is as follows:

If the last 30 days is zero or negative earnings, the miners will reduce the number of x mining machine until breakeven. The calculation method is simple: the loss (profit in the last 30 days) divided by the energy consumption cost of each mining machine.

If the profit in the last 30 days is positive and exceeds a certain threshold , miners will increase the number of mining machines. Thresholds for: Last 30 Days earnings> sum of all (expenses) of.

The number of additional mining machines is calculated as follows: (the sum of all (expenses) profitable in the last 30 days)/mining machine price*mining machine growth coefficient.

Each type of mining machine has a growth rate , which reflects its relative growth . Due to the lack of willingness of manufacturers to continue production, the growth rate of the older generation of mining machines is small. We also set a response delay for adding new miners. The production and delivery of new orders usually takes a while.

In our model, this means that after the action of adding x miners is triggered, the miners will not be added to the miner’s account immediately. We set up a constant list as the reaction time for each machine type. Response delay is a static approximation and should be updated regularly to reflect changes in supply chain capabilities.

A wise Bitcoin miner should understand changes in revenue through models Based on best effort estimates

All in all, the trigger function will output the number of miners bought or sold by the miner.

Users can update the growth factor and reaction days with constants they think are appropriate. The adjusted code can be found in Simulator.py .

Reference reading:

https://github.com/khelmy/intelligent-bitcoin-miner/blob/main/Simulator.py

Set up simulation

As in “Part One,” we use a random process to predict the price of Bitcoin during the simulated life cycle. The basic support of the geometric Brownian motion model comes from historical price data extracted from Coin Metrics.

Putting everything together, we use the following diagram to illustrate how this process works:

A wise Bitcoin miner should understand changes in revenue through models

Reference reading:

“A wise Bitcoin miner should operate computing power like a management investment

Scene analysis

To test the model, we simulated different market conditions and analyzed the resulting behavior of miners. We evaluated the profitability of a user miner. The miner received $1 million in preliminary funds for the purchase of mining machines, but was unable to further expand the scale of operations. The simulation runs for 100 days, and the average result of 25 tests is taken.

The profitability of users is measured according to different types of mining machines and several different power costs . The highlights are as follows.

The parameters used are by no means certain, and users are free to re-run the analysis with their own assumptions. The scene analysis code can be found in main.py.

Reference reading:

https://github.com/khelmy/intelligent-bitcoin-miner/blob/main/main.py

Cow market view

Our first test is to simulate a bull market scenario. Considering the ongoing bull market at the time of writing, we simply fit the geometric Brownian motion model to historical data . Under these conditions, the price gradually rose to more than US$100,000, undergoing several corrections along the way.

A wise Bitcoin miner should understand changes in revenue through models

The network computing power has steadily increased, and has undergone some small lagging corrections as the price drops.

A wise Bitcoin miner should understand changes in revenue through models

In this case, the profit of keeping a Bitcoin position is much higher than selling Bitcoin every day, even if the electricity price is high. Considering the rapid appreciation of Bitcoin prices, this makes sense.

A wise Bitcoin miner should understand changes in revenue through models

Calculated at a price of 4 cents per kilowatt-hour, only miners who use S9 mining machines and maintain positions in Bitcoin can achieve breakeven during the 100-day simulation period.

A wise Bitcoin miner should understand changes in revenue through models

Market volatility

In the second scenario analysis, we simulated an extremely volatile market, increased the volatility term in the history-fitting GBM model by 25%, and set the drift to 0. The price initially rose to nearly 80,000 U.S. dollars, and then plummeted to just over 40,000 U.S. dollars.

A wise Bitcoin miner should understand changes in revenue through models

Computing power began to grow rapidly, but began to stabilize as prices fell. Due to the response delay, the computing power will continue to increase, but at a slower rate.

A wise Bitcoin miner should understand changes in revenue through models

Initially, these two strategies performed equally, with Bitcoin bulls performing slightly better than sellers who cleared out every day . As the price fell, miners with exposure to bitcoin were punished for taking on additional risks, and the market value of bitcoins held by them fell.

A wise Bitcoin miner should understand changes in revenue through models

Bear market

The third type of simulation simulates a bear market by fitting GBM to historical data and flipping the sign of the drift term . The price dropped sharply from its current level to nearly $30,000.

A wise Bitcoin miner should understand changes in revenue through models

In order to cope with the price drop, the network computing power entered a correction after the initial increase. This is the transition from inventory refresh to the cyclical shock phase introduced in “The Alchemy of Computing Power” .

A wise Bitcoin miner should understand changes in revenue through models

Reference reading:

The Alchemy of Hashpower, Part II.

In a bear market, everyone suffers. This is especially true for Bitcoin bulls : at a price of 4 cents per kilowatt-hour of electricity, even the most efficient operation will not be able to recover half of the initial investment during the simulation period if faced with Bitcoin risk exposure.

A wise Bitcoin miner should understand changes in revenue through models

Daily clearing seller performed significantly better, but because their earnings are still dependent on the price of Bitcoin, so performance is still not as good as when the bull market.

A wise Bitcoin miner should understand changes in revenue through models

In a bull market, is it better to use old mining machines or new ones?

Scenario 4 uses the same historical parameters as Scenario 1, and the purpose is to compare the performance of miners running new and old hardware under competitive electricity prices.

This time, the price soared above US$140,000, accelerating all the way. The computing power has also increased rapidly.

A wise Bitcoin miner should understand changes in revenue through models

A wise Bitcoin miner should understand changes in revenue through models Scenario 1 vs. Scenario 4

Taking into account the strength of the bull market, even miners who clear out Billy coins every day can achieve breakeven within a 100-day simulation period when running the S9 mining machine. The profit of the S19 mining machine is much lower, but it can still recover most of the initial investment while selling it every day.

A wise Bitcoin miner should understand changes in revenue through models

In this case, the profitability of long Bitcoin miners is amazing. During the simulation period, the investment of miners running S9 basically doubled, and S19 miners can also obtain considerable profits.

A wise Bitcoin miner should understand changes in revenue through models

How important is it to reduce operating costs in a bear market?

The fifth and final simulation is back to run in a bear market. The goal this time is to analyze the effect of electricity costs on profitability . To this end, we evaluated the performance of the S9 and S19 mining machines in bear market conditions, with electricity costs of 3, 4, and 5 cents per kilowatt-hour, respectively.

The situation is similar to scenario 3: The price plummets, and there is a shallow but long-term correction in computing power.

A wise Bitcoin miner should understand changes in revenue through models

A wise Bitcoin miner should understand changes in revenue through models Scenario 3 vs. Scenario 5

For S9 miners , the cost of electricity makes a substantial difference. Although under these conditions, regardless of the level of electricity costs, miners’ performance is not good, but with an electricity fee of 3 cents per kWh, the return rate of miners who are long Bitcoin is close to 40% of their initial investment. , If the electricity bill is changed to 5 cents per kWh, the rate of return is slightly lower than 32%.

A wise Bitcoin miner should understand changes in revenue through models

This sensitivity to electricity prices helps explain why S9 miners tend to operate in areas where electricity costs are cheaper.

For S19 miners , this difference is not so obvious. Although miners with lower electricity prices still earn more than miners with higher electricity prices, this variable has a much smaller impact on profitability.

A wise Bitcoin miner should understand changes in revenue through models

in conclusion

Dimensions are the natural enemy of statisticians, and Bitcoin mining is a difficult problem to model. Even our model with only a few simplified assumptions is much more complicated than we initially imagined. Like all Monte Carlo-based tools, its predictive power is fundamentally limited by user biases, which will spread from the initial seed conditions to all results.

Reference reading:

https://en.wikipedia.org/wiki/Allmodelsarewrong

Our model explicitly assumes that the relationship between price and computing power is one-way, and at the same time assumes the independence between the possible related mining machine models and the distribution of electricity costs. All models are incomplete, but some are useful.

We think this model is useful. It should find its place in the toolbox of wise Bitcoin miners.