OPEN-SOURCE SCRIPT
Miner Profitability Index | Astral Vision

Miner Profitability Index | Astral Vision 🌠💠
This indicator constructs a measure of Bitcoin miner profitability per unit of mining difficulty, then applies Z-Score normalization in log space to quantify how statistically extreme current profitability conditions are relative to their own history. Miner profitability is a structurally important on-chain signal because miners are one of the few participants with predictable and measurable cost structures: when profitability collapses, miners are forced to sell reserves to cover operational costs, creating persistent sell pressure; when profitability is exceptionally high, miners tend to accumulate and expand capacity, which historically precedes periods of increased hash rate and eventually difficulty adjustment that compresses margins back toward equilibrium.
Calculation ⚙️
The daily miner revenue in USD is computed from three components: the number of blocks mined that day (computed as the difference between consecutive daily block height readings from Glassnode), the block subsidy in BTC (derived from the block height using the halving schedule: 50 BTC before block 210,000, halving at each subsequent 210,000-block interval), and the current Bitcoin price in USD. The formula is: miner revenue = blocks per day × block reward × BTC price.
This revenue figure is then divided by the current mining difficulty to produce the efficiency ratio: miner revenue / difficulty. Difficulty represents the computational work required to mine a block and serves as a proxy for the aggregate energy and capital expenditure of the mining network. Dividing revenue by difficulty produces a measure of how many dollars miners earn per unit of computational difficulty, normalizing for the expanding size of the mining network over time. Without this normalization, absolute revenue would grow indefinitely simply due to price appreciation and hash rate expansion, making historical comparisons meaningless.
The efficiency ratio is smoothed with a configurable EMA to reduce the noise introduced by day-to-day variation in block count. The natural logarithm is then taken before applying the Z-Score, which is necessary because the efficiency ratio follows an approximately log-normal distribution: in raw space it would be heavily right-skewed, making the standard deviation an unreliable measure of typical deviation. In log space the distribution is much more symmetric and the Z-Score thresholds carry consistent statistical meaning across all periods.
The Z-Score is computed as: (log(efficiency) - SMA(log(efficiency), N)) / StDev(log(efficiency), N), where N is the configurable lookback window. This expresses how many standard deviations the current log-efficiency sits above or below its rolling historical mean. Two pairs of thresholds define moderate and severe extreme zones on each side.
Plots 📊
Inputs 🎛️
Colors 🎨
5 Astral Vision presets + custom override. Default: Futura.
Purpose 🎯
Standard miner revenue charts display absolute USD earnings, which grow indefinitely with price and provide no statistical context for whether current conditions are extreme or normal. Dividing by difficulty removes the network size effect, and normalizing with a Z-Score in log space makes readings directly comparable across all market cycles including early periods when absolute revenue was tiny. The dual threshold system separates mild deviations from statistically severe conditions, providing a more granular signal than a single overbought/oversold level.
Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions.
This indicator constructs a measure of Bitcoin miner profitability per unit of mining difficulty, then applies Z-Score normalization in log space to quantify how statistically extreme current profitability conditions are relative to their own history. Miner profitability is a structurally important on-chain signal because miners are one of the few participants with predictable and measurable cost structures: when profitability collapses, miners are forced to sell reserves to cover operational costs, creating persistent sell pressure; when profitability is exceptionally high, miners tend to accumulate and expand capacity, which historically precedes periods of increased hash rate and eventually difficulty adjustment that compresses margins back toward equilibrium.
Calculation ⚙️
The daily miner revenue in USD is computed from three components: the number of blocks mined that day (computed as the difference between consecutive daily block height readings from Glassnode), the block subsidy in BTC (derived from the block height using the halving schedule: 50 BTC before block 210,000, halving at each subsequent 210,000-block interval), and the current Bitcoin price in USD. The formula is: miner revenue = blocks per day × block reward × BTC price.
This revenue figure is then divided by the current mining difficulty to produce the efficiency ratio: miner revenue / difficulty. Difficulty represents the computational work required to mine a block and serves as a proxy for the aggregate energy and capital expenditure of the mining network. Dividing revenue by difficulty produces a measure of how many dollars miners earn per unit of computational difficulty, normalizing for the expanding size of the mining network over time. Without this normalization, absolute revenue would grow indefinitely simply due to price appreciation and hash rate expansion, making historical comparisons meaningless.
The efficiency ratio is smoothed with a configurable EMA to reduce the noise introduced by day-to-day variation in block count. The natural logarithm is then taken before applying the Z-Score, which is necessary because the efficiency ratio follows an approximately log-normal distribution: in raw space it would be heavily right-skewed, making the standard deviation an unreliable measure of typical deviation. In log space the distribution is much more symmetric and the Z-Score thresholds carry consistent statistical meaning across all periods.
The Z-Score is computed as: (log(efficiency) - SMA(log(efficiency), N)) / StDev(log(efficiency), N), where N is the configurable lookback window. This expresses how many standard deviations the current log-efficiency sits above or below its rolling historical mean. Two pairs of thresholds define moderate and severe extreme zones on each side.
Plots 📊
- Z-Score oscillator colored by zone: two upper levels and two lower levels with graduated opacity
- Two upper and two lower threshold lines
- Zero midline
- Fill highlights when Z-Score is beyond the outer thresholds
- Static zone fills between inner and outer thresholds on both sides
- Background color on the price chart with four gradient levels reflecting zone severity
Inputs 🎛️
- Z-Score Lookback: rolling window for mean and standard deviation normalization
- Smoothing: EMA period applied to the raw efficiency ratio before log transformation
- Upper Z 1 and Upper Z 2: configurable inner and outer upper threshold levels
- Lower Z 1 and Lower Z 2: configurable inner and outer lower threshold levels
Colors 🎨
5 Astral Vision presets + custom override. Default: Futura.
Purpose 🎯
Standard miner revenue charts display absolute USD earnings, which grow indefinitely with price and provide no statistical context for whether current conditions are extreme or normal. Dividing by difficulty removes the network size effect, and normalizing with a Z-Score in log space makes readings directly comparable across all market cycles including early periods when absolute revenue was tiny. The dual threshold system separates mild deviations from statistically severe conditions, providing a more granular signal than a single overbought/oversold level.
Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
My premium indicators are available on Whop:
whop.com/astralvision
Astral Vision 🌠💠
whop.com/astralvision
Astral Vision 🌠💠
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
My premium indicators are available on Whop:
whop.com/astralvision
Astral Vision 🌠💠
whop.com/astralvision
Astral Vision 🌠💠
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.