How to get an alert when your bitcoin miner stops being profitable
Short answer: To get an alert when your bitcoin miner stops being profitable, compare hashprice from free mempool.space and CoinGecko data with your power cost on a schedule, and alert when your margin drops below a threshold. You can set this up yourself with the steps below, or use our ready-made Miner Profitability Monitor recipe.
What you need
- Total fleet hashrate (TH/s)
- Total power draw at the wall (watts; from your PDU, or the spec sheet plus about 5%)
- Your all-in power cost ($/kWh)
- Your pool fee (%)
- An alert threshold, for example margin under 10%
Free data sources
- Block rewards, last ~day:
https://mempool.space/api/v1/mining/reward-stats/144 - Network hashrate and difficulty:
https://mempool.space/api/v1/mining/hashrate/3d - Next difficulty adjustment:
https://mempool.space/api/v1/difficulty-adjustment - BTC price:
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd(backup:https://mempool.space/api/v1/prices) - Manual sanity check: the free Hashrate Index website shows hashprice (its API is paid, so it isn't used for automation).
The math
daily_btc_per_TH = (totalReward_sats / 1e8) / (currentHashrate_Hs / 1e12)
hashprice_usd_TH = daily_btc_per_TH × BTC_price
revenue_day = hashprice_usd_TH × your_TH × (1 − pool_fee)
power_day = (your_watts / 1000) × 24 × your_$per_kWh
profit_day = revenue_day − power_day
margin = profit_day / revenue_day
break_even_$kWh = revenue_day / ((your_watts / 1000) × 24)
This is an estimate: luck, pool payout method (FPPS vs PPLNS) and fee spikes all move real payouts.
Step by step
- Gather your numbers. Total fleet hashrate (TH/s), total power draw at the wall (watts), your all-in power cost ($/kWh) and your pool fee.
- Pull free network data. Block rewards and hashrate from mempool.space and the BTC price from CoinGecko (free, no key needed for light use).
- Work out hashprice and margin. Hashprice is USD earned per TH/s per day. Multiply by your TH/s and subtract pool fee and power cost to get daily profit and margin.
- Set an alert threshold. Alert when margin falls below a threshold (the template default is 10%) or goes negative, and when the next difficulty adjustment would push you under it.
- Schedule the check. Run it every 4 hours with a daily summary, in Grok Bot, ChatGPT/Claude, or self-hosted n8n.
Which alerts are worth sending
- Throttle / power down: margin below your threshold or negative.
- Heads-up: the next difficulty adjustment is estimated at +3% or more and would push you under your threshold.
- Check your pool: your pool's payout per TH is noticeably below what network hashprice suggests.
- Good news: margin recovers after a throttle alert.
Keep it advice-only: the alert tells you what changed; you decide what to do with your miners.
Skip the setup
The Miner Profitability Monitor (Template 01) does all of this, with a Grok Bot routine, ChatGPT/Claude instructions and an n8n workflow outline. It's part of the Pro Pack. For a free daily view of price, fees, hashrate and the next difficulty adjustment, try the Bitcoin Price & News Daily Brief.