On Distributional Effects in Local Electricity Market Designs—Evidence from a German Case Study

The European Commission’s call for energy communities has motivated academia to focus research on design and trading concepts of local electricity markets. The literature provides a wide range of conceptual ideas and analyses on the technical and economic framework of single market features such as peer-to-peer trading. The feasible, system-wide integration of energy communities into existing market structures requires, however, a set of legal adjustments to national regulation. In this paper, we test the implications of recently proposed market designs under the current rules in the context of the German market. The analysis is facilitated by a simplistic equilibrium model representing heterogeneous market participants in an energy community with their respective objectives. We find that, on the one hand, these proposed designs are financially unattractive to prosumers and consumers under the current regulatory framework. On the other hand, they even cause distributional effects within the community when local trade and self-consumption are exempt from taxes. To this end, we introduce a novel market design—Tech4all—that counterbalances these effects. With only few legal amendments, it allows for ownership and participation of renewable technologies for all community members independent of their property structure and affluence. Our presented analysis shows that this design has the potential to mitigate both distributional effects and the avoidance of system service charges, while simultaneously increasing end-user participation.


Introduction
With the Clean Energy for all Europeans package released in 2016, the European Commission called for a stronger participation of residential electricity consumers-individually or through communities-and for a flexible and responsive demand side via dynamic pricing [1,2]. Energy communities are legally seen as a new organisational form for active energy consumers to participate in the energy market [3]. Based on different market concepts, pilot projects in many countries have shown the technical and economic feasibility of their energy communities in Europe and around the world in the early 2010s [4]. Kampman et al. [5] estimate that 83 % of the European Union's households (approximately 187 million) could potentially contribute to production and storage of renewable energy as well as system flexibility as energy citizens. They estimate that about half of those households could generate electricity from renewable sources and even more would be able to provide system flexibility with either electrical or thermal storage devices, for instance electric vehicles, stationary home batteries or electric boilers.
Research has quickly picked up the concept of energy communities and investigated their economic potential, technical feasibility, and possible market designs. The leading concepts highlight the necessity of local energy markets with some form of peer-to-peer trading-that is, direct financial compensation for electricity use in exchange with a neighbouring participant-and show the market design and characteristics needed for a successful implementation. However, the feasibility and practicability of these market designs with respect to the current regulatory framework is critical and far from clear, which is why recent studies see the need for changing the legal support to enhance the European Commission's call. The European legislation defines not more than a scope without a specific guideline to nationally put these communities into practise [2] while the impact of a widespread implementation on existing markets also remains indistinct.
To complement the academic literature concerning the feasibility of market designs within the current regulatory framework, we specifically address the following questions in this paper: What are the implications and effects of local electricity market designs for energy communities under Germany's current tariff mechanism? And, how can we adjust the existing concepts of local electricity markets in order to ensure a fair distribution of costs between all participants?
By answering these questions, we identify a threefold contribution of our work to the literature: (i) We develop and make openly accessible a simplistic policy analysis tool for (local) energy markets that can help policymakers to understand the impacts of changes in the current regulatory framework and their implications for the end-users. (ii) We analyse the outcome of existing market designs presented in recent literature under different regulatory contexts and address their drawbacks regarding distributional effects by presenting a new market design that is beneficial for all participants. (iii) We outline hurdles and barriers for market designs to be attractive for all market participants in the presence of the current regulatory framework.
To this end, we specifically focus the attention on a German case study, tailoring both data as well as tariffs and pricing rules to the German framework. The developed model is formulated as a mixed complementarity problem (MCP), simulating a community of heterogeneous market participants, that is, consumers, prosumers (defined as electricity producers who self-consume parts of their electricity [6]; some literature has extended this term to prosumagers, referring to prosumers who also own and operate a storage device), energy suppliers, and network operators. These players are assigned their individual objective function and constraints based on their role in the market. The model is freely adaptable to other tariff structures, market designs, and data and could thus be applied to the frameworks of other countries, albeit similar to the German one [7][8][9].
The outcome of the proposed market design numerically shows-in the given context-that there is a tendency of mitigating distributional effects and the avoidance of system service charges in the community, while leading at the same time to monetary savings for all market participants.
The remainder of the paper is structured as follows: Section 2 presents recent literature on the development of local electricity markets and introduces the methodology of mixed complementarity problems. In Section 3, the MCP model is introduced. Section 4 presents the case study, its data as well as the results and Section 5 concludes on the performance and points towards further research possibilities.

Background and Literature
The ongoing discussion on the future role of end-users has two perspectives: a European one and a national one. In this study, we will apply German data, which puts Germany in the focus of analysis. While the European Union is promoting the end-user of electricity (and therewith both the consumer and prosumer) as a key player in the future market design, national regulation is often not proceeding fast enough in this transition process. Within the European Union's winter package in 2016, the Commission calls for a change of national-and also European-markets towards a more decentralised design with the smallest-scale participant, the consumer, at its heart [10].
One emerging approach of integrating consumers to a larger extent into the energy market was taken up by single pilot projects-most famously the LO3 Brooklyn Microgrid. These pilot projects have started testing the possibilities of trade between neighbouring households-peer-to-peer trading options-as a means of sharing distributed generation in a local community. Zhang et al. [4] provide an overview of and reference to recent projects and characterise their targets and outcomes. Business models for local markets have been reviewed by Park and Yong [11], and their economic performance has been assessed by Zhang et al. [12] and Zhang et al. [13].
In theory, these local electricity markets could depict the bridge between decentralised electricity production and wholesale electricity exchanges, and foster investments in distributed energy resources without governmental subsidies: Participants can sell excess production to other customers (or peers) in the market, while in turn these customers pay less for the electricity from the local than from the retail market, resulting in a seller-buyer win-win situation. The research on local market designs and associated features developed on top of these pilot projects is, however, still in an early stage, especially regarding their regulatory and economic frameworks.
Local electricity markets and peer-to-peer (P2P) trading have been analysed and addressed from various perspectives. There is a broad range of literature on different market design aspects for such markets, for which Khorasany et al. [14] present a comprehensive overview. Studies focusing on local markets are reviewed by Mengelkamp et al. [15], entailing a discussion of concepts, methods, trading designs, and participants. Generally, P2P trading can be seen as a key component in a local market as it allows for direct trade between local entities [11]. Including P2P trade in local markets, there are two main design choices [16]: full P2P markets and community-based P2P markets. While the former design appears in rather few studies (e.g. by Sorin et al. [17] and Mengelkamp et al. [18]), the latter one has a wider appeal (see Sousa et al. [19] for a review). Moret and Pinson [20] show, for instance, that enabling local energy exchange in communities leads to revealed prosumer preferences while Hahnel et al. [21] empirically analyse trading strategies of prosumers for local energy exchange. Morstyn et al. [22] propose a combination of P2P trade and virtual power plants, in order to capture the advantages of both models in a federated power plant.
Local electricity market designs for P2P trading in connection to residential storage systems have been proposed by Lüth et al. [23]. The authors find that the combination of local trade and storage result in electricity bill reductions of 30 % for the end-users. Zepter et al. [24] present the economic benefits of integrating local market operations into the existing wholesale market regime, investigating synergies of residential storage and P2P trading towards local demand side flexibility in an integrated market setting.
From a technical perspective, Long et al. [25] show that local markets are a feasible system and the authors present a guideline for the construction of a distribution network incorporating local trade. Whether local markets provide a conducive service to the grid has not yet been evaluated. In the presence of local storage entities within a local market, there is a wide range of possibilities to serve the system, as for instance in the operating reserves energy market. Mengelkamp et al. [26] include residential demand response into their local energy market simulation, showing that local sufficiency can be increased while decreasing the residual peak demand of the community significantly.
Another approach to allow for more participation of end-users, mainly prosumers, is the introduction of aggregation concepts for players with small capacities [27]. Correa-Florez et al. [28] allow prosumers to participate in the day-ahead market through an aggregator, while Ottesen et al. [29] investigate the participation in a flexibility market. In a recent study, Olivella-Rosell et al. [30] present a scalable optimisation framework for the aggregation and operation of flexibility from distributed storage units of prosumer households or energy communities. One example of such a flexibility platform is the project ENKO (see www.enko.energy), aiming at the reduction of curtailment (Einspeisemanagement). Ableitner et al. [31] introduce a real-world local energy market in Switzerland including a proposition of a tariff design.
A different way towards local markets are locational marginal pricing (LMP) or zonal pricing in wholesale electricity markets where grid constraints and therefore possible congestions are already taken into account in the market outcome. If the transmission capacity between two points is insufficient, the market zones or nodes start to disintegrate, leading to diverging prices reflecting the scarcity of transmission capacity [32]. Morstyn et al. [33] combine the two approaches.
However, there is a mismatch between the developed market designs and their feasibility in the current regulatory framework. The legal context of P2P electricity trading with a focus on European law has been reviewed by van Soest [34], while Eid et al. [35] analyse the market integration potential of several European case studies. Following the streams and discussions in literature and media, the concept of local electricity markets is not easily integrated into the current national regulatory framework [34,36]. While from the standpoint of European directives P2P trading would theoretically be realisable, the specific transcription into national laws and acts hinders the implementation of such decentralised trading systems.
When market designs for local electricity markets are investigated, they often fall short in analysing the need for changes in current regulatory frameworks or the impact of the current regulation on the outcome of their design suggestion. Existing analysis tools are tailored to recently proposed market designs but not all rules and conditions of legislation can be easily evaluated in their set-ups. This is a result of-amongst other things-the specific examination of single features in local markets or different foci of the developed analysis tools. Therefore, we see a need for an analysis tool that is on the one hand rather simplistic but on the other allows for a comparative study of national policies with regard to a stronger involvement of the end-users. In addition, the illustration of different actors in an energy system is of high relevance: the supply chain of electricity comprises multiple entities with disparate objectives and even the demand side consists of a set of heterogeneous end-users. Thus, this paper aims at extending the existing toolbox of policymakers for the analysis of energy markets incorporating distinctive actors and their associated objectives to assess the value of decentralised small-scale production. This paper's model will contribute to the literature by providing a flexible, easily adjustable, and openly accessible tool to investigate market designs, policy changes, and the feasibility of business models.
Market models are often used to analyse policies and their corresponding system implications [37]. If formulated as an optimisation problem, these models do not allow for the market price to be an endogenous variable. The market prices may be obtained after the optimisation is complete by the respective dual variable, but they cannot be used within the optimisation. Mixed complementarity problems, on the other hand, are equilibrium models that combine both primal and dual variables in one framework and therewith depict a more general class of models. They transition from a mere optimisation to the solution of a Nash equilibrium, that is, the market outcome from which none of the participants desires to deviate, as the optimal decisions of the others are already taken into account. A theoretical introduction to mixed complementarity modelling in energy markets is provided by by Gabriel et al. [38]. MCPs have been applied to several energy market problems, for example by Schill and Kemfert et al. [39], Egging et al. [40], and Huppmann and Egging [41]. For a recent overview on advancements in complementarity modelling, see the introduction by Egging-Bratseth et al. [42]. In this paper, we develop a MCP as a tool to assess impacts of policy changes in local electricity markets on costs, flows, prices, and interaction among the modelled players.

Methodology
The purpose of this section is to present the general structure of the proposed policy analysis tool for energy communities. Although applied here to players in an electricity market setting, the tool can easily be adjusted to any other market setting for households with trading activities, different distributed energy resources, energy domains, storage, and cost schemes.
Following the taxonomy of Hall and Buckley [43], the range of the model is spatially defined to a local energy community consisting of prosumers and consumers with heterogeneous production and consumption profiles as well as an independent power producer (IPP), all in an hourly temporal resolution. The model incorporates a set of (static) prices for both the electricity production and consumption of the players, namely the long-term marginal costs of production, as well as spot prices, network tariffs, taxes, levies, and other duties. A market operating player optimises the local balancing mechanism and acts as price-setter. Figure 1 visualises this set-up. This set-up is structured as a quantitative and monetary disaggregated bottom-up model, and formulated as a mixed complementarity problem allowing for endogenous price determination in the local balancing mechanism. The following paragraphs describe the specific characteristics of the model for which Table 1 presents the used nomenclature. Note that variables are denoted in uppercase and parameters in lowercase letters. Table 1. Designated sets, parameters and variables of the mathematical model. renewable energy production of player a in time step t s a upper bound of storage level in battery for player a s a lower bound of storage level in battery for player a s init a initial storage level in battery for player a α a /β a maximum charge/discharge rate of battery for player a

Primal Variables
F a,t ∈ R + feed into the grid for player a in time step t G a,t ∈ R + consumption of energy from the grid for player a in time step t I a,t ∈ R + consumption from local balancing mechanism for player a in time step t R a,t ∈ R + consumption of renewable energy for player a in time step t S a,t ∈ R + battery storage level for player a in time step t S C a,t ∈ R + battery storage charging for player a in time step t S D a,t ∈ R + battery storage discharging for player a in time step t X a,t ∈ R + sale of renewable energy to local balancing mechanism for player a in time step t

Dual Variables
P LBM t ∈ R price of electricity in the local balancing mechanism in time step t P N a,t ∈ R price of electricity for player a in time step t P S a,t ∈ R price of electricity in the storage for player a in time step t λ res a,t ∈ R + price of curtailment for each player a in time step t λ s a,t ∈ R + price of storage lower bound for each player a in time step t λ s a,t ∈ R + price of storage upper bound for each player a in time step t λ α a,t ∈ R + price of storage charging for each player a in time step t λ β a,t ∈ R + price of storage discharging for each player a in time step t

The Prosumer's Problem
Prosumer households n ∈ N are equipped with divergent technology portfolios consisting of solar photovoltaic installations, wind turbines, and battery energy storage devices. Each of the prosumers aims at minimising its objective function, Equation (1), by minimising costs of electricity from different operational choices: Quantities of renewable production going to self-consumption R n,t , export into the local balancing mechanism X n,t , feed into the grid F n,t , or charging a battery S C n,t are priced at a prosumer-specific marginal rate of production p mc n of this technology. For the consumption from the external grid G n,t the grid price p G is paid. An endogenously determined price P LBM t as well as grid related costs p I are paid for buying electricity I n,t from the local balancing mechanism. Prosumers selling quantity X n,t into the local balancing mechanism receive the price P LBM t , and for selling to the grid prosumers are remunerated at p f it n . In addition, some prosumers might own an energy storage. The discharge quantity S D n,t will be charged at a marginal discharge cost p D n . min R n,t ,G n,t ,X n,t ,I n,t ,F n,t ,S C n,t ,S D n,t ,S n,t ∑ t R n,t + X n,t + F n,t + S C n,t · p mc n + G n,t · p G The prosumers' objective is subject to a set of constraints. These comprise the supply-demand balance, production limits, and storage characteristics if applicable. The demand dem n,t for each prosumer n ∈ N must be covered by the sum of self-consumption R n,t , grid consumption G n,t , the purchases from the local balancing mechanism I n,t , or a discharge S D n,t from a storage as represented in Equation (2) with the dual variable P N n,t .
The available production res n,t originates from a data set and is inserted as a parameter into the model. Available production can be used for self-consumption R n,t , local balancing sales X n,t , grid feed-in F n,t , or to charge a storage S C n,t , see Equation (3). The equation's dual variable λ res n,t can be seen as the marginal value of curtailment.
If available in a prosumer household, we introduce a set of storage equations (Equations (4)- (7)) representing their physical characteristics. The storage level S n,t is determined by the level S n,t−1 of the period before and the additionally charged (S C n,t ) or discharged (S D n,t ) quantity with a round trip efficiency of η (Equation (4)). For the first period an initial storage level s n,0 = 0 is assumed.
The storage level S n,t itself is bounded by a lower limit s n and an upper limit s n (Equation (5)).
Storage charge S C n,t and discharge S D n,t are limited by a maximum charge and discharge rate α n and β n , respectively (Equations (6) and (7)).
We formulate the following Lagrangian function (Equation (8)) for the prosumer's problem.

The Consumer's Problem
In addition to prosumer households there are pure consumer households c ∈ C, not directly owning any generation capacity or storage. They still aim at minimising their electricity costs, Equation (9), yet only electricity procurement from the grid G c,t or from the local balancing mechanism I c,t are possible. Consumers might also have the option to acquire the right of use for a given share of an independent power producer's generation installation. In this case self-consumption R c,t from that share at a consumer specific self-consumption rate p mc c is possible.
The supply-demand balance (Equation (10)) and bounds on use of renewables (Equation (11)) are analogue to the prosumer's problem. The parameter res c,t is exogenously set according to the acquired share in the independent power producer's system.
Equation (12) shows the Lagrangian function for consumers.

The Independent Power Producer's Problem
An independent power producer (IPP) o ∈ O does not have any residential demand but owns and operates a large-scale rooftop PV system. Any consumer c ∈ C can acquire the right to consume generated electricity (R c,t ) from the IPP according to an agreed share. Excess electricity not used by these shareholders can be sold into the local balancing mechanism (X o,t ). Electricity for shareholders is produced at a marginal production cost p mc o , while electricity for the local balancing mechanism is charged at the wholesale electricity charge p eex in order to prevent the large IPP to always be the price-setter on the market due to the more favourable generation conditions. Exports are remunerated with the local balancing rate P LBM t and the supply of shareholders is compensated at a rate p O o . The overall objective in Equation (13) again is to minimise operating costs. Exports to the local balancing mechanism and deliveries to the shareholders are capped at the renewable generation res o,t (Equation (14)).
The Lagrangian function of this player is displayed in Equation (15).

Local Balancing Mechanism
In the presence of a local balancing mechanism all players in the mechanism (prosumers, consumers, and the independent power producer) are linked via a market clearing condition (Equation (16)). It balances all sales (X n,t , X o,t ) and purchases (I n,t , I c,t ) within the local balancing mechanism in each time step t ∈ T . Local trade within the distribution networks is afflicted with losses that are inherent to the distribution of electricity-e.g., due to dissipated energy by resistances in network equipment-and cannot be eliminated. It is assumed that all network losses are already financially compensated for by electricity acquisition of the network operators that are reflected in the charged grid tariffs. This player represents the market operator. Equation (16) is assigned P LBM t as its dual variable. As this condition connects all players in balancing the amounts traded and therefore clears the market, the dual variable can be seen as the local balancing price, endogenously determined within the problem. It is part of the objective functions of all players.
In order to solve the Lagrangian functions, we derive the Karush-Kuhn-Tucker conditions (KKTs), as listed in Appendix A. The problem implementation was done using the programming language Julia and the PATH solver v5.0.02 [44,45] was used for the numerical solution. It solves the optimisation problem for four representative weeks in about 90 seconds on an intel core i7-8565 with 1.8 GHz and 16 GB RAM depending on the used set-up. The model code and data will be freely available on GitHub.
The developed model can be applied to different environments of energy problems as well as modified towards a wider range of possible policy analyses. In the chosen setting of an electricity market, we showcase in the following an application of the full model and some modifications, presenting a case study on German data.

A Case Study in the German Regulatory Context
The presented model will be used to analyse the impact of different market designs on market participants, based on data from Germany. We split the case study in three parts and start with the application of local market designs proposed by Lüth et al. [23] to a German town (Section 4.1). The second part elaborates and describes the impact of the current German regulatory framework on the outcome of these suggested market designs (Section 4.2). The third part proposes a novel market design based on the outcome of the first and second part as well as on recent discussions in research, society, and among policymakers about the future role and importance of small-scale prosumers in the energy system [2,46,47] (Section 4.3). A summary of the basic data used in all three of the following sections is given in the next paragraphs. Market design specific data will be introduced along with their descriptions. For all data, Appendix B and Table A1 provide more details on raw data processing, assumptions, and specific values.
The place of analysis is the town of Grevesmühlen in the Northern part of Germany. There is no specific reason for choosing Grevesmühlen as subject of analysis within this paper, except for the fact that the town offers different distributed energy resources in immediate vicinity. The case study comprises a community of 14 households including both prosumers and pure consumers (Table A1 in Appendix B), a market operator and an independent power producer (IPP). Specifically, one household is equipped with a small-scale wind turbine with an installed capacity of 2 kW, and 11 households have rooftop PV installations that vary in size between 1.20 kWp and 4.08 kWp. The independent power producer operates a 100 kWp roof-top installation.
Hourly data sets for the production patterns of renewable energy sources (i.e. wind and solar) in Grevesmühlen were taken from the open-access data platform renewables.ninja for the year 2018. Demand data for the households originate from a database for real houses in London, UK. The demand data of these households match the German average electricity consumption in magnitude and pattern. Unfortunately, comprehensive databases for German households are difficult to find. To our knowledge, only the Open Power System Data (OPSD) platform provides real open-access German household consumption data in hourly resolution. However, the data seem inconsistent.
In Grevesmühlen, the basic provision with electricity is performed by the municipal utility Stadtwerke Grevesmühlen, serving as reference for this case study. We apply the prices listed in Table 2. Production from own technologies is subject to marginal costs. The long-term marginal production costs have been calculated for each technology owning player by using the levelised cost of energy (LCOE) approach [48,49]. Prosumers owning a fully written-off PV rooftop system are in this study assumed to be offering at marginal production costs of just the operation and maintenance costs.
The following three sections describe the different steps of our case study, their structure, specific data, as well as their results and reflections. The community is exposed to a total of six market designs. Table 3 presents an overview on these market designs and outlines the difference in prices each of the market designs implies.

The Benchmark of a Market Design
The first market design 1 BAU Feed-in resembles self-consumption in combination with a fixed feed-in tariff -business as usual as of today [50]: A household consumes its self-generated electricity at costs equal to its marginal operational costs p mc n . In case of underproduction, electricity is procured from the grid at a static rate of p G = p eex + p dso + p tso + p eeg + p t&d , equalling the end-user price in Germany consisting of the wholesale electricity charge p eex , distribution network tariffs p dso , transmission network tariffs p tso , a reallocation charge p eeg and taxes and duties p t&d . For details on this reallocation charge please refer to the Excursion Box in Section 4.2. Excess production is fed into the grid and remunerated at the rate p f it n that is determined by the German regulatory authority (BNetzA) based on size and date of installation and paid as a subsidy. These specific rates for the assessed households can be determined based on the data from the Markstammdatenregister (MaStR) and the open-access platform Netztransparenz.de.
Following the work of Lüth et al. [23], we apply their three additional market designs to the presented case study. These designs aim at investigating the post feed-in tariff era, and thus feed-in will not be considered in any of the following designs, that is, F n,t is fixed to zero. First, the possibility of trading is enabled, that is, supply and demand are balanced locally before the procurement from the grid. This is implemented by adding a further constraint on top of 1 BAU Feed-in that links the players and represents a local market clearing. In the scenario 2 Local Sharing with self-consumption and local sales a household can hence additionally procure electricity from the local production at rate P LBM + p I where p I = p dso + p t&d . This local electricity stems from households' excess generation that is fed into the local grid and remunerated at the same local rate P LBM . This local rate is determined within the optimisation of the mixed complementarity model originating from the dual variable of Equation (16), as this equation clears the local trading balance. Second, residential energy storage facilitates a number of households to privately store their own generation: In the design 3 Home Storage with self-consumption and own storage, a household can consume electricity from the own battery at a discharge rate p D n equal to a levelised cost of storage p sto n (see also Crespo Del Granado et al. [51] for a similar approach) instead of trading within the community. Excess production can, thus, be stored in the home storage if available and used, for example, for load shifting purposes. In Germany, there exist some business models that specifically sell combined PV and battery storage installations with the most popular being the sonnenCommunity. The home storage systems assumed in this paper have an installed capacity of 4 kWh or 6 kWh. For a specific description of their characteristics, please refer to Appendix B and Table A2 at the same place. The scenario 4 Home Storage & Local Sharing with self-consumption, own storage, and community sharing combines 2 with 3 , allowing for local sharing and battery storage.  The application of these existing market designs to the German case study verifies the tendency of outcomes presented by Lüth et al. [23] and Zepter et al. [24]. We observe that

BAU Feed-in
• the more features enabled within the community, the higher the monetary savings. • prosumers profit most from owning both generation technologies and storage, and a pure consumer sees only a small decrease in costs. • cheap rates in the local market can only be reached by avoiding grid fees, surcharges and/or levies, which is the main assumption for the local rate. • the community's self-sufficiency rate increases (see Figure 2) while the peak load remains rather constant.
As costs for the existing network infrastructure will remain part of the tariffs and they are not subject to change, the avoidance of grid tariffs and surcharges in a local trading mechanism will only give rise to the grid charges on the remaining quantity procured through the network. In short: less power in the grid at the existing costs for network infrastructure results in a higher grid fee. Figure 3 visualises this implication. We plot the overall quantity in each of the market designs against the fees paid and see a decrease in network charges the more features we introduce. As pure electricity consumers remain the players with a rather stable grid consumption, they will be affected most by lower procurement from the grid while prosumers avoid these charges by self-consuming, trading, and storing local production. This is in line with the findings of Pollitt [52].
We conclude that these market designs could lead to a redistribution of costs for the network, which will be at the expense of a pure consumer-most likely a household without own property or less affluent-who might not have the same evasion possibilities as prosumers (we entitle this the proverbial dentist effect). Figure 4 gives a summary of the costs. We benchmark the different market designs against 4 Home Storage & Local Sharing where all features are enabled, and cluster the households in groups of prosumagers (residential technology and storage), prosumers (residential technologies) and pure consumers. For some, 1 BAU Feed-in is still the cheapest option because their feed-in tariffs on their large excess production result in high remuneration profits. However, for the majority of the community costs decrease along with the introduction of local trading and storage under the presented market designs.  Yet, the proposed market designs do not take into account any current regulatory framework that mostly foresees obligatory grid tariffs on any quantity procured from the grid. In order to see how results change if we do not exclude the local trading activities from paying grid charges, we adjust the market design slightly, applying the German regulatory framework, and evaluate the influence of the current regulation on the suggested market design.

Integration Into the German Regulatory Framework
In this section, we test a further case 5 Current Regulatory Framework with self-consumption, own storage, community sharing, and current taxes and duties, for which we introduce current German regulation to 4 . Consumption from the local balancing mechanism is then charged at a varied p I = p dso + p tso + p eeg + p t&d as the German regulatory framework does not make exemptions from paying grid fees and surcharges once the electricity is passing the public grid. See the Excursion Box for details on the German regulatory framework.

Prosumager
Prosumer  The results show that due to the higher costs, benefits of the local trade shrink significantly. In order to have any benefits for participating players in a 4 Home Storage & Local Sharing market, the taxes and duties structure would need to be adjusted as argued by Schäfer-Stradowsky and Bachmann [53] and Scheller et al. [36]. In their report, von Oppen et al. [54] show that trading among neighbours or within a community is highly uneconomic as well as not manageable for small prosumers due to a compact regulatory framework that would lead to high costs as well as a major amount of administrative work. We summarise the obligations and implications for prosumers in a local trading scheme in the German regulatory framework in Appendix C. Figure 4 sketches the change of the cost-related results when we introduce the market design to the current regulatory framework. While costs increase, the overall quantity being traded when paying grid fees decreases as Figures 2 and 4 show. With 4 Home Storage & Local Sharing as the benchmark for the overall costs we observe that introducing the current framework will increase costs for all-mostly for pure consumers. The local trade is only profitable at a price lower than the grid price. In the presence of all surcharges, levies, and grid fees, this results in a local market rate being lower than the electricity spot price. As the local rate is determined by the marginal production costs of a prosumer, only prosumers with a fully written-off installation will be able to supply cheaper than the grid-the quantity traded therefore decreases. From this, we can draw the following conclusions on the impact of the current regulatory framework on the market designs:

•
The regulatory framework makes it unattractive for prosumers to trade locally when their marginal costs are higher than the electricity spot price.

•
Under the framework, local trade is only economically viable for prosumers with fully written-off installations.

•
Once more installations are written-off this model can become competitive under the current regulation if we disregard the administrative burden.
In order to adjust for these market designs, the regulation would need to undergo major changes to make it as attractive as argued by, for example, Lüth et al. [23] and Mengelkamp et al. [56]. Any redesign of legislation needs a careful consideration of these trade-offs, not only in the German context. To our understanding, however, the presented market designs enlarge distributional effects between households with the financial and organisational means to invest into generation and/or storage technology and those with no access to these technologies due to their budget or the ownership structure of their housing, and we consequently propose an additional market design.

Excursion: Regulatory Framework in Germany
With the first version of the German Renewable Energy Sources Act (EEG) in 2000, Germany started a series of laws on prioritising green energy in the electricity mix. Together with the Energy Industry Act (EnWG), the basic legal framework for the German electricity market is formed. (There are about 90 other acts, directives and regulations on European and national level that affect Germany's energy supply system [55].) While the EEG handles mostly rules on renewable energy sources and their integration into the system, the EnWG defines also the regulatory framework for the overall energy-including the electricity-sector. From a legal perspective, the prosumer is end-user ( § 3 Nr. 33 EEG) and auto-producer ( § 3 Nr. 19 EEG). As of today, regulation allows prosumers with a capacity of up to 100 kWp to feed their electricity into the network but exempts them from regulatory duties and rewards them at a rate determined by the Federal Network Agency (Bundesnetzagentur, BNetzA) based on the overall installed capacity. The rate is transferred into consumers' electricity bills by adding a reallocation charge (EEG-Umlage) on top of each kWh consumed. Thus, end-users pay a surcharge which in turn is paid to prosumers and operators of renewable energy installations for each kWh they feed in. If prosumers intend to bypass the fixed feed-in tariff and instead trade with a chosen, presumably locally circumjacent partner instead, they will need to perform some or all retailing duties depending on the prosumer's intention. The EnWG declares in principle every participant feeding electricity into the grid as an energy utility. Thus, parties making use of the grid by sending electricity through the network have to pay a grid fee and perform a set of bureaucratic duties. These duties comprise accounting, billing, reporting and metering tasks [54]. While grid fees are usually passed on to the customers' bills, these duties stay on the producers' list of tasks, and generally exceed the average prosumer's personal capacity of work load as the processes are matched with energy utilities' businesses [54]. Aside from the fixed feed-in tariff, other existing business models are difficult to implement for prosumers with small capacities. On the one hand, responsibilities increase to a large extent once electricity is directly sold to another customer. On the other hand, the economic potential is fairly unattractive [36]. Appendix C elaborates on the details. It is noteworthy at this point that fixed feed-in rates phase out 20 years after installation and will-as of today-not be given to new installations once an aggregated capacity of 52 GW of installed solar power is reached in Germany, despite recent political discussions.

New Market Design: Tech4all
We extend the 5 Current Regulatory Framework by introducing an independent power producer (IPP) with a production capacity of 100 kWp. This player can sell capacity shares of its production to consumers that neither own capacity nor a roof to install technology. In this proposed market design 6 Tech4all with self-consumption, own storage, community sharing, and an independent power producer, pure consumers now have obtained a right for self-production, which they can consume at a price p mc c = p mc o + 0.4 · p eeg + p dso + p tso + p t&d + p h , taking into account a markup p h at 1 ct/kWh for the technology owner as well as fees for grid use and extended self-consumption from installations larger than 10 kWp. Additionally, we reduce the EEG surcharge on local trading to only 40 % of its full value and now increase the price of consumption from storage discharge to p D n = p sto n + 0.4 · p eeg . A fraction of 40 % of the EEG surcharge is currently charged for residential technology and self-consumption from an installation larger than 10 kWp. Although local trading that is not remunerated by a feed-in tariff reduces the quantity that needs to be financed by this surcharge, the lower grid consumption also implies less inflows on the other side. To keep this mechanisms rather stable, we assume that all players continue on paying a share of the surcharge whenever the grid is used. The IPP sells its production either to its shareholders at p O o = p mc o + p h or for the wholesale electricity price p eex to the local balancing mechanism.
The results of the case study introducing 6 Tech4all show that we can counteract the redistribution of costs. Looking at the overall costs depicted in Figure 4, there is a decrease in costs compared to 5 . Prosumers and prosumagers, however, face a slight increase in their costs compared to the benchmark 4 (but a decrease compared to 1 today), while consumers can now also profit from self-consumption. In terms of taxes and duties, 6 Tech4all reduces the electricity going through the network compared to a design with only additional storage or today's feed in, but Figure 3 visualises that 6 has a higher share of grid tariffs paid on a lower quantity procured. In this asymmetrical set-up of 12 prosumers and only two consumers, the observed effect on the grid charges is certainly only a small effect. We can nevertheless conclude that the introduction of an IPP and a rather small modification of current tariffs flattens the effect on avoiding grid charges. In addition, an IPP enables the possibility to have self-consumption for electricity end-users without access to an own roof or the liquidity to invest in the technology, and a small surcharge on battery discharge mitigates the large arbitrage potential through private storage. We summarise our results in the following points: • Consumers are allowed to participate in the energy transition.

•
Most participants can lower their costs compared to today's framework.

•
The quantity financed by the EEG surcharge is lowered due to a separate rate for local trading.

•
Players always pay full grid charges when the grid is used.
We see major advantages in sharing a large installation in a close spatial vicinity among community members instead of privately owning small installations as main economic concepts apply in this context. Economies of scale give more benefits to larger installations. A smaller number of players can reduce information asymmetry but also economics of coordination within the energy system. But not only economic concepts play a role here. From a societal perspective, public acceptance can rise in the presence of participation and private ownership [57] which could lead the IPP to being a form of Bürgerenergiegenossenschaft (citizen energy cooperative), a local legal entity representing regional interests and keeping the economic benefits close. Regulation would need to judiciously define the close spacial vicinity distinctly, for example as being grid connected in the same distribution grid/voltage level.

Conclusions
Recently proposed local electricity market designs allowing for battery storage and peer-to-peer trade are found to be profitable for energy communities under specific assumptions. The given regulatory framework in, for example, Germany diminishes, however, their profitability significantly. There are two pathways forward to realise the proposed market designs: either there has to be a major change in regulation to allow for the specific assumptions of the proposed designs to be implemented, or the market design needs to be adjusted to fit into the legal framework. For a German case study, we specifically show that under current regulation there is large arbitrage potential for prosumers with a storage entity but no incentive to locally trade electricity as marginal costs exceed wholesale prices while taxes and duties stay constant. A change in the regulatory framework bears the risk of distributional effects at the expense of pure electricity consumers due to very high self-consumption rates by prosumers (with storage) that avoid using the network. Thus, the overall fixed network costs need to be distributed among a lower grid consumption, mainly affecting pure consumers.
In order to counteract the elaborated trade-off, we suggest a new market design-Tech4all-that allows each market participant to benefit from the concept of energy communities. This is done through an IPP selling shares of a large local production facility, for example, a roof of a supermarket to end-users who do not have the financial or ownership means for installing distributed generation technologies. The quantity procured by the consumers is supplied through the distribution grid and purchased at a rate including all taxes and duties as well as marginal costs of production. In this market design, grid charges are proportional to today's share of fees paid and the system is profitable for new installations. The characteristics of the presented MCP model facilitate the modification of existing market design proposals towards heterogeneous categories of players with own objectives and constraints.
For a market implementation of this design in Germany, regulation needs to allow for self-consumption in a larger spatial context as well as define rules on the purchase of shares of a larger installation, ownership rights, the taxes and duties paid on this electricity and the rights of the IPP. We outline that concepts of economics favour a more centralised solution. Our numerical results based on the German tariff structure support a centralised approach as in particular battery storage devices lead to a redistribution of social costs. Mathiesen et al. [7] find a similar result in a study on the solar potential in the Danish context.
In further studies, the proposed market design needs to be tested with a larger and more representative data set as well as a greater variety of market participants. It needs to be embedded in the larger power system in order to capture changes in tax and duty revenues for the whole system or sensitivities thereof. The effect of our assumption that excess production is curtailed instead of made available to the system needs to be critically assessed and the market design should be adjusted such that those quantities support the system in a profitable way for all participants. The MCP allows for the introduction of additional players that could represent a business provider for a local sharing mechanism in order to fully analyse the impact of all associated features.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript:

Appendix A. Karush-Kuhn-Tucker Conditions
The following equations describe the Karush-Kuhn-Tucker conditions (KKTs) for the presented problem. The following three sections show the implemented KKTs for the prosumers, consumers, and independent power producer. For the sake of completeness, we add a fourth section recalling the local balancing mechanism.
Appendix A.1. The Prosumer's Problem Figure A1. Overview of model community.
Hourly data sets for the production patterns of renewable energy sources (i.e. wind and solar) were retrieved from renewables.ninja (see www.renewables.ninja/ or [58,59]) for the year 2018. This platform provides the converted power output of decentralised energy resources based on wind speed and solar irradiation data from the MERRA-2 database. The power output of the small-scale wind turbine has been calculated for a hub height of 15 meters; the solar panels of the 12 rooftop installations are assumed to be facing southward at an ideal 35 degree tilt.
The demand data originates from the London Low Carbon project (for further information, see https://data.london.gov.uk/dataset/smartmeter-energy-use-data-in-london-households) that digitally monitored 6,600 households and gathered residential consumption data subject to different tariff structures over the years 2011-2014 in a resolution of 30 minutes. The demand time series of the 14 different households considered in this study were retrieved from that database for the year 2012 and subsequently processed to hourly values.
Existing distributed generation portfolios of the households were downloaded from the Marktstammdatenregister (MaStR) provided by the Federal Network Agency. From this register, both the installed capacity and the year of installation of the distributed energy resources were retrieved in order to compute the specific marginal costs of production of each household. For the calculation of these marginal costs of production, we use the concept of the levelised cost of energy (LCOE) [48,49] as shown in Equation (A24): where ANF is the annuity factor Investment costs I 0 are discounted by the annuity factor ANF and added to yearly operations and maintenance costs OM which are estimated to be approximately 2.5 % of I 0 [60]. This sum is divided by annual production M of the system. The annuity factor ANF is calculated by the interest rate i over a system's lifetime T.
Data on investment costs have been obtained from BSW Solar (see www.solarwirtschaft.de). Each installation in the MaStR that is located in Grevesmühlen is assigned its marginal production cost and fixed feed-in tariff based on the date of installation that is recorded in the register. Interest rate is assumed to be 5 % and lifetime is assumed to be 25 years. The same calculation of levelised costs of storage (LCOS) is used to determine the discharge price p D n for the two types of batteries with investment costs of e 400 per kWh [61], a lifetime of 20 years, and 3300 and 4400 operating hours per year, respectively.
For the independent power producer, the marginal costs of production are taken from a report by Fraunhofer ISE [62] at a value of p mc o = 5.4 ct/kWh. The introduced markup for the operator is estimated from the difference between the marginal production costs and the current feed-in premium resulting in p h = 1 ct/kWh. The two consumers buy access to a proportion of 2 kWp (2 %) and 1 kWp (1 %) of the installation. The marginal production costs for these houses add up to 24.77 ct/kWh. The price end-users pay as customers of the Stadtwerke Grevesmühlen amounts to a yearly base fee of e 114.24 plus a kilowatt-hour rate of 28.73 ct/kWh in the basic tariff. Please refer to www.stadtwerkegvm.de/de/produkte-leistungen/strom.html for more information. The working price includes the spot price of electricity, the network tariffs, the EEG reallocation charge as well as other taxes and duties such as electricity and value added taxes. Unfortunately, the exact splitting of the working price in Grevesmühlen into its components is not made publicly available, which is why averages for German households need to be considered. Specifically, the average prices and shares for German households from data processing of the Bundesministerium für Wirtschaft und Energie (BMWi) were taken into account within this case study (see www.bmwi.de/Redaktion/DE/Infografiken/Energie/strompreise.html).
The network tariff amounts in the region of Grevesmühlen in 2018 to net 7.51 ct/kWh, of which 3.73 ct/kWh is due to the distribution network and 3.78 ct/kWh to higher voltage levels. Details on the network tariffs for the year 2018 in the region of Grevesmühlen can be found at www.e-dis-netz.de/content/dam/revu-global/e-dis-netz/dokumente/Preisblaetter_Netzentgelte_ Strom_20180101.pdf. These dues are higher than the German average as the electricity network in the eastern part of Germany is relatively new compared to other parts. However, in consistence to the above shares of average household customers in Germany, the network tariffs are scaled according to the data of the BMWi. For this paper, the distribution and transmission network charges amount to 3.48 ct/kWh and 3.44 ct/kWh, respectively. The EEG reallocation charge is 6.52 ct/kWh, the spot price of electricity 6.44 ct/kWh, and all other taxes and duties amount to 8.85 ct/kWh. See Table 2 for an overview.
The battery sizes in common applications vary quite significantly. While small-scale batteries at residential level often do not exceed a 10 kWh installed capacity, the sizes of batteries at farms or companies often outreach hundreds of kWh. For the purpose at hand, the battery systems have an installed capacity of 4 kWh and 6 kWh with a charge and discharge power of 2.5 kW and 3.0 kW, respectively. The round-trip efficiency of the batteries is 94.08 %, including losses both for the conversion and storing processes. For the purpose of this case study we assume the households to own battery storage devices of the type sonnenBatterie eco 8.0. See www.sonnenbatterie.de/sites/ default/files/datenblatt_sonnenbatterie_eco_8.0_dach_1.pdf for details on the technical specifications, which are summarised in Table A2.

Appendix C. Business Cases for Consumers and Prosumers
As of today's regulation, a prosumer can follow different paths to sell/use self-produced electricity, but not all of them are equally economically and temporally viable. Generally, regulation foresees a single way for prosumers and consumers to purchase electricity from a public grid while there are different options for prosumers to sell their electricity. Scheller et al. [36] give an overview of the models. Table A3 summarises the regulations affecting each model.

Appendix C.1. Electricity Consumption
For a pure consumer, electricity can only be procured from an electricity supplier. The costs of electricity offered by an electricity supplier consist of several cost components which add up to about 30 ct/kWh. Production, marketing and sales make up about 30 % of the overall costs. All other costs arise when a kWh of electricity is fed into the grid, but they are directly transferred to the consumer. Prosumers will generally have a contract with an electricity supplier, but they will also make use of the model of self-consumption (Eigenversorgung). In general, it describes the self-consumption of self-produced electricity from the owned technology. It is defined in EEG § 3 Nr. 19.
A prosumer will, thus, be confronted with costs amounting to his levelised cost of electricity plus EEG surcharge and value added tax. As there is no use of a public grid, grid related fees and surcharges are not applicable. Certain legal definitions can also lead to lower (40 %) or no EEG charge in the case of installations smaller than 10 kWp with a production of less than 10,000 kWh per year (de minimis rule), see § 61 EEG 2017. Furthermore, self-consumption is exempted from electricity tax ( § 9 StromStG) and in some cases also from the value added tax ( § 19 UStG or non-entrepreneurial activity).