## Mining for fun and profit

So we’re about a month into our crypto mining experiment, and things have been pretty interesting. We’re using a pretty simple 6-GPU setup, and relying on Awesome Miner and Mining Pool Hub to operate. This post will go over a few of the customizations we’ve had to make with this setup, as well as some of the details of our profit tracking spreadsheet that we’ve developed.

We’re not going to cover hardware setup or hash rates in this post, instead I want to talk about how I’m monitoring our setup and making sure that it stays operational, and how we’re tracking profits and expenditures.

There’s a few points we need to cover for the non-technical readers before we delve to deep into the details. The first point is about algorithms. An algorithm (algo) is a fancy word for a particular math equation. One can throw various inputs into an algo and get a series of outputs. For example, the algorithm to convert Celsius to Fahrenheit is f = c * 9/5 + 32. This is very simple compared to the SHA-256 algorithm used by bitcoin, or Ethereum’s Equihash. The main takeaway here that there are many different algorithms used by various cryptocurrencies. The second point is about difficulty, which is used as a general measure for the total amounts of mining power operating on a particular crypto. The more miners that participate on by throwing their hashrate at a certain coin, the harder it becomes to mine a block. This is because most tokens try to maintain a set block time. For bitcoin this is 10 minutes; Litecoin, 2 minutes; Ethereum, 15-20 seconds. Gernerally speaking, the lower the difficulty, the more likely it is for an individual or pool of miners to claim a mining reward from a certain coin.

The first thing piece of the puzzle we want to talk about is Mining Pool Hub (MPH). A pool is place where multiple miners pool together to work on a certain algo/coin. The combined power of the pool makes it more likely that the participants will recieve the reward for that period than if they were working independently. MPH enables the use of profit-switching, which means that a miner will work on whatever coin/algo is showing the best return for a particular time period. Some miners may focus on a particular token, and choose to mine only that, but profit-switching calculates which coin or algorithm is showing the best profit for the last day or week, based on your miner’s hashrate, coin price and current difficulty level. Whattomine.com is probably the most popular site that helps one calculate the coin du jour. This site has preset hash rates for popular GPUs and estimates coin proceeds based on your hash rate and current algorithm difficulty.

For our rig we’re relying on is Awesome Miner which is our primary mining node management software. It has a couple of features that are really important, mainly managed profit switching compatibility, and recovery/notification options. To the first point, profit switching means that it will take direction from MPH to run whichever miner program and algorithm that it needs to. Awesome Miner will also restart a miner when it crashes, and send us SMS notifications if the rig goes offline for whatever reason. Right now we’re using one of the basic versions, but the application scales for use with hundreds of rigs. It’s very scalable.

Profit tracking is very important for a mining operation. Our original operations plan called for throwing our hashpower at MPH for a month and just accumulating whatever it deems profitable. To simplify record-keeping, we would only move coin from the pool to our wallet once a certain value amount was reached. So far the only coins to reach this threshold has been ZCoin and ZClassic. In order to track this we’re using a Google Sheet with a custom Google Script file to pull balances into a cell in each coins’ row.

```//returns current confirmed balanace of coin in mph wallet
//var my_api = API key from MPH account settings
//name = pool prefix for coin, i.e. "bitcoin-gold" or "zencash"

function mphbalance(name)
{

var user_api_key = my_api
var method = "getuserbalance";
var url = "https://" + name + ".miningpoolhub.com/index.php?page=api&action=" + method + "&api_key=" + user_api_key;

var response = UrlFetchApp.fetch(url);
var json = response.getContentText();
var data = JSON.parse(json);

var result = data.getuserbalance;
balance = result.data.confirmed;;
return balance;