FLEXGRID – A novel smart grid architecture that facilitates high-RES penetration through innovative flexibility markets towards efficient stakeholder interaction

The FLEXGRID 2 project develops a digital platform designed to offer Digital Energy Services (DESs) that facilitate energy sector stakeholders (i.e. DSOs, TSOs, market operators, RES producers, retailers, flexibility aggregators) towards: i) automating and optimizing their investments and operation/management of their systems/assets, and ii) interacting in a dynamic and efficient way with their environment (electricity system) and the rest of the stakeholders. In this way, FLEXGRID envisages secure, sustainable, competitive, and affordable smart grids. A key objective is the incentivization of large-scale bottom-up investments in Distributed Energy Resources (DERs) through innovative smart grid management. Towards this goal, FLEXGRID develops innovative data models and energy market architectures (with high liquidity and efficiency) that effectively manage smart grids through an advanced TSO-DSO interaction as well as interaction between Transmission Network and Distribution Network level energy markets. Consequently, and through intelligence that exploits the innovation of the proposed market architecture, FLEXGRID develops investment tools able to examine in depth the emerging energy ecosystem and allow in this way: i) the financial sustainability of DER investors, and ii) the market liquidity/efficiency through advanced exploitation of DERs and intelligent network upgrades.

stakeholders.In this way, FLEXGRID envisages secure, sustainable, competitive, and affordable smart grids.A key objective is the incentivization of large-scale bottom-up investments in Distributed Energy Resources (DERs) through innovative smart grid management.Towards this goal, FLEXGRID develops innovative data models and energy market architectures (with high liquidity and efficiency) that effectively manage smart grids through an advanced TSO-DSO interaction as well as interactions between Transmission Network and Distribution Network level energy markets.Consequently, and through intelligence that exploits the innovation of the proposed market architecture, FLEXGRID develops investment tools able to examine in depth the emerging energy ecosystem and allow in this way: i) the financial sustainability of DER investors, and ii) the market liquidity/efficiency through advanced exploitation of DERs and intelligent network upgrades.

I. Introduction
The large-scale integration of DERs such as PV/Wind generation (RES), Electric Vehicles (EVs), Energy Storage Systems (ESS) and Demand Side Management (DSM) equipment in distribution networks poses new challenges and opportunities for the power sector, as stated in the EU Clean Energy Package 1 .In this context, the FLEXGRID project 2 investigates several constraints related to the current smart grids architecture that prevent large scale DER integration in distribution networks.
The first reason is that DSOs use conservative constraints in distributed DER installation to ensure reliable and secure operation of their network.The root cause of this conservatism is the inability of DSOs to, dynamically and accurately, monitor and manage their networks.The development of a dynamic and accurate Distribution Network (DN) monitoring system and of an efficient and dynamic DN management system would therefore be the first step towards mitigating this conservatism.
A second reason is that even in cases where DSOs dispose Distribution Management Systems with appropriate DN monitoring capabilities, the lack of intelligence that would allow the efficient and dynamic interaction with DER operators (i.e.RES producers, retailers, flexibility aggregators) hinders DER investments.Consequently, the DN-related costs remain high (usually driven by DN upgrades with high (CAPEX).In this context, FLEXGRID develops advanced DESs relevant to the operation of Distribution Level Flexibility Markets (DLFMs), aiming to facilitate the efficient management of DNs and the reduction of distribution network management cost.
Another issue tackled in FLEXGRID is the inefficient investment design/financing and management of DER assets.To this end, FLEXGRID evolves existing smart grid architectures, which are not able to provide information related to the electricity grid topology and the market conditions to DER investors, by addressing the aforementioned shortcomings.Under this perspective, FLEXGRID exploits: i) topology and monitoring information from the networks that it manages and ii) data analytics from the market that it operates in order to provide DESs useful for the design of optimal DER investment strategies and optimal DER portfolio management.
Beyond these innovation levels, FLEXGRID copes with a major inefficiency in today's smart grids, which is the lack of interaction between (TSOs) and DSOs.Today, the TSO is the main actor procuring flexibility from flexible units to ensure system stability.However, in the future, according to 1, DSOs are expected to procure flexibility to solve issues in their networks, too.As DSOs and TSOs might use the same sources of flexibility, this flexibility should ideally be used in a coordinated way.Different market-based and non-market-based approaches can be used by the TSO and the DSOs for the coordination of flexibility 3 .When using flexibility to cope with a given grid operation challenge, this might have an impact on other grid operation aspects.For example, the activation of DN-level flexibility for system balancing by the TSO might cause congestion in the distribution grid.Another example is the activation of DN-level flexibility by a DSO to solve a local congestion problem, which may cause higher re-dispatch costs at the transmission network (TN) level.
Another problem of ineffective TSO/DSO interaction in today's smart grids is exhibited by the suboptimal economic dispatch decisions.These are often made by the DSOs or their issuing dispatch orders to DER operators that: i) are infeasible, due to DN constraints, and/or ii) in conflict with dispatch instructions sent by the DSO to end energy prosumers.DSOs, on the other hand, have observability into distribution system operations but, to date, have little to no experience in creating economically optimal system operations.Moreover, DSOs have little or no observability into transmission system conditions, and, in many cases, into the investment or operation decisions of DER owners.As a result, DSOs (and, equally often, TSOs) lack knowledge about the DER and DSM potential, which may act in support of system operations.This has led to a variety of discussions over how to coordinate DSO operations with consumers, DER operators, and TSOs 4,5 .
In this new landscape, and in order to alleviate these architectural inefficiencies and immaturities of existing smart grids, FLEXGRID focuses on four major research gaps.
The first research gap examines the operation of existing energy markets and the evolution of their architectures in depth by focusing on the interaction between TSOs and DSOs.It also unfolds around the development of advanced market clearing and pricing algorithms able to adequately model the underlying

Amendments from Version 1
In order to address the comments of reviewer 1: 1.We enhanced the manuscript to analyze Figure 1 in more detail.
distribution system and ensure market efficiency by considering modern DER models (e.g., ESS, DSM, etc.).
The second gap of FLEXGRID spans around the development of DESs towards efficient aggregation of end user's DERs.This alternative facilitates their optimal and parallel usage of their capacity in multiple energy markets according to FLEXGRID's innovative energy market architecture.
The third research gap relates to the development of DESs that contribute to the optimal operation of DERs and the advanced planning (investment design/financing) of DER investments according to a sophisticated and data driven examination of: i) innovative FLEXGRID's markets, ii) DN/TN topology, and iii) competition.
The fourth research thread focuses on the monitoring and management of the transmission and the distribution networks in smart grids and in resolving of problems related with the grid upgrades with respect to market power mitigation and flexibility exploitation.It co-optimizes networks upgrades and flexibility investments.
In the rest of this position paper, we present at a high level the innovative architecture of FLEXGRID and the major DESs that it develops.Section II depicts the high-level FLEXGRID architecture.Section III presents three innovative energy market architectures which offer advanced interaction between TN-and DN-level markets.Section IV presents the novel FLEXGRID DESs offered to various market stakeholders of FLEXGRID ecosystem.Finally, section V concludes this position paper by outlining the major FLEXGRID goals and ongoing work.

II. FLEXGRID ARCHITECTURE
Briefly, FLEXGRID focuses on all the energy sector stakeholders in modern smart grids and proposes an innovative smart grid management architecture through which they can interact efficiently in order to optimally plan and operate their grids (transmission and distribution networks) and their DERs.Figure 1 depicts the high-level functional architecture of FLEXGRID.The red boxes depict stakeholders combined with their existing functionalities while the purple boxes depict innovative functionalities (digital services) that FLEXGRID develops.Arrows in Figure 1 try to highlight interaction and data exchange which occurs sometimes between existing and FLEXGRID's functionalities and sometimes among FLEXGRID's functionalities.
From the grid management perspective, FLEXGRID develops innovative energy market architectures able to ensure the optimal use of DERs through advanced market clearing algorithms (dispatch and pricing).In order to achieve this, the proposed architecture guarantees an efficient interaction between TSOs (which operate TN and interact with MO to conduct market clearing) and DSOs (which operate DN and interact with FMO to conduct market clearing).More specifically, the Market Operator (MO, which is responsible for the efficient and network-aware market clearing at TN-level) interacts with Flexibility Market Operator(s) (FMOs, which are responsible for the efficient and network-aware market clearing at DN-level which includes operating reserves for frequency control and availability reserves for congestion management).
To develop innovative energy market architectures, FLEX-GRID considers the "market" domain, in which the MO and FMO collaborate to improve operation and coordination of the wholesale (TN-level) and local (DN-level) energy markets, as shown in the Figure 2.Meanwhile, in the "network" domain, the TSO-DSO collaboration achieves improved network operation outcomes.The goal of FLEXGRID is to provide attractive trade-offs between optimal market and network operations, i.e., between economic efficiency and reliability, in a future with highly distributed RES penetration scenarios.
From the perspective of a DER investor, FLEXGRID accurately models modern energy sector stakeholders, often referred to as Energy Service Providers (ESPs), which are competitive stakeholders owning (or operating on behalf of end users / customers) various types of DER assets that interact with the DN and/or TN.ESPs are able to participate in various energy markets to ensure their financial sustainability by providing competitive energy services (such as trade of capacity, energy and flexibility services).Thus, FLEXGRID provides to ESPs the necessary intelligence for optimal and robust planning of their investments in DERs and to schedule their operation in an efficient way according to the various market needs.ESPs own DERs which are compatible (in timing and bidding format) with today's existing markets, so these DERs can be introduced easily in these markets.
From the perspective of the interaction between modern smart grids and end users, FLEXGRID focuses on the effective DN level aggregation of flexibility assets from end users and their efficient exploitation.FLEXGRID develops management tools for a specific type of ESP (denoted as FSP/Aggregator).FLEXGRID provides intelligent retail pricing and auction algorithms to independent FSPs to efficiently interact with end users through a B2C flexibility market.In addition, it provides algorithms that facilitate: i) the optimal planning of the quantity and the location of DERs (flexibility assets) according to the needs of various markets, and ii) the efficient scheduling of those DERs (optimal participation in and across various energy markets).All these constitute FSPs financially sustainable.
It should be noted that the main difference between an ESP and an FSP is that the latter actor represents DERs in the DN which belong to its customers (i.e., end energy prosumers) and are possibly not compatible with existing energy market architectures.In contrast, an ESP owns assets in the TN which are compatible with the existing markets.
Finally, FLEXGRID develops functionalities necessary for TSOs and DSOs in the modern market architecture.In more detail, FLEXGRID's architecture enables the interaction between DER investors (i.e.ESPs, FSPs) and system operators towards the design of more profitable investments through TN-and DN-level information exchange.Furthermore, FLEXGRID provides intelligence for network upgrades to DSO/TSOs according to the market and ESP/FSP needs.In this way, FLEXGRID guarantees that in this modern environment, malicious  ESPs/FSPs will not be able to exercise market power and jeopardize market efficiency, while the DSOs/TSOs will be able to minimize their costs for future grid reinforcements.

Novel energy market architectures for integrated management of transmission and distribution network
Existing electricity markets do not consider the constraints of local distribution networks.Thus, unpredicted voltage deviations and line congestions may arise.In particular, the models used in the existing markets, do not take into account power balance, power constraints and reactive power in distribution networks.As a result, re-dispatches may be necessary, which imply that: i) expensive units will have to participate in the DN dispatch and ii) higher penetration of DERs is constrained.
Novel DN models and recent advances in modern pricing algorithms allow the efficient and stable management of the DN.By exploiting such models, FLEXGRID evolves the existing energy market architectures in order to not only enable large scale and distributed RES penetration in DN, but also to increase the efficiency and the investment opportunities in modern smart grids 4,6-8 .
To this end, FLEXGRID introduces the novel concept of "Distribution Level Flexibility Market -DLFM", which is operated by an independent entity, referred to as Flexibility Market Operator (FMO).In FLEXGRID, NODES 9 is the FMO that operates the proposed DLFM.In this context, FLEXGRID focuses on the development of a digital Automated Trading Platform (ATP) that facilitates FMOs to: i) operate the DLFM and interact with existing energy/balancing markets operated by MO/TSO, ii) acquire flexibility requests from DSOs, and iii) interact with ESPs and FSPs by receiving flexibility offers.
The proposed FLEXGRID energy market architectures develop, combine, and bring to interaction the following six (existing or innovative) energy markets compiled in Table I.It should be noted that FLEXGRID follows the Nord Pool paradigm currently operating in the many European countries as EU's regulatory baseline.
FLEXGRID developments unfold around three different flexibility market architectures.FLEXGRID puts emphasis on the trade-off between: i) social welfare maximization/ market efficiency, ii) the level of compatibility of the proposed architecture with the existing markets' architecture (i.e., day ahead, balance), iii) their efficiency for various energy sector stakeholders (e.g., ESPs, FSPs, market/system operators, etc.).
These three architectures are described below.The first architecture (A) is framed within existing markets (#1, #2, #5 according to Table 1), but offers the maximum possible smart grid efficiency by allowing market participants to facilitate the transmission or the distribution network at the same time, independently of their location.The second (B) acts reactively to the existing energy markets and in this way sacrifices efficiency (market participants in distribution network are not able to use transmission network and interact with wholesale market) for compatibility.The third one (C) acts proactively to the existing energy market.

A. A clean slate approach towards a market-based smart grid operation with optimal social welfare -Interactive DLFM (I-DLFM)
Novel smart grid architectures which are able to maximize social welfare (through efficient markets) lead to: i) energy with lower cost for consumers, ii) more revenue streams for Energy and Flexibility Service Providers (ESPs/FSPs), and iii) lower operation/management costs for network operators (i.e.TSO and DSOs).In a smart grid with high and distributed RES and high flexibility exploitation in which the distribution network faces congestion and voltage issues, an evolved energy market architecture through an advanced interaction between MO (TSO) and FMO (DSO) is needed.In this perspective, a market architecture that evolves Markets #1, #2 and #4 and is not constrained to be compatible with their existing versions can theoretically maximize social welfare.
In the proposed Interactive DLFM (I-DLFM) model, FLEX-GRID considers an iterative process that takes place between the MO and FMO until they converge to an optimal dispatch schedule at both the TN and DN levels.
According to the market definitions of Table I, FLEXGRID assumes three basic markets at both TN and DN levels: A) Dayhead energy markets (interactive clearing of Markets #1 and #3), B) Day-Ahead Reserve markets (interactive clearing of Markets #2 and #4), and C) near-real-time Balancing energy markets (interactive clearing of Markets #5 and #6).For example, in the day-ahead energy market context, presented in Figure 3, the MO initially runs an instance of its market clearing problem at the TN level and sends the results to the FMO.Then, the FMO takes the MO's results as input and runs its own market clearing problem at the DN level.The respective results (e.g., Lagrange multipliers) are sent back to the MO, who runs another round of the TN-level market clearing.Of course, the dispatch schedules that are decided in each round of the algorithm's execution are virtual and are not actuated in reality.After several algorithmic iterations (i.e.several message exchanges between MO and FMO), the process converges (through the use of optimization theory) to an overall dispatch schedule (i.e. at both TN and DN levels) that maximizes social welfare.A similar iterative process may take place for day-ahead reserve markets and near-real-time balancing markets (cf.TSO-DSO collaboration).
Figure 3 presents the aforementioned interactive market clearing process of a unified energy market, in which stakeholders in the DN (i.e., FSPs, ESPs) and the TN (ESPs) are able to trade energy.Briefly, the core of the proposed market architecture is a unified market clearing based on an iterative process (cf.yellow arrows) between the MO managing the TN and the FMO managing the DN.
At each iteration of this process, and according to the bids of the TN-level market stakeholders, the MO derives a time series (according to the scheduling horizon) of prices, noted as Transmission Network Locational Marginal Prices (TLMPs) for each node in the TN.These nodes include the interface nodes through which each DN exchanges power with the TN.An FMO operating in a certain DSO area takes as input: i) TLMPs that the MO derived, and ii) the bids of the DN-level market participants.In a second step, the FMO derives a time series of power flows (Distribution Network Dispatch -DND) in each node of the DN and updates the coupling point (DN-TN connection nodes) power flow time series.The termination condition of this iterative process is an identical dispatch in TN and DN in two consecutive iterations (with respect with an accuracy threshold).
According to the final dispatch, the pricing in the TN is coherent with the existing pricing policy in today's smart grids (TLMPs) and the pricing in the DN is conducted through a clearing algorithm that the FMO executes.
The rest of this section presents in detail the necessary steps for the operation of the proposed Interactive Market Clearing Algorithm (IMCA): Step 1: The DSO sends its distribution network data to the FMO.Step 2: The FSPs, connected to the DSO, send their flexibility asset (e.g.ESS, DSM) bids (i.e.FlexOffers) to the FMO.Each FlexOffer includes the cost/utility function of the FSP and its operating constraints.
Step 3: The Producers (ESPs) connected to distribution network (e.g.RES, prosumers) send their bids to the FMO.
Step 4: The Consumers (ESPs) connected to the distribution network (i.e., demand aggregators) send their bids to the FMO.
Step 5: The MO generates a forecast of the TLMPs for the first iteration of the IMCA Step 6: In each iteration k of MCA Step 6a: Taking the TLMP k (TLMPs in k th iteration of IMCA) at the coupling point, the FMO generates a Distribution Network Dispatch denoted by DND k (k th iteration of IMCA) for each specific DSO area through the execution of the DND Algorithm (DNDA).
Step 6b: The DLFM stakeholders are compensated for their operation according to a Distribution Network Payment Algorithm (DNPA).A detailed discussion of the DNDA and DNPA requirements and a description of the related FLEXGRID developments is included in the Section IV.
Step 6c: The TN stakeholders (i.e.generators, demand aggregators, etc) decide their dispatch based on the corresponding TLMP k .The TSO calculates its power flows based on the zonal TLMP k , which along with the TN-level stakeholders and the FMOs' decisions formulate the TN Dispatch (TND).
Step 6d: If the DND and the TND remain the same between two consecutive iterations of IMCA, then IMCA terminates.Otherwise, TLMP k are calculated by a TLMP Update Algorithm (TLMP-UA) based on the previously computed dispatches and TLMP k ).FLEXGRID develops various TLMP-UAs mainly based on duality theory 10 and decomposition techniques 11 to guarantee their convergence.
Step 7: The last calculation of TLMPs and the last calculation of DNPA determine the payments of participants in the TN and DN, respectively.The last TND and DND solutions/schedules determine the dispatch in the two networks.As this market is incompatible with the existing energy market architectures, FLEXGRID implemented this market in simulations in order to realize its advantages and quantify the disadvantages (through comparisons) over the two other markets that are proposed below (reactive and proactive DLFM).

B. A wholesale market-compatible and distribution networkaware market -Reactive DLFM (R-DLFM)
In contrast to the I-DLFM, the objective of the R-DLFM architecture is to be compatible and capable to interact with the existing TN-level markets (cf.#1, #2 and #5 in Table 1).In case that the R-DFLM operates right after day ahead market, it is capable to deal with: i) congestion issues at DN level that DAD cannot capture, and ii) forecast inaccuracies in energy production and energy consumption of DN-and TN-level assets.
The drawback of this approach is the possibility of infeasibility, or the need for mandatory/forced curtailments, or financially unsustainable distribution of DAD due to costly flexibility assets.All these may lead to discontented producers/consumers.Furthermore, in cases in which DAD is modified, the spot market price (cf.market #5) at the transmission level have to be paid.Finally, the absence of joint optimization between transmission and distribution levels leads to lower market inefficiency, which in turn deteriorates the economic viability of the participating stakeholders.
The sequence and timing of the markets in the R-DLFM energy market architecture is described in Figure 5. Initially the operation of the Day Ahead (#1) and the Reserve Market (#2) take place.Then FMO takes the output of these two markets and clears the R-DLFM (#3) according to: i) DSO's network topology and constraints (which generate FlexRequest) and ii) FSP and ESP bids (FlexOffers).A reserve market at DN level could optionally take place in this phase through the same procedure (#4).In the next phase the outputs of DAD and R-DLFM are given as input to the Balancing Market (#5).In the optional case that DSO wants to handle voltage limits due to RES in DN a balancing energy/capacity market at the DN level (#6) may also take place right after clearing the TN-level balancing energy market.Figure 6 illustrates the steps of the R-DLFM market clearing process: Step 1: The FMO takes as input the DAD that is composed from the power flows in the coupling point with the TSO and the dispatch that concerns producers and consumers in its distribution network.
Step 2: The DSO sends its DN data to the FMO.
Step 3: The FSPs and ESPs connected to the DSO send their flexibility bids to FMO.
Step 5: Flexibility assets are compensated for their operation according to a DNPA that the FMO executes.

C. Feasibility check and optimization of wholesale market bidding through a proactive distribution network-aware market -Proactive DLFM (P-DLFM)
In order to mitigate the drawback of the aforementioned architecture (namely, the difficulty to manage an infeasible (DN level) or expensive (TN level) market clearing), FLEXGRID proposes a proactive clearing of bids in the DN by the FMO before the MO clearing.In this way, it ensures an a-priori feasible dispatch of the DN-level DERs.
In order to allow the FMO to operate proactively, an accurate estimation of the TN-level market clearing prices (Markets #1, #2 and #5) at the TSO-DSO coupling point is required.An underestimation in TLMPs may result in a lower demand than calculated by TN level markets.An overestimation in TLMPs may lead to an over-supply of generation dispatch.
As shown in Figure 7, the sequence of markets starts with Market #3 operated by the FMO (DA DLFM -first row of Figure 7).In this phase, the P-DLMP is a day-ahead energy market at the DN level (ESPs and FSPs in DN level bid in this market).Right afterwards, in the next phase, the DA Energy Market (#1), second row of Figure 7, and the DA Reserve Market (#2) -third row of Figure 7 -at TN level close.The output of Day-Ahead P-DLFM acts as input to the Day-Ahead market at TN level.Finally, for near-real-time balancing markets, the DSO runs a proactive balancing market (Market #6)) -fourth row of Figure 7 -right before the Figure 8 shows the steps of the P-DLFM market clearing process and its interaction with TN level markets: Step 1: The DSO sends to the FMO information that suffices to model its distribution network.
Step 2: The FSPs connected to the DSO send their flexibility bids to the FMO.
Step 3: The Producers (ESPs) connected to the DSO send their production bids to the FMO.
Step 4: The Retailers (ESPs) connected to the DSO send their consumption bids to the FMO.
Step 5: The FMO (or any other party) generates a forecast for the TLMPs for the coupling point at which the DSO is connected.
Step 6: The FMO generates the DND through the execution of an algorithm noted as DNDA (may reduce the quantity in the initial bids, but it does not reduce the bidding prices).
Step 7: The TLD uses DNDA results as input bids.
Step 8: After the TLD, the DNPA uses as input: i) bidding prices of flexibility providers, producers and consumers, ii) TLD, and iii) DLD in order to derive the compensations for all the stakeholders that bid in Steps 2-4.
Finally, we highlight that in case of several local DSOs which are connected to different TN nodes of one TSOs' network the proposed architectures will be identical and functional.On the other hand, the case in which several local DSOs are connected to several TSOs is out of the scope of this work but it is a very useful research challenge.

IV. FLEXGRID DIGITAL ENERGY SERVICES (DESs) TO VARIOUS MARKET STAKEHOLDERS
In this section, we present DES that facilitates the operation of FSPs, ESPs, and System Operators (DSOs/TSOs) and we provide references to our published work for more detailed analysis.

A. DESs for FSPs and efficient end user flexibility aggregation
In order to facilitate the efficient interaction of FSPs (which FLEXGRID examines as a specific ESP category related with DN and end user flexibility management) with modern smart grids, FLEXGRID develops a set of DESs to automate this operation.These DESs can be used for: i) the efficient aggregation of flexibility assets that end users dispose at a specific DN location and ii) the optimal exploitation of them in the complex and emerging energy market architecture.The DESs to FSPs that FLEXGRID develops unfold around three major use cases, which are analyzed in the rest of this section.

DES-A1: Automated, efficient and dynamic aggregation of flexibility assets through advanced retail pricing models and auction-based mechanisms.
The aggregation of small-scale distributed flexibility assets (end user electric appliances with controllable loads, electric vehicles, batteries, etc.) requires the development of an advanced retail market through which FSPs trade dynamically with end energy prosumers (or else end users).The dynamic pricing schemes and auction-based processes that FLEXGRID develops are: i) real time and scalable, in the sense that they have the ability to find solution within acceptable (specified requirement) time limits (FLEXGRID considers both day-ahead and near-real-time cases), ii) efficient and able to provide effective flexibility exploitation 12,13 , iii) strategy-proof, in the sense that they do not allow the manipulation of flexibility aggregation by a set of malicious end users 14,15 , iv) competitive, in order to allow FSPs to provide competitive prices to their end users 16 , v) fair in terms of compensating end users according to the market value of their assets 17 , and vi) privacy protecting of the end user's personal data 14 .Moreover, the uncertainty in the constraints and preferences that the end user introduces is a critical research thread towards development of advanced pricing schemes.
More specifically, FLEXGRID develops an Automated Flexibility Aggregation Toolkit (AFAT).AFAT integrates several retail market pricing schemes and auction algorithms (that deliver various trade-offs of the requirements above).In exercising this business approach, FSPs can utilize advanced forecasting services to predict market prices and net load profiles of available end users' assets.Thus, FSPs optimally use the available flexibility (by dynamically adapting retail pricing) and in this way maximize the total profits for all participants in the FSP's portfolio.

DES-A2: Develops advanced RES and market forecasting ESs that predict the prices in the markets, thus facilitating FSPs to efficiently compose and exploit their portfolio (i.e. flexibility assets).
This DES includes forecasting of RES' aggregated generation and forecasting of market prices.Without lack of generality, FLEXGRID assumes aggregator's participation in both TN-and DN-level markets.Thus, forecasts will be applicable to all these markets (which are existing or FLEXGRID's developments) in order to allow FSPs to efficiently derive their assets' scheduling.

DES-A3: Efficient exploitation of FSP's portfolio by optimally interacting (maximize FSP's revenues) with several energy markets according to the FLEXGRID innovative energy market architecture.
FSPs aggregate flexibility assets from end users and trade their flexibility asset portfolio in various energy markets.The innovative portfolio scheduling that FLEXGRID develops 18,19 as a DES to the FSPs takes into account: i) detailed models of all the DERs that they may dispose, ii) their simultaneous participation in all energy markets (i.e. according to the three architectures that are analyzed above), iii) the existing competitors of flexibility aggregators and their dynamic behavior/strategy.The improvements through this DES are: i) the financial sustainability of the flexibility asset owners (i.e.end users) through more market opportunities and more efficient use of their assets, ii) the decrease of the smart grid management costs (network operators, which interact with FSPs, are able to exploit enhanced liquidity of flexibility assets in order to manage their networks with lower cost).

B. Advanced DER exploitation for Energy Service Providers (ESPs)
In order to facilitate third parties to efficiently interact with modern smart grid markets and provide competitive services through them, FLEXGRID equips ESPs with management services able to: i) optimally operate their available DER (e.g., RES, energy storage systems-ESS, demand side management-DSM), and ii) optimally plan their investments on them.
The various Business Models (BMs) that FLEXGRID serves are categorized according to the available data that the ESPs dispose.The basic BM assumes only knowledge of the market price forecast.More advanced BMs assume operation and investments in DERs are also based on the knowledge of: i) the topology and dynamic traffic in TN and DNs, and ii) the strategies of possible ESP competitors.
Management services to ESPs that FLEXGRID develops unfold around six major DESs, which are analyzed in the rest of this section.

DES-B1: Minimization of ESP's (OPEX) by co-optimizing: i) the consumption of its end users (DSM), ii) the production of its RES and iii) the operation of its ESS.
In this innovative market landscape, ESPs seek to optimize their assets' portfolio in order to maximize their profit and/or the welfare of their end users, by participating in a number of energy markets.Generally, the DERs operated by the ESPs are: flexible loads, inflexible loads, ESSs and production from RES. DER management DESs on the ESP side aim at a sophisticated interaction with network operators (DSO/TSO) through the competitive modern market architectures that FLEXGRID proposes.In this highly competitive landscape, ESPs determine the strategy that maximizes their profits and/or the welfare of their end users by optimally scheduling: i) their market actions (buying/selling), and ii) the operation of their DERs (e.g.ESS/EV charging/discharging, shifting/curtailing of flexible loads, RES usage, etc.).

DES-B2: ESP's optimal investment strategies in DERs
The formation of an ESP's portfolio, which considers the quantity and the network location (i.e., sizing and siting) of its DERs related with capital investments are long-term decisions 8 .As analyzed in 8 a Distribution Management System monitors DN level and is able to deliver as a service the monitoring output to third parties.Consequently, the modeling of this portfolio requires multi-stage planning and high robustness against potential inaccuracies in predictions regarding: i) the future market trends, ii) demand curves, iii) weather conditions, and iv) other variables that could influence ESP's market position.
FLEXGRID develops DESs that offer advanced investment strategies to ESPs that are adaptable to the desirable robustness level and the information disposed by the ESP, such as: i) market price forecasts, ii) the topology and dynamic traffic flows in the transmission and the distribution networks, and iii) the strategies of the ESP's competitors.

DES-B3: Co-optimization of DER operation that an ESP disposes towards maximum aggregated profits through its parallel participation in multiple DN-and TN-level markets
Congestion management and frequency/voltage control issues caused by high RES penetration increase the volatility of energy prices in modern energy markets (TN-level) as well as in emerging local flexibility markets (DN-level).This temporal and spatial volatility reveals the markets' characteristics and in the same time offers business opportunities and revenues for ESPs that invest on DERs 18 .
In order to be sustainable and competitive, ESPs should maximize their aggregated profits by dynamically co-optimizing their bidding strategy across several energy markets.FLEX-GRID not only models the existing markets (Markets #1, #2, #5), but also models emerging DLFMs (Markets #3, #4, #6).In this way, the ESPs are able to select their own BM, which determines the markets in which they are allowed to participate, based also on the existing regulatory framework.

DES-B4: ESP that manages the distribution network and the DERs attached to it.
This DES concerns ESPs that may be microgrid operators, energy cooperatives, energy islands with weak or no connection to the main grid, etc.In this case, there is no interaction between the ESP and the local market (e.g., Markets #3, #4, #6) because the ESP not only manages a DER portfolio, but it simultaneously manages the distribution network, as analyzed in 7,20.Hence, the ESP's objective is the optimal scheduling of its DERs and its optimal interaction with the existing energy markets (Markets #1, #2, #5) towards maximization of its profits or maximization of the welfare of its end users (i.e., DER owners).

DES-B5: ESPs that are primarily RES Producers (RESPs).
This use case is similar to DES-B1.It concerns the operation of hybrid RES/ESS systems and their participation in the energy market architecture.More specifically, a RESP actor is essentially an ESP owning DERs that are mainly RES (large photovoltaic and/or wind parks).DES-B5 aims at optimizing combined RES/ESS systems in order to avoid the imbalance penalties that are included in the optimization model.The proposed DES allows RESPs to: i) monitor, analyze and predict RES generation and market prices towards more efficient use of their assets, ii) plan and operate their assets optimally towards more competitive BMs and increased revenues in the modern market architectures proposed by FLEXGRID.

DES-B6: ESPs that are mainly ESS owners or that lease ESS for several purposes to several stakeholders simultaneously.
The participation of numerous DERs, providing non-negligible total volume, are one of the main prerequisites for the flexibility market to function in its full efficiency.There are complex BMs for managing and generating income from the use of DERs.DES-B6 facilitates this type of ESPs to operate financially sustainable BMs, with respect to the aforementioned energy markets, by leasing DERs.More analytically, this DES focuses on an ESP, which acts as an ESS owner and leases its ESS to various stakeholders that are market participants in several markets.
C. Advanced System/Network DES provision for Network Operators (DSOs/TSOs) TSOs and DSOs are service-oriented companies responsible for the transmission and distribution of electricity, respectively.In an era of high and distributed RES penetration, the management of transmission and distribution in a robust and efficient way constitutes the raison d'etre of modern smart grids.
In order to achieve these, TSOs have to interact very dynamically with DSOs and ensure the stability of their networks.In addition, both have to interact with profit-based DER investors in a way that they facilitate the efficiency of ESPs' investments or else guarantee the stable grid operation with the lowest possible cost for flexibility.In parallel, selective upgrades in the topology of their networks should be performed to mitigate market power strategies of malicious ESPs and ensure the optimization of social welfare (low cost of energy services and improved profitability of non-malicious ESPs).

DES-C1: Flexibility asset investments in which a System Operator shares information with an ESP (DER investor) towards more attractive trade-off between transmission/distribution costs and investment's financial sustainability.
In order to secure stability/reliability and low cost of the future smart grid, this DES 21 develops long-term DER investment planning while considering factors such as: i) underlying network topology, and ii) topology-aware production/demand curves.Traditionally, the most common choice for securing sufficient network capacity during the peak hours is expansion of the network using physical assets, i.e., new lines, transformers, circuit breakers, etc.This method has two negative consequences: i) high capital expenditure (CAPEX), ii) transmission/ distribution system is most of the time heavily under-capacitated.
A different perspective is the smart placement and utilization of DERs, which can alleviate/postpone major network expansion investments and result in robust transmission and distribution systems.FLEXGRID further evolves this strategy by offering DES to system operators through which they can accurately inform DER investors in order to conduct investments adapted to their economic viability problems.

DES-C2: TSO-DSO collaboration for coordinated and dynamic management of aggregated flexibility assets.
Customers and distributed third-party energy resources that have the ability to adjust their consumption, generation, or storage units in short time could be aggregated and their flexibility could be offered directly as ancillary service to the TSO or to be used for DSO purposes.Thus, ancillary services like active/ reactive power control could take place more efficiently through an efficient exchange of flexibility between TSO and DSO.
The main innovation here is to supply reliable and efficient flexibility to TSO or DSO from geographically distributed third-party energy resources.According to the proposed collaboration model, the flexibility assets that TSOs and DSOs directly control in order to handle very dynamic and short-term stability can be used to help each other.In this way, these DES become much more dynamic and efficient.

DES-C3: Market power aware upgrade of DN and/or TN.
The development of dynamic DLFM (e.g.Markets #3, #4, #6) facilitates high RES penetration by increasing the liquidity of DERs, thus reducing the cost of energy.At the same time, in contrast with traditional grid architectures in which flexibility is managed in a direct control fashion from the system operator, smart grids "acquire" a vulnerability relevant with the way that strategic and malicious ESPs may affect/manipulate the market prices.
In order to mitigate its effects, FLEXGRID offers ESs through which TSOs and DSOs are able to upgrade their network by taking into account information relevant to the market power aware network topology weaknesses.In accordance with this DES, topology aware flexibility investments further mitigate market power and in this way system operators and end users are able to experience flexibility markets' benefits.

V. FUTURE WORK
FLEXGRID's plan is to compare the aforementioned energy market architectures and evaluate its proposed algorithmic toolkit using real data by focusing on: i) market clearing and pricing algorithms, and ii) DER operation and planning algorithms.Another major goal of FLEXGRID is to provide a comprehensive regulatory and policy framework roadmap to the European Commission by offering recommendations regarding the introduction of DLFMs in the existing energy markets and grid operations.In this way, FLEXGRID will not only offer a range of proposed architectures to future smart grids, and a description of the best version of each of them, but will also quantify their strengths and weaknesses.This will allow EU policy makers/regulators to harvest the potential gains and avoid the risks in the design of the clean energy transition.You claim that "for near-real-time balancing markets, the DSO runs a proactive balancing market (Market #6)".what is the purpose of this market?This is critical because the TSOs are in charge of balancing markets.If you refer to the DSO market close to real-time to balance their system or to dispatch resources to solve network constraints that have to be clarified.

Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Yes
Competing Interests: No competing interests were disclosed.
Reviewer Expertise: Electricity market designs.Power system Economics.Demand-side flexibility.
I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.

Antonis Papanikolaou
Hypertech Energy Labs, Hypertech SA, Chalandri, Greece Georgios Pitsiladis Hypertech Energy Labs, Hypertech SA, Chalandri, Greece This paper presents an innovative market framework where digital energy services facilitate the efficient stakeholder interaction and the cooperation of flexibility markets in smart grids.In the context of FLEXGRID, three different flexibility market architectures have been designed and developed.The purpose of these market architectures is to enable the interaction of different energy stakeholders to enhance smart grid efficiency and profits for the market participants.The authors evaluate each one of the architectures based on the potential efficiency and the compatibility with the existing market's schemes.The market clearing process of each architecture has been developed as a FLEXGRID service and is accessible by any interested user.In addition, various uses cases and business models complementing the proposed solutions are provided.
Overall, the proposed market framework is very interesting and its contribution for the future integration of energy markets may be significant.The paper is overall well written and easy to follow.Some comments for further consideration are provided in the following paragraphs.Figure 1 is not very clear.Perhaps it is necessary to elaborate a little bit more the interactions between the market actors and the functionalities as well as how FLEXGRID components facilitate each stakeholder especially DSOs and TSOs.
Regarding the proposed market architectures, their applicability and compliance to current or expected -based on the Electricity Market Directive -EU regulatory frameworks is not evident from the article.A very brief analysis would assist the reader to understand the true potential of the proposed architectures.
Is it possible to apply these markets frameworks where several local DSOs are connected to different TN nodes of the TSOs' network?If possible, how many Flexibility Market Operators will exist and how will interact with the Market Operator.Some further analysis in this direction will showcase the applicability of the proposed architectures in electricity systems with different network and market configurations.

Is the rationale for developing the new software tool clearly explained? Yes
Is the description of the software tool technically sound?Yes Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?Yes Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?Yes Competing Interests: No competing interests were disclosed.

Reviewer Expertise: Energy transition, energy demand management, energy markets
We confirm that we have read this submission and believe that we have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.There are some aspects of the presented framework which are not clear from a regulatory point of view.Some discussion and regulatory recommendations on the different roles considered and the function the agents perform provide good insights.
In the introduction, when referring to "inefficient investment planning and management of DER assets".It is not clear who is the planner of DERs.Planning is generally related to network and regulated companies.DERs' owners take investment decisions according to diverse economic signals including market prices, tariffs, self-generation regulations, etc.I recommend rephrasing this to avoid confusion.What are the roles of Energy Service Providers (ESP)?.Can ESP perform aggregator aggregator?It seems that they own DERs, but does it consider also resources inside customer premises?The MO is responsible for the efficient and network-aware market clearing at TN-level.Is it the TSO?It would be good to specify the roles of each agent.
You state that in market #4 "DSO operates the day-ahead reserve market at the DN level".Are these operating reserves for frequency control or availability reserves for congestion management?.I believe the latter.
In market #6, "DSO operates the balancing energy market" the balancing energy market is the responsibility of the TSO, not of the DSO.Can you clarify or comment on the regulatory implications for this market?Is this proposal possible in the European market model?I confirm that I have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.

Figure 2 .
Figure 2. MO-FMO collaboration for better overall market efficiency outcomes and TSO-DSO collaboration for better operation outcomes for the electricity grid as a whole.

©
2023 Chaves Ávila J.This is an open access peer review report distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.José Pablo Chaves Ávila " Institute for Research in Technology (IIT), ICAI School of Engineering", Comillas Pontifical University, Madrid, Spain Thank you for addressing my previous comments, most of them were solved.I still have some remarks: Figure 1 is still not clear to me, please clarify what is the meaning of the arrows.1.

Version 1 Reviewer
Report 03 December 2021 https://doi.org/10.21956/openreseurope.15210.r28038© 2021 Papanikolaou A et al.This is an open access peer review report distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Reviewer Report 22
November 2021 https://doi.org/10.21956/openreseurope.15210.r27899© 2021 Chaves Ávila J.This is an open access peer review report distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.José Pablo Chaves Ávila " Institute for Research in Technology (IIT), ICAI School of Engineering", Comillas Pontifical University, Madrid, Spain This paper presents an advanced market framework for flexibility services.The framework presents an open source model which considers the different operation and investment decisions from different agents.The contribution of the framework is significant and very relevant for different projects which address this topic.

Figure 1
Figure 1 is difficult to read: what are the arrows indicating?Money flow?The MO is responsible for the efficient and network-aware market clearing at TN-level.Is it the TSO?It would be good to specify the roles of each agent.

Figure 7
needs further explanation to understand the links, colours, etc.For ESPs, you consider the network location.How is this made in practical terms?Are you proposing to disclose network data?If so, in which format and what data?I recommend mentioning the practical implementation challenges.Is the rationale for developing the new software tool clearly explained?YesIs the description of the software tool technically sound?YesAre sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?YesIs sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?YesCompeting Interests: No competing interests were disclosed.Reviewer Expertise: Electricity market designs.Power system Economics.Demand-side flexibility.

Table I . Summary of markets assumed within FLEXGRID. Market #1 Market Operator (MO) operates the day-ahead energy market at the Transmission Network (TN) level
InputMO receives bids from all market participants and basic power flow constraints at the TN level.Depending on FLEXGRID's various energy market architectures selected from the FLEXGRID's set of options (see below), the market clearing process of Market #1 either ignores the DN topology, or implicitly takes it into account (output of Market #3).

FMO) operates the day-ahead energy market at the Distribution Network (DN) level
InputReceives bids from all market participants at DN level, and DN topology constraints.DAD schedule from MO at all TSO-DSO coupling points or respective day-ahead energy market price forecasts (depending on the selection of energy market architecture from the three FLEXGRID options below).OutputMarket clearing results (DN-aware price €/MWh and DAD per accepted market participant and DN node) Market #4 DSO operates the day-ahead reserve market at the DN level Input Receives bids from all market participants at DN level, DAD schedules from FMO, local RES/demand forecasts, and maintenance-related info (if any) Output Reserve market clearing results at DN level (price €/MW per DN node and reserve capacity commitment per accepted market participant) Market #5 TSO operates the balancing energy market at the TN level Input Receives bids from all market participants at TN level (incl.DER aggregators), updated RES/demand forecasts, updated data from SCADA/EMS.Depending on the energy market architecture selected from the FLEXGRID's various options, the market clearing process of Market #5 either ignores the DN topology, or implicitly takes it into account through the output of Market #6.Output Balancing energy market clearing results at TN level (i.e.prices €/MWh per TN node, and Up/Down activation energy quantities per accepted market participant)

or market-based? Future redispatch procurement in Germany. 2019. Is the rationale for developing the new software tool clearly explained? Yes Is the description of the software tool technically sound? Yes Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others? Partly Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Yes Competing Interests:
No competing interests were disclosed.

have read this submission and believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard.
https://doi.org/10.21956/openreseurope.17941.r35426