Skip to content

Dashboard: energy & profit calculator — net profit (earnings − power cost), from RigForge's power telemetry #260

Description

@VijitSingh97

Goal

Extend the dashboard's earnings calculator (#12, shipped XMR-only; Tari in #117, XvB in #118) with two linked views:

  1. Energy — fleet power draw (W), efficiency (H/s per watt), and energy use (kWh / day · month · year), summed across workers.
  2. Profitnet 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:

"rigforge": { "power": { "watts": 142.0, "hs_per_watt": 86.9 }, ... }

(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)

"dashboard": {
  "energy": {
    "cost_per_kwh": 0.0,   // electricity price; 0/unset ⇒ profit math hidden, energy view still shows draw/efficiency
    "currency": "USD"
  }
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dashboardMining dashboard web UIenhancementNew feature or requestperformanceHashrate / tuning / efficiencysecuritySecurity-sensitive issue or hardening

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions