Refrigerant accounting for grocery chains

The gas is gone. The question is whether it is now a violation.

Every rack has a mass balance: what the store bought, what was recovered, what was charged. The remainder is refrigerant that left the building without a work order. MassBalance runs that balance per system across eight stores and thirty-six months, prices the loss at today's gas price, and tells you which racks crossed EPA 608's 35% twelve-month line — plus the day the repair clock started.

How the balance is computed
synthetic portfolio · 36 months
unexplained refrigerant, portfolio
—lb
—
over threshold—
watch list—
repair deadlines—
8 stores · 48 racks · 3 refrigerants · prices and thresholds are live
01 — Live portfolio

Forty-eight balances. Three of them just became a legal problem.

Purchases are recorded at the store, then allocated to each rack by metered draw. Every row below is computed from those records at request time. Move the price or the threshold and every number, badge, and deadline follows.

$18.50/lb

Blended R-404A / R-448A / R-449A replacement cost per pound.

35%

EPA 608 default is 35% of full charge over 12 months.

live · server-computed

No client-side math. The API recomputes all 48 systems on every change.

Portfolio balance synthetic

loading…
store systems lost lbs worst 12-mo rate risk trust ⓘ
loading portfolio…
Click any store for its six rack balances, 12-month sparklines, and compliance deadline. —

02 — Why this is not a leak report

A leak report tells you a sensor tripped. This tells you who owes what.

Refrigerant is inventory with a paper trail: purchases, recoveries, charges. When those three numbers disagree, the difference is either a leak, a bookkeeping gap, or theft. MassBalance refuses to blur them together.

/ 01

Where, not just how much

The portfolio total is the sum of 48 individual mass balances. A store-level number hides the one rack that is losing a full charge every two years — which is exactly the rack the rule is about.

/ 02

Trust is a column, not a footnote

Three stores never write down a fifth of their recovery entries. That does not make the gas reappear; it makes the balance wrong. The trust score and gap count sit next to every dollar so you know which rows to believe.

/ 03

It ends in a date

Crossing 35% is not a dashboard event. It starts a 30-day repair clock under 40 CFR 82.157. MassBalance returns the crossing month and the deadline, priced at what the lost gas actually cost.

03 — Method

One balance per rack. One rolling window. One comparison.

This is arithmetic over four recorded numbers per system per month. No model, no anomaly scoring, no sensor fusion. A result you cannot recompute by hand is not a result you can hand to an auditor.

01

Balance the cylinder

Unexplained loss is purchases plus recoveries minus what was charged into systems, accumulated per rack. Store purchases are allocated to racks by metered draw, not by guesswork.

02

Roll twelve months

At every month-end, sum the trailing twelve months of loss and divide by that rack's full charge. That percentage is the number the regulation names.

03

Compare to the line

At or above 35% — configurable — the system is flagged. The crossing month is the first month-end where the window closed over the line.

04

Price it, date it

Lost pounds times the gas price gives the dollar exposure. The first crossing plus 30 days gives the repair deadline. Both travel with the verdict.

// per system, per month loss(m) = purchased + recovered − charged // trailing window at month-end t L12(t) = Σ loss(m) for m ∈ (t−11 … t) rate(t) = L12(t) / fullCharge × 100 // the determination VIOLATION ∃ t : rate(t) ≥ threshold crossing = first such t deadline = end_of(crossing) + 30 days // what it cost dollars = Σ loss × gasPrice

The dataset is generated deterministically from a fixed seed: 8 stores, 6 racks each, 36 months, three refrigerants. The same request always returns the same balance.

04 — API

Two endpoints. The whole book.

Query with a price and a threshold; get the portfolio or one store's rack-level series. Every dollar figure is recomputed, never cached from generation.

# portfolio roll-up
curl -s 'https://massbalance.toyou.gr/api/portfolio?price=18.5&threshold=35'

// → totals, stores[], top[10]
{
  "totals": {
    "lostLbs": 6183.1,
    "dollars": 114387.20,
    "overThreshold": 3
  },
  "stores": [{ "id": "S06", "rate": 54.8,
              "trust": 83, "status": "violation" }]
}
# one store, six racks, 12 points each
curl -s 'https://massbalance.toyou.gr/api/store/S01?price=18.5&threshold=35'

{
  "name": "Northgate Market",
  "trust": 82,
  "systems": [{
    "id": "S01-S1",
    "rate": 50.9,
    "status": "violation",
    "crossingMonth": "2025-12",
    "deadline": "2026-01-30",
    "series": [{ "month": "2025-11",
                 "rate": 44.1, "lostLbs": 344.2 }]
  }]
}
05 — Limits, stated up front

What this cannot do.

Three honest limits. A product that hides them is selling confidence, not accounting.

Garbage in, phantom loss

This is a formula over paperwork, not a measurement. A back-dated purchase, a recovery logged against the wrong rack, or a missing entry moves pounds between systems. The trust column measures missing fields, not wrong ones.

Incumbents bundle this

Emerson, Danfoss, and building-automation suites already expose leak detection and refrigerant logs. MassBalance is not a monitoring replacement — it is the balance-and-deadline layer on records those systems rarely reconcile.

Compliance liability

This is a screening tool, not legal advice. 40 CFR 82.157 also governs recordkeeping, retrofit, and retirement decisions. The dataset here is synthetic; a real deployment needs a human and probably a lawyer.