An Energy Exchange Engine for Local Energy Marketplaces;

Grid Singularity
15 min readSep 23, 2019


Grid Singularity’s Proof-of-Concept Collaboration with the Hague’s Groene Mient Community

Technological advances and favorable policy support have resulted in renewable energy sources progressively reaching grid-parity, with the cost of electric power derived from a rooftop solar system becoming equal or even lower than that purchased from a utility in an increasing number of geographies. As energy generation shifts towards the lower voltage levels of the power grid, the role of the household in the energy market becomes increasingly important. Here we present a novel technology that paves the way for a more optimal energy management for households that produce and share energy with peers who aspire to economize and rely on renewable energy consumption, with a proof of concept simulation executed for a local community in Europe.

Previously, households were considered purely part of the demand-side of the power grid. Utilities, at the supply-side of the grid, provided the energy required and paid by the household. The infrastructure needed to transport energy from a centralized production unit to a household has been maintained by a network owners and operators, who exert a grid fee to cover costs. With the realignment of production to include households with renewable energy assets, the once simple one-dimensional model also changed. Today, many households produce energy using distributed energy resources (DERs) and aim to satisfy a share of their demand with this energy while purchasing energy from a utility only to meet any remaining gap. Whenever household production is higher than its consumption, the surplus can be stored for later use or sold to the utility, under compensation schemes that vary in design and amounts by country (e.g. feed-in-tariff -FIT, net metering, or net billing). While the additional renewable energy production by households creates a cleaner energy supply and, when adequately integrated and managed, can increase grid resiliency, the complexity of transactions also creates new costs of grid balancing and congestion management.

In a power system, energy consumption should always be balanced with production. As the numbers of decentralized producing and consuming devices rise, system operators, communities and consumers may look to coordinate DERs more efficiently rather than simply feed into the grid when convenient to the consumer. In order to steer devices to change their consumption or excess production, a centralized or distributed approach could be espoused. In the first case, a central computer or an algorithm calculates the most effective charging or discharging schedule, with all devices in the community communicating their preferences to this central point, and then following a schedule it sets. A distributed method would involve a platform where agents, representing connected devices, configure an optimal schedule on their own. The value of electricity generally depends on where and when it is produced. Nevertheless, in practice, energy markets continue to be centrally operated with prices that are insensitive to location of production or demand (and for most consumers, also not time-sensitive), and governed by central parties. With higher penetration of distributed energy resources, issues relating to market design not including price signals at the local level are exacerbated. Local energy communities provide a testbed for distributed energy management models in highly regulated regions such as Europe.

A Local Energy Community (LEC) (also termed a renewable energy community or a local energy market) is an association of households that, while part of the greater power grid, have decided to jointly invest in, produce and sell local renewable energy to local consumers to reduce carbon emissions, increase community self-sufficiency and energy security, and decrease the cost of energy. LECs acting as distributed energy communities require a distributed management system, or ‘operating system’, in the form of a decentralized energy exchange. Grid Singularity has created software to simulate and deploy such an exchange, the D3A, and the results of a pilot conducted in a local energy community are here presented. When considering an energy community that is not connected to the main power-grid, the use-case changes considerably, and this type of analysis does not fall within the scope of this article.

The European Union Regulation on wholesale energy markets’ integrity and transparency (REMIT) records of transactions define an energy exchange as “a multilateral system operated and/or managed by a market operator, which brings together or facilitates the bringing together of multiple third-party buying and selling interests in wholesale energy products — in the system and in accordance with its non-discretionary rules — in a way that results in a contract, in respect of the wholesale energy products admitted to trading under its rules and/or systems”. Grid Singularity’s D3A is an energy exchange engine, software that automatically executes trades based on set device trading preferences, creating and managing an energy marketplace. The D3A exchange can operate in a centralized or decentralized fashion, depending on the use case. When deployed on a decentralized blockchain-based platform, namely the Energy Web Chain, the D3A ensures that all the market actors, households and distribution and transmission operators alike, have equal opportunity to access the market and act transparently.

In a local distributed energy exchange, the traditional roles of a distribution systems operator (DSO), which manages the connection to the power grid, and the utility, as a provider of energy, will still be required in order to integrate the LEC with the wider grid network. The one important differentiation is that a utility is no longer the only market actor with which a household exchanges energy, but one of multiple. In a LEC, households can trade both with neighboring households and the utility, rather than exclusively with the utility. In addition to deriving benefits from local trade, the community is also furnished with an efficient platform to offer energy services to the outside grid. Hence, the LEC becomes a grid-edge source of flexibility to decrease stress on the wider distribution grid, as discussed by other researchers including Mendes et al. The role of the D3A software in facilitating LEC objectives to reach cost efficiency and self-sufficiency based on renewable energy resources with optimal integration in the wider energy system is termed “Community as a service”.

The D3A user interface was released as a developer beta version in June 2019, and the code is available under open source General Public License (GPL v.3) on the Grid Singularity GitHub Repository. The web-based simulation of the decentralized energy exchange will be further developed in the next period for increased functionality, with pilots under way to test both the simulation software and to prepare a future deployment of the software to operate an energy exchange in a distributed fashion. One of the partners in this development process is the Groene Mient neighborhood in the city of The Hague, the Netherlands, consisting of 33 households that acquired a plot of land and set out on a mission to create a social, self-sustainable, and green community by 2023. After constructing an innovative drainage system, a communal garden including small farm animals, and a pavilion for community gatherings, Groene Mient commenced the endeavor to enable peer-to-peer energy trading amongst its residents and with the greater neighborhood, using a local energy exchange to derive more benefit from their renewable resources and increase self-sufficiency. All households have been insulated, possess smart heating systems, and rooftops equipped with solar panels. According to the aggregate annual energy data, during some days, Groene Mient already produces more energy locally than it consumes and this energy is entirely derived from renewable resources. On a yearly basis, Groene Mient consumes only 20% more than it produces. With a D3A exchange, households are provided with a choice to buy energy first from neighbors that have an energy surplus, rather than to automatically resort to more expensive energy supplied by the utility at a flat rate. Likewise, households that produce surplus energy are enabled to sell at a higher price locally rather than at the feed-in tariff rate offered by the utility.

Groene Mient is not fully self-sufficient due to frequent mismatch of local production and local demand, stemming from a high dependence on solar panels which are not able to follow the characteristic load-profile of a residential community. The community typically imports energy from the utility at night and exports surplus solar energy during the day. In figure 1, the load (orange) and production (blue) curves of Groene Mient are shown. The absolute power flow through the DSO connection point (green) shows all energy that is either imported from, or exported to, the utility. Looking at Figure 1, the mismatch between the local production and local demand is clearly seen. High production occurs during the sunny interval between 08:30 hrs and 17:15 hrs, but there is low consumption. Outside this interval, the consumption is high while production is zero.

Figure 1. Visualization of the energy production curve (blue), the load curve (orange), and the absolute power flow the grid connection point (green), of the Groene Mient local energy market over one day. The day is divided into 96 intervals of 15 minutes, created using the D3A simulation environment.

In conclusion, a more efficient way of allocating locally produced energy to local demand is required, which is linked to the wider challenge of energy flexibility. Flexibility in a power grid concerns the ability of energy devices to shift either their energy use in time. Flexibility can thus be used to reduce the mismatch between supply and demand. For instance, a ‘smart’ boiler could be set to heat up water during sunny periods and store it, rather than heat the water at night. If configured in this fashion, this boiler will be able to buy and consume energy that is produced locally during the day, instead of importing energy at times that local energy is not available. The problem for such flexible devices is to recognize when to buy, and when to wait. For this, the flexible devices need a clear, predictable incentive to shift their demand. Hence, the key question for flexible devices is how devices can determine an optimal schedule on a market platform without central coordination, and how can they be sufficiently incentivized. This includes optimization of behind-the-meter technology such as solar PV systems coupled with battery storage.

In the D3A exchange, energy prices are established by bids and offers which are issued by the trading strategies of participating energy devices. A trading strategy defines either the willingness to pay (WTP) or willingness to sell (WTS) of a certain amount of energy, indicating to the market the price at which the device would accept a trade at a certain time. A price taking load is a load that the user deems absolutely necessary. For instance, this could be lighting inside a house. A price taking load is generally inflexible, in that it would consider buying even the most expensive, in this case imported, energy. Price takers cannot shift their demand towards high local energy availability, but they still benefit from the price drop during sunny periods. However, loads that are non-essential, and thus flexible, can be rescheduled. As noted previously, a smart boiler can reschedule its heating to an earlier time, provided the water tank is sufficiently insulated. This flexibility margin creates space for strategic trading.

Figure 2. Schematic grid lay-out of a LEC deploying a D3A energy exchange engine

When following basic economic reasoning, energy is purchased in an order from the least to the most expensive power source. In a local market, local producers are in competition with each other and the utility that sells at a price that is known by the community. Considering grid-parity of solar panels, it is assumed that the levelized cost of solar energy is lower than the price of energy imported from the utility. The levelized cost of energy (LCOE) is the minimum price for which a device should sell energy in order to break even within the predicted life-span of the device. In order to be competitive, local producers will never set their prices lower than their own LCOE or higher than the prices offered by the utility. This creates internal competition among local producers, which is expected to drive down the prices of locally produced energy when there are many local energy sources, and vice versa. It is exactly this dynamic that provides guidance to flexible devices in the community in shifting their demand. The devices will attempt to acquire energy when prices are low. In a local market, where inflexible buyers only passively benefit from an occasional drop in prices below the utility price, flexible devices will actively try to reschedule their demand towards periods with high local energy availability, thereby reducing the energy mismatch of the community. When aiming to maximize revenue, the price is initially set high, and if the offer is not accepted, the price is lowered. The process is repeated until an offer is accepted, or until the price is lowered below the set minimum sale threshold. The parameters, such as the initial selling price, and the rate at which a price is decreased, can be determined using a simple methodology, or according to more sophisticated models which, for example, use forecast weather conditions to predict market prices.

Based on the historical energy data collected by Groene Mient, it is possible to simulate how the community would trade using a D3A energy exchange. The Groene Mient data set contains information on surplus energy exported from the household to the grid, as well as on energy that the household imported. Using this data set, the trading of the 33 Groene Mient households that are connected to a local energy market is modeled using the D3A simulation environment. The 34th local energy market participant is the utility agent that is set to sell energy at a constant 22ct/kWh and buys back energy at a feed-in-tariff of 9ct/kWh. Groene Mient will operate in this scenario after 2023, when the net-metering scheme will be prohibited in the Netherlands.

Figure 3. Default device strategies used in the D3A Groene Mient simulation. The utility price is set at 22 ct/kWh, and the feed-in-tariff at 9 ct/kWh. The length of the trade interval is 15 minutes, and during this time devices can issue and modify bids and offers according to their strategies.

We identify three distinct device classes: load, generation, and energy storage systems (ESS). In the simulation of the Groene Mient energy market, these three device classes are given default linear trading strategies. Within the local energy market, bound by the utility price and the FIT or the LCOE, prices can fluctuate. Strategies for the three device classes follow a basic economic rationale. Loads try to buy at low prices, and if unsuccessful, increase their price. Following the same reasoning, generators start high, and progressively decrease their price. ESSs can either buy or sell energy, provided the ESS has stored energy available. An ESS also follows conventional sell and buy strategies, but ensuring that it does not sell at lower prices than it buys, in order to ultimately be financially positive. The initial and final buying and selling prices, combined with the rate at which prices are raised, at the demand side, and reduced, at the supply side, defines when, and at what rate, bids and offers match. For the duration of the D3A simulation, operated at 15-minute intervals, the market continuously matches incoming bids and offers, establishing a market schedule for the next interval. Operating the simulation for one day yields results that demonstrate a clear drop in local energy prices when local solar energy production rises, as seen in Figure 4 below.

To measure the added value of deploying a D3A exchange in the community, a comparison of energy bills and community self-sufficiency is made, pursuant to three simulation scenarios:

1. Conventional scenario: No local trading market; all households trade directly with utility, with a utility price at 22 ct/kWh and a feed-in-tariff at 9 ct/kWh.

2. D3A deployed: a local trading market is established. The community is still able to trade with the utility for a utility price at 22 ct/kWh and a feed-in-tariff at 9 ct/kWhD3A deployed and battery installed:

3. D3A deployed with a communal battery installed: a local trading market is established. The community is still able to trade with the utility for a utility price at 22 ct/kWh and a feed-in-tariff at 9 ct/kWh. A communal battery with a capacity of 80 kWh is installed with a minimum selling price of 20 ct/kWh and a maximum buying rate of 15 ct/kWh.

In the following section, these results are presented. Figures 4 and 5 below show the energy prices and the energy profile in the community for the second scenario (D3A deployed, no communal battery). Figures 6 and 7 show the energy prices and the energy profile in the community for a scenario with a D3A exchange deployed and with a communal battery installed. In Table 1, these two scenarios are compared to the conventional scenario.

Figure 4. Average energy prices within the community (red) and energy price for trade between community and utility (blue) in the D3A exchange simulated for Groene Mient LEC, without communal battery. The price drop inside the community, visible in the time interval between 08:30 hrs and 17:15 hrs, corresponds to the sudden increase of locally energy production due to sun activity (see figure 1). The price inside the community rapidly drops to a constant lower value during this time interval (~10 ct/kWh). After the sunset, prices re-stabilize at conventional energy prices. A smart flexible device could anticipate this price drop and exploit it by shifting its load towards the time intervals when prices are low.
Figure 5. Groene Mient community energy profile in the D3A energy exchange, without an installed communal battery. The positive y-axis depicts the purchased energy, and the negative y-axis the sold energy for the entire community. The total values of the negative and positive y-axes mirror one another due to the energy balance. The limited demand of the community during the sunny intervals between 08:30 hrs. and 17:15 hrs. benefits from lower prices, albeit with energy demand remaining highest during the night. At night, the utility is the only energy supplier, while during the day only households act as energy suppliers.

In order to make the community more flexible, an energy storage system (ESS), in the form of a communal battery, is added to the simulation, which does not have a set demand profile but may buy and sell energy pursuant to a predetermined strategy, as portrayed in Figure 3. The energy purchased by the battery is stored and can be sold at a later time, significantly increasing the community self-sufficiency. If the battery price threshold is set sufficiently low, this ESS will only buy energy locally and avoid purchasing from the utility. Once prices increase, the ESS will sell the energy and if the sale threshold is set to be lower than utility prices, it will benefit the community households. The direct effect of a (communal) ESS is that the energy that would otherwise have been exported will now be stored and sold to the community at times when the households would otherwise need to import energy at higher prices from the utility.

Figure 6. Groene Mient community energy profile in D3A energy exchange, with a communal battery installed. The positive y-axis depicts the purchased energy, and the negative y-axis the sold energy for the entire community. The total values of the negative and positive y-axes mirror one another due to the energy balance. Compared to Figure 4, significantly more energy is purchased by the battery during the sunny interval between 08:30 hrs. and 17:15 hrs., and then sold during the interval between 17:30 to 21:00 hrs. at preferential prices compared to utility-set price.
Figure 7. Simulation of average energy prices at the D3A exchange deployed for the Groene Mient community, with a communal battery installed. Compared to Figure 3, the prices drop to around 14 ct/kWh from 17 ct/kWh during the sunny intervals between 08:30 hrs. and 17:15 hrs. because the battery has a lower willingness to pay (WTP) than the households. As the battery is a flexible asset it is configured to wait longer for prices to decrease. In addition, during the 17:30 to 21:00 hrs. interval the average price of energy is lower than the utility price since the set of suppliers now consists of the utility and the battery, and the battery is selling at prices that are lower than the utility price. In conclusion, not only does the battery gain a profit, it does so while creating a better energy price for the households who purchase its energy.
Table 1. Presentation of performance indicators for three simulation scenarios: conventional base-case, D3A deployed in an inflexible grid, and D3A deployed in a flexible grid. To show that a local energy market is beneficial for all types of households, we highlight the energy bills for a household with a relatively low production and high consumption (prosumer 1), and for household with a high production and low consumption (prosumer 2). Energy bills decreased for both of the households when the option to trade locally was introduced via the D3A. The community self-sufficiency also increased. When a community battery was added, the energy bills and self-sufficiency further improved, due to the flexibility it provided to the community. In case that a mandated FIT is discontinued, as it is planned in the Netherlands where Groene Mient is located and other European countries such as Germany, and in the absence of another solution, solar energy production by the local energy community would be curtailed.

A comparison of the simulation results of the conventional scenario (column 1, Table 1) and the D3A deployed scenario (column 2, Table 1), clearly indicates that a LEC with households with roof-top solar panels will benefit from deploying a local energy market facilitated by D3A. However, to determine whether a LEC also benefits from installing a community battery (column 3, Table 1), the lifetime costs of such a system should be compared with its predicted lifetime revenue, yielding the Levelized Cost of Storage (LCOS). LCOS is defined as “the fictitious stable electricity price needed to make the present value of the sum of all costs and all revenues over the entire operational life of the unit equal to zero”. Comparing the LCOS of a communal battery with the battery’s average selling price can provide a rough estimate of investment return. Using parameters defined in Table 2, and following the LCOS calculation method proposed by May and Beushausen, the LCOS is computed at 31.8 ct/kWh. If on average the battery sells energy for lower than 31.8 ct/kWh, the battery is not financially feasible as the investment will not be returned within its lifetime. In the Groene Mient use case, the battery’s trading strategy defines the selling price to be between 20 ct/kWh and 22 ct/kWh, which is below the battery LCOS. However, one must include the added value the battery creates for the other local DERs within the LEC by allowing those DERs to sell their energy to the battery at 15ct/kWh, instead of exporting it to the energy provider for a significantly lower FIT of 9 ct/kWh. This added value can be represented in the LCOS calculation by lowering the charging costs parameter to 9 ct/kWh. With a charging cost at FIT, in this case 9ct/kWh, the LCOS becomes 25.3 ct/kWh. While the required selling price is still higher than the real minimum selling price of 22 ct/kWh, it is not unimaginable that this can be achieved in the near-future. For instance, with a decrease in CAPEX of 20%, or 6600 EUR, the battery achieves a LCOS of 22 ct/kWh and would become economically feasible in the Groene Mient scenario. With LCOS equal to the selling price, the battery will make no profit for LEC, but will help the LEC to increase self-sufficiency from 21% to 41%, as shown in Table 1.

Table 2. Parameters used to calculate LCOS for the communal battery. The values are estimates based on the technical characteristics of a variety of batteries available on the market today. Charging costs are set at the maximum to create the worst-case scenario.

The communal battery in this use case uses a simple, reactive strategy triggered by low prices to buy or by high prices to sell. The next step would be to develop a flexible strategy that is able to anticipate price swings within the community based on artificial intelligence algorithms. Since the D3A is a collaborative, open source endeavor, third parties are motivated to integrate such solutions in the software.

As demonstrated by the D3A simulation of the Groene Mient local energy market, the more flexible the community is, both in terms of consumption preferences and energy resources, the more value is added by the D3A. Nonetheless, significant improvements in energy costs and use of renewable resources can be observed even for inflexible energy communities.

Grid Singularity’s D3A grants devices and households control over their energy preferences and therefore their bids and offers which directly determine the cost of energy in the community. If deployed as a decentralized exchange on a blockchain, it fosters co-investment in renewable resources, collaborative trading and transparent billing. If it relies on one central party to operate the local exchange, blockchain could still be used to enhance transparency and streamline transactions settlement.

Authored by Ewald Hesse, Sarah Hambridge, Ana Trbovich and Dirk van den Biggelaar



Grid Singularity

Engineering open source software that simulates and operates grid-aware energy exchanges, creating local marketplaces that interconnect to form a smart grid