Bitcoin Forum
October 21, 2019, 11:39:51 AM
 Home Help Search Login Register More
 Pages: [1] 2 3 4 5 6 7  All
 Author Topic: Price vs Difficulty Charts - indicators for buying or mining  (Read 81210 times)
bitcoinBull
Legendary

Offline

Activity: 826
Merit: 1000

rippleFanatic

 May 06, 2011, 06:00:38 PM

These charts should help answer the question of which is more profitable and when, mining or buying.  By laying down price and difficulty side by side, it should also shed some insight into which is the leading indicator, and which is the lagging.  IMHO, price is the leading indicator.  When difficulty follows a rise in price, it confirms the strength of the rise.

I had to make these charts since I couldn't find the quantitative comparison anywhere.  The price data is the MtGox historical data provided by bitcoincharts.com.  The difficulty data is from blockexplorer.com/q/nethash.

The difficulty estimates are very choppy over smaller windows, so I used a 7-day average.  For proper comparison with the price, I used the weighted average price over the same 7-day window.  I start in mid-October since that's when both price and difficulty start really taking off.

The charts were made in Python using matplotlib with interpolation from SciPy to smooth out the curves.

Anyone feeling gracious and generous can donate to [1GRCJR5hwGMivtWtjghX2zEkaR2SeUES2c].  For anyone who wants the code, I'll be happy to share it for a few BTC.  I'll try to update these on a weekly basis.

The first couple of charts plot difficulty and price side-by-side.  It is a little sloppy to compare two measures of different units, and they can look very different depending on the scales of the two separate y axes.  Nonetheless, I attempt a meaningful comparison by applying a simple scaling factor of 10^5 to the price.  Still, this side-by-side plot is rather arbitrary compared to the ratio plot.

Below are two views of the price to difficulty ratio: price over difficulty and its inverse difficulty over price.

Using price over difficulty highlights increases in price relative to difficulty.  The highs indicate when mining (and selling as mined) is more profitable and the lows indicate best times to buy (worst times to sell).

If you wonder why anyone mining back in November would sell at a measly \$0.20, you can see why above!  The difficulty factor at the time was so low that selling mined coins, even at the low low price of \$0.25, was two to three times more profitable than today.

Using difficulty over price highlights decreases in price relative to difficulty.  Highs indicate bargain prices and excelling buying opportunities (and bad times for miners to sell).  Lows indicate best times to mine and sell.

As can be seen, we're in miner territory right now.

College of Bucking Bulls Knowledge
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1571657991
Hero Member

Offline

Posts: 1571657991

Ignore
 1571657991

1571657991
 Report to moderator
1571657991
Hero Member

Offline

Posts: 1571657991

Ignore
 1571657991

1571657991
 Report to moderator
1571657991
Hero Member

Offline

Posts: 1571657991

Ignore
 1571657991

1571657991
 Report to moderator
BitterTea
Sr. Member

Offline

Activity: 294
Merit: 250

 May 06, 2011, 06:30:43 PM

It would be awesome if these graphs were available real(ish)-time on Bitcoincharts or the like.

Paging tcatm...

Stephen Gornick
Legendary

Offline

Activity: 2506
Merit: 1001

 May 06, 2011, 07:32:05 PM

Most excellent!

Another data series that would be interesting to see charted would be the cost of electricity per-BTC (or better, per-USD based on market rate at the time.)

 Unichange.me █            █            █            █            █            █            █            █            █            █            █            █            █            █            █            █
tomcollins
Full Member

Offline

Activity: 182
Merit: 101

 May 06, 2011, 09:08:58 PM

If you already invested in a mining rig, you need a really low price to stop mining.  However, investing in a new rig is better when the price is high (and you expect it to drop in the future) compared to buying coins directly.

I think your model does not take a lot of this into affect.  When there is a big incentive to mine (price goes up a lot), the miners that get built from that peak tend to stay online even after a price drop.  Unless the cost is so bad, you'll certainly beat electricity costs, so might as well keep going.

My model uses a different model.  The difficulty tends to increase even with a constant price.  If the price increases, more miners show up (and stay online for a while).  Miners tend to go offline only after steep drops in prices.  I used a ratio of price to difficulty and it took a pretty bad ratio for the difficulty to drop.  Right now, the difficulty to price ratio is very favorable, so mining looks real good for now, but give it another month or two, and it gets worse pretty fast, especially if the price ever drops.  More rigs come online anyway as more people find out about Bitcoins and people already have the equipment to mine but just weren't using it for mining and can recoup costs.
Ryan
Newbie

Offline

Activity: 17
Merit: 0

 May 06, 2011, 09:48:34 PM

What do the peaks at troughs correlate to news-wise?
Current-C
Full Member

Offline

Activity: 124
Merit: 100

 May 07, 2011, 01:25:15 AM

If I'm reading this correctly it is really interesting in that the percentage above or below the mean for the price/difficulty could be a solid indicator that we are overbought/oversold.  Would it be possible to add an MA or something this oscillates around?  It looks like we have a reasonably consistent slope in the ratio graphs -- is this expected to continue or will this level out over time do you think?  Tip to the author for very useful tools.
bitcoinBull
Legendary

Offline

Activity: 826
Merit: 1000

rippleFanatic

 May 07, 2011, 06:51:46 AM

Most excellent!

Another data series that would be interesting to see charted would be the cost of electricity per-BTC (or better, per-USD based on market rate at the time.)

AFAIK, electricity rates (at least in the US), don't fluctuate day-to-day.  So this chart wouldn't look much different than a BTC/USD chart.  Electricity rates do vary across geography though, and those can be visualized on a map.  But again, the change would just be proportional to BTC/USD changes.

So do the extra step of BTC to USD to kWh of electricity per location, to get a fluctuating map mashup in terms of BTC.  Finally, one could take into account the difficulty factor, and animate the map to show return on kWh mapped by location, in terms of BTC over time.

We might have to start pooling a bounty for that..

College of Bucking Bulls Knowledge
bitcoinBull
Legendary

Offline

Activity: 826
Merit: 1000

rippleFanatic

 May 07, 2011, 08:26:55 AM

If you already invested in a mining rig, you need a really low price to stop mining.  However, investing in a new rig is better when the price is high (and you expect it to drop in the future) compared to buying coins directly.

I think your model does not take a lot of this into affect.  When there is a big incentive to mine (price goes up a lot), the miners that get built from that peak tend to stay online even after a price drop.  Unless the cost is so bad, you'll certainly beat electricity costs, so might as well keep going.

My model uses a different model.  The difficulty tends to increase even with a constant price.  If the price increases, more miners show up (and stay online for a while).  Miners tend to go offline only after steep drops in prices.  I used a ratio of price to difficulty and it took a pretty bad ratio for the difficulty to drop.  Right now, the difficulty to price ratio is very favorable, so mining looks real good for now, but give it another month or two, and it gets worse pretty fast, especially if the price ever drops.  More rigs come online anyway as more people find out about Bitcoins and people already have the equipment to mine but just weren't using it for mining and can recoup costs.

The charts are measurements, not a model.  It is how we interpret the charts to make projections going forward when we are using a model.

The charts show that increases in difficulty follow increases in price.  So by this interpretation, price is the leading indicator and difficulty is the lagging indicator.  Leading indicators tend to be more volatile, so when the lagging indicator follows the rise of the leading, it confirms the strength of the rise.

The period of mid-February through March, when difficulty increased and prices corrected, was a period when the price lept forward and difficulty had to catch up.  When difficulty crossed over, it confirmed the strength of the previous rise above the \$1 parity and we had another rally shooting past \$1, continuing beyond \$3 and touching above \$4.  So we are again at the period of the end of a rally, where price is leading above the difficulty and the price is waiting for the difficulty to catch up.  When it does, its a confirmation of the strength of the rise, and after which price will rally again, leading the next increase in difficulty, ad infinitum.

If I'm reading this correctly it is really interesting in that the percentage above or below the mean for the price/difficulty could be a solid indicator that we are overbought/oversold.  Would it be possible to add an MA or something this oscillates around?  It looks like we have a reasonably consistent slope in the ratio graphs -- is this expected to continue or will this level out over time do you think?  Tip to the author for very useful tools.

Yes.  I think it would be possible to derive some type of technical oscillator to indicate overbought/oversold.  In the next chart I've drawn some trend lines to highlight this.

And yeah - there is a downward slope in the Price over Difficulty ratio, meaning difficulty has been increasing faster than price over this term on average.  However, because this chart is still very short-term, ~7 months, its hard to say that this will be a long term trend.

Looking at the huge bubble over November, where mining was extremely profitable even at a price of \$0.25, that could mean it was the first serious bull market and was overbought in terms of price over difficulty.  The 6-month decline in price over difficulty since could be seen as a short-term correction from then, compounded by subsidized mining (gamers living in grandma's basement).  The most optimistic view means returning back to those levels.

On the other hand, the November bubble of extremely high price over difficulty could be an outlier just because it was at the very beginning of the market.  Also, it could be an anomaly which seems bigger than it actually is because the chart doesn't account for the volume of trades at those prices.  In either of those cases, we could exclude that period of november and then the decrease in price over difficulty is less dramatic.

Either way, the price over difficulty is on a modest decline, so mining is less obscenely profitable than it was (even while selling at \$0.25!), though still obviously profitable.  I see three ways to predict what happens next:

A)  If we extrapolate the decline to zero profit for miners then that would lead to a stagnation of growth and the popping of a bubble (which could still recover again after hitting bottom).

B)  If we project a slowing rate of decline which tapers out and stabilizes, then we would we see a more competitive market for miners but continuing growth both in price and difficulty.  The ratio would be constant, so the growth could still continue exponentially, eventually slowing to linearly.

C)  If we project a slowing a rate of decline in the price over difficulty, which then upturns and starts increasing, that would mean the return to an extreme bull market and their obscene short-term profits for both miners and (low price) buyers alike.

Over the long term I guess I could see all three happening at various stages over the lifetime of bitcoin.  What happens next is anyone's guess.

College of Bucking Bulls Knowledge
jaybny
Sr. Member

Offline

Activity: 408
Merit: 250

Proof-of-Skill - protoblock.com

 May 07, 2011, 08:49:54 AM

Quote
The period of mid-February through March, when difficulty increased and prices corrected, was a period when the price lept forward and difficulty had to catch up.  When difficulty crossed over, it confirmed the strength of the previous rise above the \$1 parity and we had another rally shooting past \$1, continuing beyond \$3 and touching above \$4.  So we are again at the period of the end of a rally, where price is leading above the difficulty and the price is waiting for the difficulty to catch up.  When it does, its a confirmation of the strength of the rise, and after which price will rally again, leading the next increase in difficulty, ad infinitum.

so what your saying that prices can never drop?

Protoblock turns knowledge of American football into Fantasybit coin, a margin token used to monetize leveraged skill.

LMGTFY
Hero Member

Offline

Activity: 644
Merit: 502

 May 07, 2011, 09:01:19 AM

Quote
The period of mid-February through March, when difficulty increased and prices corrected, was a period when the price lept forward and difficulty had to catch up.  When difficulty crossed over, it confirmed the strength of the previous rise above the \$1 parity and we had another rally shooting past \$1, continuing beyond \$3 and touching above \$4.  So we are again at the period of the end of a rally, where price is leading above the difficulty and the price is waiting for the difficulty to catch up.  When it does, its a confirmation of the strength of the rise, and after which price will rally again, leading the next increase in difficulty, ad infinitum.

so what your saying that prices can never drop?
I'm not sure that that's exactly what bitcoinBull is saying, no. From mid-February to start-April prices actually fell back from a peak of 1.100 USD to a low of 0.561 BTC. That's the main reason I'm cautious about investing in mining.

This space intentionally left blank.
bitcoinBull
Legendary

Offline

Activity: 826
Merit: 1000

rippleFanatic

 May 07, 2011, 09:11:47 AM

I'm finding the Price over Difficulty chart the easiest to interpret.  I've attempted to add some trendlines this time.

As you can see, the lower channel represents short term periods of bear markets.  I like to think of it as the bargain basement.

From the current price of ~\$3.50, a steep drop to the top of the bargain basement would be a drop to a price/difficulty ratio of 1:1.  With current difficulty at ~150k, that would be a drop to \$1.50.  A drop to the bottom of the bear trap would below \$1.00, to some \$0.60-\$0.70.  That would be below the record low price/difficulty of some 0.7:1, in early april, when the price was around \$0.70 and the difficulty was at 100k.

A steep drop doesn't seem likely.  Already, the difficulty estimate looks like it could approach 200k next week.  So if we see a drop over the next week, and the difficulty keeps rising, at \$2.00 we'd be at the top of the bargain basement.

An even slower correction.  Let's say over the next 4-6 weeks difficulty keeps increasing to 300k, and price declines to \$3.00.  We're again entering the bargain basement, ready for another surge to the top of the upper channel, from price/difficulty of 1:1 to 2:1, from \$3.00 to \$6.00.

Those are the pessimistic predictions.  The most pessimistic is that we get caught in the bear trap for a while and difficulty growth slows.  But we would expect to surge out of the trap eventually.

The more optimistic is that price continues sideways with small corrections while difficulty continues strong growth.  In that case the ratio declines, approaching the bargain basement, but rallies from somewhere in between.

The most optimistic is that price increases from ~3.50 as difficulty increases, reaching \$4.00 when difficulty is at 200k, and \$6.00 when difficulty is at 300k. It crosses over and remains above the yellow line to either retreat eventually, or surge higher towards 3:1, 4:1 in parabolic growth and a return to the level of a bull market back in November.

College of Bucking Bulls Knowledge
bitcoinBull
Legendary

Offline

Activity: 826
Merit: 1000

rippleFanatic

 May 07, 2011, 09:41:32 AMLast edit: May 07, 2011, 09:51:42 AM by bitcoinBull

Quote
The period of mid-February through March, when difficulty increased and prices corrected, was a period when the price lept forward and difficulty had to catch up.  When difficulty crossed over, it confirmed the strength of the previous rise above the \$1 parity and we had another rally shooting past \$1, continuing beyond \$3 and touching above \$4.  So we are again at the period of the end of a rally, where price is leading above the difficulty and the price is waiting for the difficulty to catch up.  When it does, its a confirmation of the strength of the rise, and after which price will rally again, leading the next increase in difficulty, ad infinitum.

so what your saying that prices can never drop?

Prices can drop.  But if difficulty continues to increase and catch up to a price, then we expect the price to surge upward again.

The price has never dropped below the difficulty for long.  If the price drops, and difficulty drops below, then price drops more, followed by difficulty, that would be a strong bear market and could lead to a crash.

College of Bucking Bulls Knowledge
abyssobenthonic
Member

Offline

Activity: 98
Merit: 10

 May 07, 2011, 01:16:56 PM

Any chance you could do a log(price)/log(difficulty) (or maybe a (10+log(price))/log(difficulty)) chart?
tomcollins
Full Member

Offline

Activity: 182
Merit: 101

 May 07, 2011, 01:26:08 PM

Quote
The period of mid-February through March, when difficulty increased and prices corrected, was a period when the price lept forward and difficulty had to catch up.  When difficulty crossed over, it confirmed the strength of the previous rise above the \$1 parity and we had another rally shooting past \$1, continuing beyond \$3 and touching above \$4.  So we are again at the period of the end of a rally, where price is leading above the difficulty and the price is waiting for the difficulty to catch up.  When it does, its a confirmation of the strength of the rise, and after which price will rally again, leading the next increase in difficulty, ad infinitum.

so what your saying that prices can never drop?

Prices can drop.  But if difficulty continues to increase and catch up to a price, then we expect the price to surge upward again.

The price has never dropped below the difficulty for long.  If the price drops, and difficulty drops below, then price drops more, followed by difficulty, that would be a strong bear market and could lead to a crash.

Why should we expect price to go up if difficulty increases?  Isn't it the other way around?
bitcoinBull
Legendary

Offline

Activity: 826
Merit: 1000

rippleFanatic

 May 07, 2011, 06:37:57 PM

Why should we expect price to go up if difficulty increases?  Isn't it the other way around?

Price goes up when difficulty increases because as they become harder to get from mining, people buy.

Difficulty increases when price goes up because higher prices offset the increase in difficulty, making mining attractive again.

The question here is which is the leading indicator and which is the lagging.

College of Bucking Bulls Knowledge
tomcollins
Full Member

Offline

Activity: 182
Merit: 101

 May 07, 2011, 07:32:10 PM

Why should we expect price to go up if difficulty increases?  Isn't it the other way around?

Price goes up when difficulty increases because as they become harder to get from mining, people buy.

Difficulty increases when price goes up because higher prices offset the increase in difficulty, making mining attractive again.

The question here is which is the leading indicator and which is the lagging.

Pretty obvious to me that price drives difficulty.  If it's super profitable to mine, then people start rigs.  That increases difficulty.  I don't see too many miners in the buying bitcoin arena (otherwise they would have never started mining, since it's less profitable).
mpkomara
Full Member

Offline

Activity: 183
Merit: 100

 May 08, 2011, 07:09:12 PM

It is also important to remember that the transaction costs involved in selling BTC for other currencies means that, at the margins, the most efficient miners are those who hoard their bitcoins.  This means that (given unchanged transaction costs) the percentage of hoarders-cum-miners relative to profit-taking-miners is usually increasing.
Stephen Gornick
Legendary

Offline

Activity: 2506
Merit: 1001

 May 09, 2011, 04:40:20 AMLast edit: May 09, 2011, 04:57:13 AM by sgornick

This means that (given unchanged transaction costs) the percentage of hoarders-cum-miners relative to profit-taking-miners is usually increasing.

There are additional reasons why I agree with that.

When the BTC/USD was declining, holding on to your bitcoins meant the buying power (in terms of USD) was becoming less over time. (i.e., we had "price inflation").   So selling bitcoins as soon as they were earned provided the greatest results (again, in terms of USD).

Now the opposite is happening, and thus the longer one holds onto bitcoins the greater the spending power from those coins.

There is another factor at play as well, though I only have anecdotal evidence of it occuring:
New miners appear to generally sell much of their mining output earned until their breakeven point is reached (i.e., until total revenue matches the amount invested.)  But after breakeven has been reached the bitcoin proceeds earned are kept for investment.  Many of those new miners resulting from the February boost have either recently just reached breakeven or they will be hitting that point very shortly.

Thus as the price rise results in breakeven being reached faster for many, the number of bitcoins these miners are supplying to the market decreases faster as the result.

Of course both of these contribute to and are vulnerable to cycles where found are peaks needing correction and troughs that offer a buying opportunity.

[edited]

 Unichange.me █            █            █            █            █            █            █            █            █            █            █            █            █            █            █            █
IlbiStarz
Full Member

Offline

Activity: 336
Merit: 100

 May 26, 2011, 01:30:17 AM

Am I doing something wrong?

425000/850000 = 0.51 = Mine

Which graph is right?
bitcoinBull
Legendary

Offline

Activity: 826
Merit: 1000

rippleFanatic

 May 26, 2011, 05:24:19 AM

Here is the latest chart, sorry for the long delay.

These new charts use a finer measurements: 504-block difficulty estimates and the weighted average mtgox price over the same time interval.  With a flat difficulty or 6 blocks per hour, this is 3.5 days.  But when the difficulty is doubling like it is lately, and blocks are being generated at 12 an hour, it is half of 3.5 or 1.75 days.  This number is the interval between data points.

Price Over Difficulty to May 24

Last update was beginning of May and price/difficulty ratio was just above 2:1.  That seemed high at the time because over the previous month bitcoin had went from an average around \$1.00 to about \$3.00.  So the price increased by 300% but difficulty only 50% (from around 100,000 to 150,000), so the ratio went from below one at \$1.00:100,000 to over two at \$3.00:150,000.

Then the price jumped to \$5 and to \$8 (touching \$8.90 but averaging \$8), sending the ratio has as just over 3:1.  So when bitcoin was at \$8.00, the estimated difficulty (average hash rate over 504 blocks) was at 266,000 (8 divided by 3).

Then the price sank down to a \$6 average.  Whilst the hash rate increased even faster than before, crossing 350,000.  So \$6/350,000 is 1.7 - the ratio dropped to under two.

Today.  A jump to \$9.50, currently \$8.30.  With the difficulty estimate of 426,000, we have a ratio of \$8.3/4.26 = 1.95.

This is the on-the-fly calculation one can do to estimate the current ratio.

So even though the price jumped today to \$8.3, the difficulty increase has been equal and we remain at a ratio just under 2:1.

What will happen next?

Scenario 1)  Sideways price movement coupled with the increasing difficulty means that the ratio declines to 1:1, e.g. with a price of \$10.00 when there is an estimated difficulty of 1,000,000.

Scenario 2)  Rapidly increasing difficulty is met with equal increase in price, keeping the ratio at 2:1.  For example, the price breaks \$10 when difficulty estimate surpasses 500,000.  Bitcoin is at \$20.00 by the time the difficulty estimate is at 1,000,000.

Scenario 3)  Another pop in price pushes the ratio back up from 2:1 to 3:1.  At an estimated difficulty of 500,000 the price goes to \$15.  It could come back down as low as \$10 or even lower like \$7.50, while difficulty increases to 1,000,000, sinking the ratio to 1:1 or 0.75:1.

These are the optimistic scenarios.  Pessimistic scenarios, like a drop in price and/or a rapidly slowing difficulty growth, don't seem likely.  As in the chart, the record low price/difficulty ratio was around 0.75 at the beginning of April.

College of Bucking Bulls Knowledge
 Pages: [1] 2 3 4 5 6 7  All