[Ethereum] What’s the formula to calculate the mining profitability for ETC

ethereum-classicmining

I know there are calculators for mining profit, but I need to include the same thing in an app I'm building, what formula do they use for Ethereum Classic?
Also, can I use the same formula for other cryptocurrencies or is it different every time?
Is there some website/guide/etc. that I can use to learn more about this?

Best Answer

Look at a calculator source code, there are some on github and you'll find the exact formula :

  $scope.ethPrice = ethereumStats.priceUsd;
  $scope.netHashGH = (ethereumStats.difficulty / ethereumStats.blockTime) / 1e9;
  $scope.blockTime = ethereumStats.blockTime;
  $scope.earnings = {};
  $scope.computeProfits = function() {
    var userRatio = $scope.userHash * 1e6 / ($scope.netHashGH * 1e9);
    var blocksPerMin = 60.0 / $scope.blockTime;
    var ethPerMin = blocksPerMin * 5.0;
    $scope.earnings.min = userRatio * ethPerMin;
    $scope.earnings.hour = $scope.earnings.min * 60;
    $scope.earnings.day = $scope.earnings.hour * 24;
    $scope.earnings.week = $scope.earnings.day * 7;
    $scope.earnings.month = $scope.earnings.day * 30;
    $scope.earnings.year = $scope.earnings.day * 365;
  };
Related Topic