Rate Engine & Interface

For a commodity like electricity where you can’t tell one electron from another, the real user experience is the cost. So then why are they so often so confusing?

After building rate calculators for behemoths like PG&E, we took a step back and decided to design a rate interface from scratch. Our goals were:

  1. Transparent to the developer. Unlike software staples like e-commerce or to-do lists, rates can be intimidating. What’s a load profile do, and how does it tie into a rate? What are all these rate components? We wanted there to be minimal confusion.
  2. Fast. Like, really fast. Calculations happen pretty much instantly because the compiled version is written in javascript and therefore executed locally on the browser, not some distant server.
  3. Dependenable. We wrote ours in typescript (aka the types of variables we pass around are strictly defined) and have 100% test coverage (aka each function has at least one test).

The result is blazing fast and full featured. Take it for a spin below.

Load Profile

Lost in the discussions about rates is often the most important input - the load profile. It’s like knowing a pencil costs ten cents, but not knowing how many pencils you’re ordering.

We made the load profile a first-class citizen of our rate engine. This means you can filter the load profile without calculating any rates. Here's a sample for ComEd's average 2019 load, graphed by hour and segregated by weekdays and weekends.

ComEd's Average 2019 Load

Source: PJM region CE (ComEd), filtered for 2019

How do we get here? First and foremost, filtering the load profile is as easy as writing a filter:

loadProfile.filterBy({filters}) // creates a new, filtered load profile

The filters available allow you to dig into any month, hour, day, or even holiday. The full list of optional filters are:

months: [0, 1] // array of 0 indexed months to includedaysOfWeek: [1, 3] // array of 0 indexed days of week, starting with SundayhourStarts: [11, 12, 13] // array of 0-23 representing hours to includeonlyOnDays: ['2019-10-11', '2019-03-29'] // array of YYYY-MM-DD date strings to includeexceptForDays: ['2019-12-25'] // array of YYYY-MM-DD date strings to exclude

Once filtered, the typical sum, average, and count methods are available. These methods can be combined and recombined. For example, to get the average of weekend load from 1am to 2am, you can simply write:

loadProfile.filterBy({hourStarts: [1], daysOfWeek: [1, 2, 3, 4, 5]}).average()

That's right, you can get any information and describe any behavior with just a few functions.


When the load profile is so dissectable, rates and their associated costs become a pleasure to work with. Simply slide the rate elements and see the results.

$15.00 per month
$5.00 per kW of monthly peak demand
$0.2500 per kWh
$0.1500 per kWh

To highlight the way we can segment the rate components from the rate elements, we'll also add a small Fuel Cost Adjustment of $0.05/kWh.

An Average 2019 ComEd Customer

As you can see, we built the rate engine to be able to quickly and easily differentiate between the cost classifications, the rate elements, and even the rate element components. As time-of-use rates become increasingly popular, seeing the data with such granularity provides power for


Hopefully we didn’t bury the lede. The point of all of our efforts is to be able to scale the way rate calculations are done today. We already used a primitive version of our rate engine for PG&E's EV Savings Calculator, and the speed really shines. Despite filtering between 36 load profiles and applying it to a number of rates, the graph reacts as fast as a user slides the inputs:

Laptop displaying a digital electric vehicle calculator

We’re already tinkering on a few other applications that harness this speed and user-friendliness, but if you think this might be useful for you, please reach out to Eugene (our rates person) at . He has years of regulatory consulting experience including expert witness testimony on cost of service and rate design, and still thinks this is one of the neatest things he's ever built.