OPEN-SOURCE SCRIPT

Bitcoin Production Cost | Astral Vision

506
Bitcoin Production Cost | Astral Vision 🌠💠

This indicator estimates the real-world cost of producing one Bitcoin by modeling the energy expenditure of the mining network from on-chain data, then divides by the daily coin issuance to express that cost in USD per BTC. The result is a fundamental price floor reference: sustained trading below the cost of production is historically short-lived because unprofitable miners shut down, reducing hash rate, reducing difficulty, and eventually restoring profitability for those who remain.

Calculation ⚙️

The hash rate is fetched from Glassnode in exahashes per second and converted to terahashes per second. The energy consumption of the network per day is then estimated as: kWh per day = hash rate (TH/s) × efficiency (J/TH) × 86,400 seconds per day / 3,600,000 joules per kWh. This converts the product of hash rate and energy per hash into kilowatt-hours of electricity consumed daily by the entire network.

The hardware efficiency parameter is set dynamically by era rather than using a single static value. Each major mining hardware generation is assigned an approximate efficiency in joules per terahash: 2,000 J/TH before 2014 (early GPU and first-generation ASICs), declining through 800, 500, 250, 100, 85, 55, 40, and 32 J/TH at successive epoch boundaries, with the user-configurable current efficiency applied to recent and future bars. This epoch-based schedule reflects the documented progression of ASIC hardware efficiency over Bitcoin's mining history.

The electricity price is similarly segmented by era, reflecting the documented geographic concentration of mining: a configurable pre-2019 rate for the early period, a lower configurable rate for the Chinese dominance era before the 2021 mining ban, and a configurable post-exodus rate for the current globally distributed mining landscape.

The daily BTC reward available to miners is computed as 144 blocks per day multiplied by the current block subsidy, derived from the block height using the halving schedule, plus daily transaction fees in BTC converted from the CoinMetrics USD fee data. This sum is smoothed with a 7-day SMA to reduce the noise from day-to-day block count variation.

The electricity cost per BTC is then: (kWh per day × electricity price) / daily reward in BTC. This represents what miners spend on electricity alone to produce one Bitcoin. The total production cost divides the electricity cost by the electricity percentage of total costs (default 60% based on CBECI methodology), adding the implicit cost of hardware amortization, facilities, and operations.

The Miner Price is a separate reference: current Bitcoin price plus the USD value of transaction fees per BTC, representing the effective revenue miners receive for each coin equivalent produced. When Miner Price exceeds Total Cost, mining is profitable; when it falls below, miners are operating at a loss.

Plots 📊
  • Electricity Cost per BTC with glow effect (toggleable)
  • Total Production Cost per BTC with glow effect (toggleable)
  • Miner Price with glow effect (toggleable)
  • Fill between Electricity Cost and Total Cost
  • Information table with current values for all key metrics: electricity cost, total cost, miner price, BTC price, price-to-total-cost ratio, efficiency, electricity rate, electricity percentage, and block subsidy


Inputs 🎛️
  • Electricity $/kWh for three historical eras: pre-June 2019, pre-May 2021, and post-May 2021
  • Electricity percentage of total costs: used to gross up electricity cost to total production cost
  • Efficiency J/TH: applied to recent and future bars, historical values are set automatically by epoch
  • Show Electricity Cost, Total Production Cost, Miner Price: individual toggles
  • Glow effect and info table toggles
  • Table position: four corner options


Colors 🎨
5 Astral Vision presets + custom override. Default: Infinito.

Purpose 🎯
Standard support and resistance tools are derived entirely from price history and have no connection to the economic reality of Bitcoin production. This indicator derives its reference levels from the physical cost of mining, making it independent of price action and structurally grounded in the economics of the network. The price-to-total-cost ratio in the table provides an immediate reading of how far current price sits above or below break-even for miners, which has historically been one of the most reliable macro cycle indicators available on-chain.

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.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.