Bitcoin Forum
December 10, 2016, 10:59:28 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 3 »  All
  Print  
Author Topic: What's your magic number? (or, Should I keep mining?)  (Read 8200 times)
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
May 20, 2011, 04:06:46 PM
 #1

Watching the difficulty go up, I realized I needed a way to quickly recognize when the day comes that mining is no longer profitable. So I worked out the following. Maybe someone else will find it useful.

If you are a miner, your your "magic number" is M = (shares * hashes) / (power * cost), where
  • shares is the (constant) rate of "share" generation per hash, which is about 0.000233 shares/Mhash or 233 shares/Thash;
  • hashes is your hashing rate versus time (say 780 Mhash/sec or 2.81 Thash/hr);
  • power is your rate of energy consumption for mining (say 450W or 0.450kW); and
  • cost is your cost of electricity (say 0.150 USD/kWh).

All of these numbers are relatively fixed, so go ahead and calculate your M now. Be sure you have the units straight---this "number" is actually denominated in shares per <fiat>. In fact, it has a specific meaning: it's the number of difficulty 1 shares you are generating per <fiat> spent on electricity. Using the data above, for example, my magic number is about 9700 shares/USD.

The point of this exercise is that your mining is profitable on the margin if and only if M > diff / (xcg * reward), where diff and xcg are the current difficulty and exchange rate and reward is the block reward (50 BTC right now). So when difficulty increases and you're wondering whether to keep mining, or the exchange rate soars and you're wondering whether it's time to fire up the ol' CPU again, you now have an easy way of deciding. Just divide difficulty by exchange rate and reward, and compare it to your magic number.

For example, right now we have a cutoff of (244139 shares/block) / (6.63 USD/BTC * 50 BTC/block) ≈ 735 shares/USD. Anyone whose magic number is lower than this shouldn't be mining. Fortunately, mine is still well above it! Unless the exchange rate tanks or the difficulty soars, I should still be in the game for at least a couple of months.

Ian Maxwell
PGP key | WoT rating
1481367568
Hero Member
*
Offline Offline

Posts: 1481367568

View Profile Personal Message (Offline)

Ignore
1481367568
Reply with quote  #2

1481367568
Report to moderator
1481367568
Hero Member
*
Offline Offline

Posts: 1481367568

View Profile Personal Message (Offline)

Ignore
1481367568
Reply with quote  #2

1481367568
Report to moderator
BitterTea
Sr. Member
****
Offline Offline

Activity: 294



View Profile
May 20, 2011, 05:10:01 PM
 #2

Excellent post!

It appears my magic number is ~15,000. I'm mining with a single 5850, see if my numbers check out.

0.972 Thash/hr, 0.151 kW (based on the mining hardware comparison), $0.10/kWh.
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
May 20, 2011, 05:37:33 PM
 #3

When calculating the electricity cost, don't forget: everything that uses power, that wouldn't use power otherwise, is a mining cost. If my machine weren't mining, it would be sleeping and wouldn't have a window fan pointed at it.

Ian Maxwell
PGP key | WoT rating
Turix
Member
**
Offline Offline

Activity: 76



View Profile WWW
May 20, 2011, 05:47:11 PM
 #4

My magic number is around 16,731 using a single 5870 with a hash rate of around 375Mhash/s (1.35 Thash/hour) - I have discounted the power requirements for the other components since the PC would be on pretty much 24/7 anyway (its not a dedicated miner) and as such the mining is only costing me the extra GPU power (0.188 kW) draw at a rate of £0.10 kWh. (Infact it is probably reducing my heating costs  Roll Eyes)

The current difficulty value for GBP (based off Britcoin ask rates) 244139 / (£3.50 * 50 BTC) = 1395.08 (shouldn't this be Shares/GBP?).

Last Update: 18:40 BST 21st May

Edit: I've decided to calculate my magic number including all other components and internals, cooling etc, which all in all uses around 350W (Core 2 Duo E5200 @ 2.75, 4x1Gb DDR2, Assorted drives).

( 1.35 Thash/hour * 233 shares/Thash ) / ( 0.35 W * £0.10 ) = 8987.14

A much lower number once I included all the internals and USB stuff also drawing power; however I would probably keep mining up until the 16,000 mark simply because the other components would be turned on regardless  since this is a desktop machine and I don't count their cost off my BTC profits.

YinCoin YangCoin ☯☯First Ever POS/POW Alternator! Multipool! ☯ ☯ http://yinyangpool.com/ 
Free Distribution! https://bitcointalk.org/index.php?topic=623937
Bwincoin - 100% Free POS. BSqnSwv7xdD6UEh8bJz8Xp6YcndPQ2JFyF
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
May 20, 2011, 06:02:22 PM
 #5

The current difficulty value for GBP (based off Britcoin ask rates) 244139 / (£3.85 * 50 BTC) = 1268.25 (shouldn't this be Shares/GBP?).

Absolutely right! A share is just a hash that would be valid at difficulty 1. I've edited the post to use this terminology.

Ian Maxwell
PGP key | WoT rating
Gameover
Member
**
Online Online

Activity: 70


View Profile
May 20, 2011, 06:10:07 PM
 #6

Mine is 16,776
at0m
Newbie
*
Offline Offline

Activity: 4


View Profile
May 20, 2011, 06:42:36 PM
 #7

A theoretical 2x6870 rig @ 600MHash/s combined.

(233 * 2.16) / (0.450 * 0.21) = 5325.71...
244139.48158254 / (6.44 * 50) = 758.197...

Something doesn't seem right (It is 4am, though... nothing seems right when it's 4am)
Turix
Member
**
Offline Offline

Activity: 76



View Profile WWW
May 20, 2011, 07:04:20 PM
 #8

A theoretical 2x6870 rig @ 600MHash/s combined.

(233 * 2.16) / (0.450 * 0.21) = 5325.71...
244139.48158254 / (6.44 * 50) = 758.197...

Something doesn't seem right (It is 4am, though... nothing seems right when it's 4am)

No that's right (Well your Thash/hour is a little out but its close), your just paying twice the amount per kWh in power than most of the other results in this thread which is forcing your Magic number to be about half the size (give or take).

YinCoin YangCoin ☯☯First Ever POS/POW Alternator! Multipool! ☯ ☯ http://yinyangpool.com/ 
Free Distribution! https://bitcointalk.org/index.php?topic=623937
Bwincoin - 100% Free POS. BSqnSwv7xdD6UEh8bJz8Xp6YcndPQ2JFyF
BitterTea
Sr. Member
****
Offline Offline

Activity: 294



View Profile
May 20, 2011, 07:08:09 PM
 #9

For those who have difficulty converting units... Smiley

MHash/sec * 60 seconds/minute * 60 minutes/hour * 1 THash/1000000 Mhash = THash/hour

All the numerator units except THash cancel, and all the denominator units except hour cancel.

Btw, someone should throw this up on a website to calculate all this stuff. Exchange rate and difficulty could probably be filled in automatically with a couple of calls to BlockExplorer and MtGox.

Code:
<script type="text/javascript">
function calculate()
{
 var hashRate = parseFloat(document.getElementById('hashRate').value);
 var powerUse = parseFloat(document.getElementById('powerUse').value);
 var powerCost = parseFloat(document.getElementById('powerCost').value);
 var difficulty = parseFloat(document.getElementById('difficulty').value);
 var exchangeRate = parseFloat(document.getElementById('exchangeRate').value);
 var subsidy = parseFloat(document.getElementById('subsidy').value);

 if (isNaN(hashRate)) alert('Invalid hash rate.');
 else if (isNaN(powerUse)) alert('Invalid power use.');
 else if (isNaN(powerCost)) alert('Invalid power cost.');
 else if (isNaN(difficulty)) alert('Invalid difficulty.');
 else if (isNaN(exchangeRate)) alert('Invalid exchange rate.');
 else if (isNaN(subsidy)) alert('Invalid generation subsidy.');
 else
 {
  var magicNumber = (233 * (hashRate * 60 * 60 / 1000 / 1000)) / (powerUse * powerCost);

  var baseline = difficulty / (exchangeRate * subsidy);

  document.getElementById('magicNumber').value = magicNumber;
  document.getElementById('baseline').value = baseline;

  if (magicNumber < baseline) alert('Mining is profitable!');
  else alert('Mining is NOT profitable!');
 }
}

</script>

<table>
 <tr>
  <td>Hash rate (Mhash/s)</td>
  <td><input id="hashRate" type="text"></td>
 </tr>
 <tr>
  <td>Power use (kW)</td>
  <td><input id="powerUse" type="text"></td>
 </tr>
 <tr>
  <td>Power cost (USD/kWhr)</td>
  <td><input id="powerCost" type="text"></td>
 </tr>
 <tr>
  <td>Current difficulty</td>
  <td><input id="difficulty" type="text"></td>
 </tr>
 <tr>
  <td>Exchange rate</td>
  <td><input id="exchangeRate" type="text"></td>
 </tr>
 <tr>
  <td>Generation Subsidy</td>
  <td><input id="subsidy" type="text"></td>
 </tr>
 <tr>
  <td colspan="2"><input type="button" value="Calculate" onclick="calculate()"></td>
 </tr>
 <tr>
  <td>Magic Number</td>
  <td><input id="magicNumber" type="text" readonly="true"></td>
 </tr>
 <tr>
  <td>Baseline</td>
  <td><input id="baseline" type="text" readonly="true"></td>
 </tr>
</table>
epi 1:10,000
Full Member
***
Offline Offline

Activity: 154


View Profile
May 20, 2011, 08:19:55 PM
 #10

currently the exchange rate is tanking and the difficulty is on track to go up quite a bit.
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
May 20, 2011, 11:14:26 PM
 #11

Well, it's not exactly a calculator, but maybe this is useful. All the numbers scale nicely: that is, if you want to look at the 1M-10M difficulty range just multiply all the magic numbers by 10, or if you want to look at exchange rates in the 10-100 range just divide them all by 10.

Code:
Break-even magic numbers by difficulty and exchange rate (assumes 50 BTC/block)

                                       EXCHANGE RATE
             1.00   2.00   3.00   4.00   5.00   6.00   7.00   8.00   9.00  10.00
          +---------------------------------------------------------------------
D  100000 |  2000   1000    667    500    400    333    286    250    222    200
I  200000 |  4000   2000   1333   1000    800    667    571    500    444    400
F  300000 |  6000   3000   2000   1500   1200   1000    857    750    667    600
F  400000 |  8000   4000   2667   2000   1600   1333   1143   1000    889    800
I  500000 | 10000   5000   3333   2500   2000   1667   1429   1250   1111   1000
C  600000 | 12000   6000   4000   3000   2400   2000   1714   1500   1333   1200
U  700000 | 14000   7000   4667   3500   2800   2333   2000   1750   1556   1400
L  800000 | 16000   8000   5333   4000   3200   2667   2286   2000   1778   1600
T  900000 | 18000   9000   6000   4500   3600   3000   2571   2250   2000   1800
Y 1000000 | 20000  10000   6667   5000   4000   3333   2857   2500   2222   2000

Ian Maxwell
PGP key | WoT rating
Basiley
Jr. Member
*
Offline Offline

Activity: 42


View Profile
May 21, 2011, 10:11:43 AM
 #12

as long as complexity rise, only guys with cheap electricity stay in business.
half-year ? maybe faster.
ie, guys with access to industrial area, living in Russia or under Nuke power station Tongue
Inaba
Legendary
*
Offline Offline

Activity: 1260



View Profile WWW
May 21, 2011, 04:39:48 PM
 #13

For those who have difficulty converting units... Smiley

MHash/sec * 60 seconds/minute * 60 minutes/hour * 1 THash/1000000 Mhash = THash/hour

All the numerator units except THash cancel, and all the denominator units except hour cancel.

Btw, someone should throw this up on a website to calculate all this stuff. Exchange rate and difficulty could probably be filled in automatically with a couple of calls to BlockExplorer and MtGox.


What is the subsidy variable you added intended to be?

If you're searching these lines for a point, you've probably missed it.  There was never anything there in the first place.
Basiley
Jr. Member
*
Offline Offline

Activity: 42


View Profile
May 21, 2011, 04:51:19 PM
 #14

"42" (c) ?
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
May 21, 2011, 04:57:21 PM
 #15

I just noticed something: If you're paying $0.15/kWh or less for electricity, mining with a very high-end CPU, such as a Phenom 2 X6, is actually marginally profitable at the moment. This even with the recent drop in value and fast rise in difficulty, which implies that it was more-than-marginally profitable a week ago. (This only applies if you already own the CPU, of course.)

Ian Maxwell
PGP key | WoT rating
Basiley
Jr. Member
*
Offline Offline

Activity: 42


View Profile
May 21, 2011, 05:01:37 PM
 #16

few months/weeks later mining can't be profitable even with GPU.
and after hash change[SHA256 isn't bulletproof enough, IMO], even CPU's mining goes in history too.
BitterTea
Sr. Member
****
Offline Offline

Activity: 294



View Profile
May 21, 2011, 05:18:03 PM
 #17

For those who have difficulty converting units... Smiley

MHash/sec * 60 seconds/minute * 60 minutes/hour * 1 THash/1000000 Mhash = THash/hour

All the numerator units except THash cancel, and all the denominator units except hour cancel.

Btw, someone should throw this up on a website to calculate all this stuff. Exchange rate and difficulty could probably be filled in automatically with a couple of calls to BlockExplorer and MtGox.


What is the subsidy variable you added intended to be?

Subsidy is another name for the block reward. I prefer the term subsidy because it implies that it is a temporary measure while the network is smaller and transaction fees are not a sufficient enticement for mining.
grndzero
Sr. Member
****
Offline Offline

Activity: 392


View Profile
May 21, 2011, 06:10:30 PM
 #18

1.44 Gh/s 820Watts .092 KW/hr

(1 440 * 233) / (.820 * .092) = 4 447 507.95

So I'm good until the difficulty reaches 4,447,507.95 ?

Ubuntu Desktop x64 -  HD5850 Reference - 400Mh/s w/ cgminer  @ 975C/325M/1.175V - 11.6/2.1 SDK
Donate if you find this helpful: 1NimouHg2acbXNfMt5waJ7ohKs2TtYHePy
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140



View Profile WWW
May 21, 2011, 07:03:18 PM
 #19

1.44 Gh/s 820Watts .092 KW/hr

(1 440 * 233) / (.820 * .092) = 4 447 507.95
Careful with the units.

(1) 1.44 Gh/s is 0.00144 Th/s, not 1440. So divide by 1,000,000.

(2) Your hashrate is a rate per second, but your power usage is a rate per hour. So multiply by 3600.

(3) I'm assuming by "KW/hr" you mean "dollars/kWh" (or whatever currency you prefer).

This gives you an actual magic number of 16,043.4286 shares/dollar.

Quote
So I'm good until the difficulty reaches 4,447,507.95 ?

You're good until the difficulty divided by (50x the exchange rate) reaches 16,043.4286. But this number is falsely precise and you'd be better off looking out for the number 16,000.

Ian Maxwell
PGP key | WoT rating
urtur
Jr. Member
*
Offline Offline

Activity: 32



View Profile
May 21, 2011, 08:05:03 PM
 #20

If mining for a pool that has a fee one should use an adjustment for the reward: For example if the fee is 2% (like Slush's one) the reward should be 49 not 50.

Values for me:

M=317
Threshold=275

So I should mine even if my comp has nothing else to do.  Cool
Pages: [1] 2 3 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!