Goal
Extend the dashboard's earnings calculator (#12, shipped XMR-only; Tari in #117, XvB in #118) with two linked views:
- Energy — fleet power draw (W), efficiency (H/s per watt), and energy use (kWh / day · month · year), summed across workers.
- Profit — net profit = gross earnings − energy cost, over the same day / month / year horizons, at a configurable electricity price.
This turns "what does my hashrate earn" into "what does it earn after power — and which rigs actually pay for themselves."
Data source — RigForge's enriched API (use it, don't make the operator guess)
The power numbers come straight from RigForge's sister HTTP API (p2pool-starter-stack/rigforge#99), which already exposes, per worker:
(sampled via RAPL / TUNE_POWER_CMD, p2pool-starter-stack/rigforge#79). Pithead consumes this feed in #235; this calculator sums watts across workers for total fleet draw and uses hs_per_watt for efficiency.
Config (config.json)
Default unset → the calculator shows earnings + raw power/efficiency, but hides the profit (cost) math until a price is set. No silent assumption about power price.
What it shows
- Total fleet watts + H/s-per-watt (live), and kWh / day · month · year.
- Energy cost and net profit (gross − cost) per day / month / year, scaling with the same what-if hashrate input the earnings calc already uses.
- Per-worker efficiency, so the operator can spot a rig that's burning more than it earns.
Relationships
Acceptance criteria
Milestone
v1.5 — depends on #235 (RigForge power feed). A manual-watts-only MVP could land earlier with the v1.3 calculators (#117/#118) if we want it sooner; the RigForge-driven version belongs with #235.
Goal
Extend the dashboard's earnings calculator (#12, shipped XMR-only; Tari in #117, XvB in #118) with two linked views:
This turns "what does my hashrate earn" into "what does it earn after power — and which rigs actually pay for themselves."
Data source — RigForge's enriched API (use it, don't make the operator guess)
The power numbers come straight from RigForge's sister HTTP API (p2pool-starter-stack/rigforge#99), which already exposes, per worker:
(sampled via RAPL /
TUNE_POWER_CMD, p2pool-starter-stack/rigforge#79). Pithead consumes this feed in #235; this calculator sumswattsacross workers for total fleet draw and useshs_per_wattfor efficiency.powerblock must be parsed and surfaced before this can total it.power(older RigForge, a non-RigForge rig, or macOS where the probes are Linux-only) falls back to an operator-entered watts estimate, clearly marked "estimated."Config (
config.json)Default unset → the calculator shows earnings + raw power/efficiency, but hides the profit (cost) math until a price is set. No silent assumption about power price.
What it shows
Relationships
powerblock; hard prerequisite for the auto-watts path.power: { watts, hs_per_watt }.Acceptance criteria
powerfeed ([Feature] Dashboard: consume RigForge's enriched feed (rigforge#99) — update badge + per-worker health / power / tune / firmware #235), with a marked manual-estimate fallback per worker.cost_per_kwh.cost_per_kwhis set (no assumed price); energy/efficiency still shown.Milestone
v1.5 — depends on #235 (RigForge power feed). A manual-watts-only MVP could land earlier with the v1.3 calculators (#117/#118) if we want it sooner; the RigForge-driven version belongs with #235.