Yes somewhat… the formula has several factors that are constantly in flux, Bitcoin mining is a random process the value can be off entirely by chance. But it’s designed to self-adjust over the long run towards that formula, individual fluctuations cancel out in the long run.
For electricity price specifically, wholesale prices of electricity tend to be fairly close everywhere bitcoin is mined. Bitcoin mining is more profitable where electricity is the cheapest and is uneconomic in places where the price of electricity is above average. So it only happens where the wholesale price is globally competitive.
But wholesale prices shift significantly by time of day, especially in the spring and fall. California’s wholesale prices dipped to the negatives during the days this past spring, hitting -$26/MWh at one point in April. One can imagine projects that only mine when energy is cheap or Bitcoin is expensive, in places that can take advantage of that price volatility.
There are also a few projects that don’t rely on grid electricity because they’ve provisioned their own energy sources (one creative solution is a shipping container with a data center powered by waste flaring of natural gas at oil wells).
So I’d think the price volatility would make it hard to derive a meaningful calculation of energy use from real-time electricity pricing, rather than real-time computational complexity.
You’re not wrong.
Wholesale prices do bounce around significantly in a day, occasionally even going negative. And some miners do shutdown for brief periods during high demand due to a high electricity price. Some miners aren’t buying electricity from the grid, and have their own generation sources with different economic inputs. And there’s lots of day to day volatility in mining rates that has nothing to do with economics.
There’s no formula or methodology that could tell you how much energy is being wasted at any given moment. That impossible. There’s no way of knowing how many miners are operating globally at any given point in time. We can’t even reliably tell which country a block was mined in. We can only make reasonable estimates of global averages over the last few weeks.
You can get closer with more detailed modelling, but the equation I gave using global averages for bitcoin and electricity prices in the last few weeks will get you to an accurate estimate.