Mapping the Wholesale Day-Ahead Market Effects of the Gas Subsidy in the Iberian Exception

: Amidst the global energy crisis in 2022, the Spanish and Portuguese governments introduced a subsidy to natural gas (“the Iberian exception”), attempting to lower the wholesale electricity market prices, with the understanding that gas-fired-combined cycle gas turbines (CCGTs) are price-setting technologies most of the time, directly or indirectly. The subsidy succeeded in lowering the market price but induced several other effects, such as (1) the increase in cleared energy in the Spanish market (mostly produced with gas), (2) the bias in the import/export cross-border position between Spain and France (Spain became a net exporter to France immediately), or (3) the consequent increase in congestion rents, which serve to lightly finance the subsidy, among other effects. This paper provides a framework for clustering the different effects based on the market participation phases: the subsidy, the market bidding, the market results, and surplus and rents. Moreover, this paper builds on the theoretical market models, with and without subsidies, and with and without cross-border exchanges. Based on the real market bids, the subsidies, and the generators’ data, we reconstruct the supply and demand curves and simulate the counterfactual market scenarios in order to illustrate and quantify the effects. We highlight the quantification of the theoretical effect of the transfer of rents, from non-fossil to fossil fuel producers, induced by the gas subsidy.


Introduction
In the past decades, the decarbonization of the EU power system has relied on three key drivers [1]: First, the massive rollout of intermittent and hardly dispatchable renewable energy sources (RESs) received strong political support for reaching technological maturity and gaining market competitiveness.Second, the pricing of carbon emissions, implemented via the EU-Emission Trading System (EU-ETS), aimed at achieving ambitious CO 2 reduction targets [2], where CO 2 -emitting electricity generators had to buy emission allowances.The third involved the construction of combined cycle gas turbines (CCGTs), running on natural gas, as a backup for intermittency and seasonality of renewables, with large ramp-up/down capabilities [3].We recall that CCGT generators are dispatchable, more flexible, efficient, and less CO 2 -emitting in the combustion compared to coal power plants.
The balance between a decarbonizing electricity mix and an affordable electricity supply was achievable due to several factors.On one hand, the implementation of the EU-ETS required coal power plants, with an efficiency of around 35%, to buy about 2-2.5 times more allowances than CCGTs, which have an efficiency of around 55% [4], for producing 1 MWh of electricity.On the other hand, European wholesale electricity market pricing is based on a double auction of aggregate demand and supply, also known as the short-run supply curve or merit order curve [5,6], where the most expensive generator unit sets a unique market price for all participants, both buyers and sellers ("pay-as-clear").With these factors in mind, coal power plants and CCGT generators became the most expensive technologies in the electricity mix and competed against each other for price-setting.The affordability of a decarbonizing electricity supply was facilitated by the price of CO 2 allowances being around 10 EUR/ton CO 2 , eq., and the price of natural gas being about 30 EUR/MWh, making CCGTs competitive against subsidized national coal in many EU countries.
The global energy crisis of 2021-2022 revealed the strong correlation between natural gas prices and the EU electricity market prices [7].In 2021, in Spain, CCGTs set the price only 15.9% of the time [8].However, in reality, CCGTs had a much more significant influence on the market price, as hydropower plants (HPPs) often bid as the highest and most likely price-setting technology, which happens to align with CCGT throughout many hours of the day.HPPs base their market bids according to their water value (or opportunity cost for this specific type of generator): if the plant uses water to generate electricity now, it will have less water to generate electricity later [9,10].Moreover, HPPs and CCGTs have similar start-up, ramp-up, and ramp-down capabilities.Therefore, in practice, CCGT and HPPs tend to bid similarly in the market.In 2021, HPPs set the price 54.9% of the time [8].Hence, the price of natural gas sets the electricity price, directly and indirectly, around 65-70% of the time.
In Figure 1, we plot the wholesale gas prices from MIBGAS, the Iberian gas market [11], and the wholesale electricity prices and OMIE, the nominated electricity market operator for the Iberian Peninsula [12].Note that around 70% of the demand in Spain is traded in the wholesale market [8].Prior to the subsidy's application, we observed a strong correlation between both prices.The full 2022 average electricity day-ahead price was 167.5 EUR/MWh, whereas in 2023, the price dropped to 87.1 EUR/MWh [13].Regarding the natural gas prices, the 2022 average day-ahead price was 99.16 EUR/MWh, whereas the 2023 average price was 39.12 EUR/MWh [14].Hence, the application of the subsidy largely decoupled the electricity price from the natural gas price.The Spanish retail market consists mainly of two types of retail firms: free-market ones and the PVPC retail tariff, "Precio Voluntario para el Pequeño Consumidor" [16], a unique, regulated tariff for small and vulnerable consumers that is indexed to the wholesale market prices.Around 60% of domestic consumers have a supply contract with freemarket retailers, compared to 40% with regulated tariffs [17].Regarding high natural gas prices in 2021-2022, the rise in electricity prices directly impacted domestic and industrial consumers purchasing electricity directly or indirectly on the wholesale market, such as PVPC retail consumers.
In order to mitigate the impact of high gas prices on the electricity market price to the consumers and the inflation indices [18], the Spanish and Portuguese governments implemented a significant subsidy for fossil fuels, primarily natural gas, branded as "the Iberian exception", with the aim of artificially lowering the electricity market price, which entered into force on 15 June 2022.The subsidy for fossil fuels adopts an approach contrary to the popular subsidies for renewables, which aimed at accelerating their technological maturity and market competitiveness [19].Most literature has addressed the impact of renewable subsidies and the market policies surrounding this mechanism.The main driver for renewable energy subsidies was the priority of the environmental agenda over the economic agenda.In contrast, the driver for the fossil fuel subsidy was the reduction of inflation, acknowledging the influence of electricity prices on inflation indices.
Implementing the fossil fuel subsidy resulted in a noticeably lower electricity price in the Iberian market, which mainly affected the surplus of consumers and producers.Moreover, it introduced a significant price difference between the Spanish and the French market, leading to a net cross-border export position, from Spain to France, which produced additional congestion rents.Congestion rents on the Spanish side were used to partially finance the gas subsidy, aiming to alleviate the recharge to consumers.
The European Commission acknowledged the distortion of the market results introduced by the gas subsidy.Moreover, the authors of [20][21][22] analyzed the cross-effects of the gas subsidy and the inflation indices as well as the impact on the cross-border energy exchange.While most of these references come up with similar estimates of the price impact of the subsidy, they do not provide a comprehensive approach to the many phenomena occurring internally in the Iberian market, such as the variations in the bidding behaviors of different market participants, the impact of demand elasticity, the quantification of the extra-cleared energy, the re-distributional effects of the subsidy, the counteracting effect of the cross-border exchange, or the increase in congestion rents for financing the measure.
The price containment achieved by the gas subsidy in the Iberian system raised the question of whether the same measure could be adopted at the European level [23].In [24], the authors acknowledged the role of the limited cross-border exchange capacity of the Iberian electricity system with the rest of continental Europe [25] as a major factor in the effectiveness of the measure.After many discussions and counter-proposals, the EU price cap was approved on 19 December 2022, with stringent conditions for activation, namely (1) a month-ahead price at the title transfer facility (TTF) exceeding 180 EUR/MWh for three working days, and (2) a month-ahead gas price at the TTF that is EUR 35 higher than the reference price for liquefied natural gas (LNG) on global markets for three working days.Despite the emergency measure not being activated, the EU energy ministers have decided to extend it until 2025 [26].
In this paper, we narrow the scope down to the internal Iberian market phenomena and we leave out other phenomena and impacts that may occur in other European markets.We emphasize the work done in processing individual bids and the methodology for constructing counterfactual scenarios (both aspects are often omitted in many studies).We connect the individual supply and demand bids with simple market models of the Spanish system, interconnected with the French one, in order to map and estimate the main changes in the wholesale day-ahead market (DAM) before and after the implementation of the subsidy for the price-setting technology.This approach enables us to simulate the market scenarios with the highest possible granularity, on an hourly basis.
Given the many direct and indirect effects induced by the subsidy, in this paper, we present a comprehensive framework that clusters these effects according to the market participation phase, in four blocks: the subsidy policy, the market bids, the market results, and the surplus and rents, addressing each phase in the corresponding section, as shown in Figure 2.
• Section 2: the gas subsidy.Here, we describe the design of the subsidy and the recharge to consumers who benefited from the market price reduction.We address the contribution of the congestion rents to the financing in Block 3. • Section 3: The market bidding.In this section, we analyze (1) the demand bids, mainly retailers, industry, and hydropower plants in the pumping mode, (2) the supply bids, mainly renewables, gas generators (CCGTs), and hydropower plants in the generation mode, and (3) the cross-border participation.• Section 4: The market results.In this section, we describe the market models (with/ without a gas subsidy and with/without cross-border energy exchange), the methodology for simulating and estimating the changes in the different market clearing scenarios, and the main changes in the market clearing.• Section 5: From the market results, we estimate the changes in (1) the consumer surplus, (2) the producer surplus, and (3) congestion rents.The lower cleared market price led to an increase in consumer surplus and a reduction in producer surplus.However, the reduction in generator surplus is unevenly distributed, as the fossil fuel producers' surplus is compensated by the subsidy, while the non-fossil fuel generators' surplus is not.Therefore, in practice, this effectively caps the maximum profit of renewable generators and redistributes infra-marginal rents from renewables to consumers and fossil fuel generators.In Section 6, we draw conclusions, identify some contradictions and issues, and propose recommendations from the analysis.By adopting a narrow approach exclusive to the Iberian market, we are forced to leave out a number of phenomena beyond the Iberian system, such as the impact of the gas subsidy over the French market price or the role of French nuclear production in the market prices, among others.Moreover, we focus on the first months after the subsidy's application, covering the time frame between 1 June and 30 September 2022 (the months where the natural gas prices scored the highest).

The Gas Subsidy
The Iberian Exception consists of a temporal subsidy (state aid) to gas power plans.According to the legislative text, the gas subsidy consists of [15] "a form of payment to the operators of fossil fuel power plants (except for those subject to regulated revenues such as certain CHP plants or plants outside the Spanish mainland) to cover part of their fuel costs.This includes both gas-fired and coal-fired power plants.By reducing the operating cost of the plants with the highest influence in setting wholesale electricity prices, the measure aims to reduce the price of electricity in both the wholesale and retail markets.The payments function as a direct grant aimed to finance part of the fuel cost".
The amount of the subsidy is calculated as follows: where Y is the unit amount of support/subsidy [EUR/MWh].P NG is the reference for the natural gas market price, more specifically, the Iberian day-ahead market price [11].
The reference price index P NG was specifically created to calculate the subsidy.This has triggered some criticism, given that the volume of gas traded in the gas market is relatively low compared to the volume traded in bilateral contracts at a much lower price [27].P NG,cap is the level of the cap of the natural gas price, the maximum level of internalization of gas price in the electricity market.The coefficient of 0.55 reflects the average efficiency (55%) of the gas-fired power plants that influence prices most often in the Iberian market.The government aimed to not generate a discriminatory subsidy assignment and, therefore, the subsidy is equal to all the CCGTs, independently of the particular efficiency of the plant, assuming similar efficiency and natural gas procurement costs by the CCGT owners.
The subsidy was conceived to last 12 months, although the European Commission can approve a state-aid measure with a maximum duration of 18 months only to certain market players.In this period, the gas price cap P NG,cap increased, progressively approaching the actual MIBGAS reference price, hence decreasing the subsidized quantity.We show the dynamic price cap proposed in the measure in Table 1, whereas, in Figure 3, we show the daily unit quantity of the subsidy, the total hourly volume of subsidized gas [MWh], and the total hourly cost of the subsidy.In the figure, we observe a large subsidy, following the periods of higher natural gas prices, according to (1).In Figure 3, we observe that the volume of subsidized gas follows sharp daily and weekly fluctuations, as the gas-fired peaking power plants contribute to producing electricity at times when it is most needed, typically at evening hours and weekdays.In the 4-month period, the average cost of the subsidy was 2.85 M€ per hour, with a few hours reaching around 8 M€ at the beginning of September 2022.Looking at the four-month analysis, three-and-a-half months corresponded to the subsidy, with a total amount of 8350 M€.We estimate that it represented 2.1% of the 2022 Spanish GDP, adjusted for the 3.5-month period.
Given the context of uncertainty and rising gas prices, the measure included one condition for suspending the subsidy when the MIBGAS price index fell below the price cap index for three consecutive days.This implied that mild winter temperatures and reduced gas demand could trigger the early stop of the subsidy.Since the application of the subsidy, we observed a few episodes where the gas price was below the subsidy [28].

Recharge to Consumers
The subsidy was financed by two mechanisms: (1) a recharge to the consumers benefitting from the measure, mostly consumers with PVPC retailers, with electricity prices indexed to the wholesale market price, nearly 10.6 million consumers [29,30]; and (2) the "congestion rent" obtained by exporting electricity to a country with a higher electricity price [4,24].The compensation subsidy data are accessible at the market operator transparency platform [31].

Market Bidding
In this section, we explore how the market participants changed their market bidding behaviors after the subsidy's application.

Supply Bids
Among the many generation technologies participating in the market, for simplicity, we group them into three categories [32]: • "Must-take" generators, such as nuclear and renewables, with little or no flexibility to produce at different times, will operate when they physically can.Regulatory agreements can drive their market participation, and they take whatever price is cleared; hence, they are infra-marginal to the market.
In the Spanish electricity system, most nuclear power plants trade their energy via bilateral contracts [33].Hence, the majority of "must-take" generators correspond to renewables that have not changed their market bids after the subsidy.• Fossil fuel generators, such as CCGTs and coal-fired plants, have a high degree of flexibility to produce at different times.Their fuel and operating costs determine their market participation.These generators were the target group for the subsidy, and they have lowered their market bid according to the amount of subsidy.

•
Reservoir generators, such as hydroelectric power plants (HPPs), also possess a high degree of flexibility to deliver stored energy at the most opportune times.Their market participation is driven by the opportunity cost of selling stored energy at different times of the day to maximize its value, also known as "water value" [9].Therefore, given that CCGTs are frequent price-setting technologies, HPPs tend to bid similarly to CCGTs, as can be observed in Figure 4.The market bidding behavior of HPP is limited by the availability of stored water and ecological water flow constraints.In 2022, Spanish HPPs had low levels of stored water, hence reducing their contribution to the energy mix [8,34].Figure 4b shows that, after the introduction of the subsidy, a few HPPs still bid similarly to CCGTs, but there are far fewer units participating.
From June to September 2022, no Spanish HPPs were cleared in the market, only Portuguese HPPs.

Demand Bids
We cluster the buying market participants into three categories, namely, retailers, industrial consumers, and HPPs in pumping mode.In the market participant record, we also find the "generic" participant category without details; hence, it is out of the scope.Note the following:

•
Retailers typically procure energy for their pool of domestic consumers and small enterprises.They tend to bid at high prices to ensure they enter the market clearing.Nonetheless, they pass the cleared energy cost onto the customers, with little incentive to seek cheaper market energy deals due to the associated risks.• Industrial consumers are large enough to procure their energy directly from the market.They have strong incentives to look for cost-effective energy deals.• Hydropower plants in pumping mode also have strong incentives to find inexpensive energy deals, coupled with the flexibility to pump at any time of the day.
In Figure 5a, we observe that, before the subsidy, most retailers tended to bid below 180 EUR/MWh, whereas in Figure 5b, by the time the subsidy was in place, generic units and many retailers had significantly increased their bid prices, up to 500 EUR/MWh or higher, even though the market prices in Spain in that period never exceeded 300 EUR/MWh, as can be observed in Figure 6.We observed Spanish retailers bidding at maximum prices at around 1002 EUR/MWh, with occasional episodes of 2400 EURMWh or 4000 EUR/MWh bids.

Cross-Border Exchange
The price difference between the Spanish and French markets can be observed in Figure 6a.Beyond the gas subsidy on the Spanish side, several other factors can also contribute to explaining the price difference, such as the larger contribution of renewables in the Iberian region or the nuclear stoppage in France.The price difference led to increases in cross-border exports, which are shown in Figure 6, on an hourly basis.Traditionally, the imported and exported energy to France was relatively even.Soon after the gas subsidy came into force, Spain mostly became an exporter to France, and the French consumers benefited from the measure, as the Iberian gas subsidy helped lower the prices to some extent [35].

Market Models and Clearing
In this section, we describe the different models that explain the functioning of the Iberian day-ahead market.We start by describing the simple wholesale market model, without a gas subsidy or any cross-border exchange (model M, described in Section 4.1).Later on, we apply the gas subsidy to the model (model SM, in Section 4.2).Finally, we incorporate the cross-border exchange between two countries, both without the subsidy and with the subsidy in place (models XBM and XBSM, respectively, both addressed in Section 4.3).The XBSM model corresponds to real data from the Iberian market when both the gas subsidy and the cross-border exchange were active.We summarize the market models in Table 2.

Market Model without the Subsidy (M)
As a starting point, we take the supply and demand bids (energy [MWh] and bid price [EUR/MWh]) from generators, consumers, and retailers.The demand curve is built after sorting the demand bids from the highest to the lowest price, prioritizing the consumers (or their representatives, retailers) willing to pay more for acquiring energy with aggregated bid energy.The supply curve is obtained after sorting the supply bids from the lowest to the highest price (merit order curve), with priority given to generators willing to sell at a lower cost.We assume that the bids reflect the marginal costs of generators [36,37].
The market clearing intersects the aggregate demand and supply curves.The generation unit that sets the price is the marginal unit, whereas the units with lower prices are the infra-marginal units.All the market participants-both buyers and sellers-pay and are paid the same price for the energy obtained from the market clearing, also known as "Pay-as-Clear".
Consumers' surplus refers to the euro (EUR) measure of the extent to which consumers benefit from participating in a transaction [38].Visually, the consumers' surplus is the area constrained below the demand curve and above the market clearing price.Producers' surplus, also known as "operating profits" [38], refers to the euro (EUR) measure of how the producers benefit from participating in the transaction; this is the total revenue minus the variable costs.These concepts are shown in Figure 7. Visually, the producers' surplus is the area constrained between the market clearing price and the supply curve.It represents how beneficial the market result was against the sellers' expectations.These profits serve to finance the fixed cost of production of the producers [39].

Market Model with the Gas Subsidy (SM)
This model introduces the subsidy Y [EUR/MWh] to gas generators (CCGTs), which is clearly separated from the rest of the technologies.In 2021, coal power plants, which were also subsidized, became price-setting technologies for only 1.5% of the total annual hours [8].Therefore, in this paper, we consider coal power plants as negligible.The cost of the subsidy is calculated as the product of the quantity of subsidy Y and the total amount of subsidized energy E Y .
The CCGTs are obliged to pass through the subsidies into their market bids.Therefore, applying the subsidy modifies the supply curve and produces a new market-clearing result (price p SM and energy q SM ), distinct from the market model without the subsidy (price p M and energy q M ).The new results lower the market price and increase the cleared energy.According to the theoretical model, the extra energy is supplied by fossil fuel producers.

Elasticity
The elasticity of the demand around the market clearing point plays a crucial role in the efficiency of the subsidy for lowering the market price.Therefore, we consider the scenarios of perfectly inelastic (vertical) and elastic/inelastic (not vertical) demand.
• Perfectly inelastic demand.The change in the market clearing price fully reflects the gas subsidy but does not imply an increase in the cleared energy compared to without the subsidy.The total surplus (consumers' plus producers' surplus) remains the same.In this scenario, we observe no change in the fossil fuel producers' surplus (or operating profits), whereas non-fossil fuel producers do.Yet, the consumers' surplus increases in proportion to the difference in market clearing prices, as does the producers' surplus reduction.Therefore, the redistribution of surplus happens from non-fossil fuel producers to consumers.
• Elastic/inelastic demand.In this case, the new market clearing price does not reflect the subsidy entirely.The consumers' surplus increases, but the change in producers' surplus is unclear.Nonetheless, we observe that the non-fossil fuel producers' surplus decreases, and fossil fuel producers' surplus increases.
Figure 8 shows the model with the gas subsidy (SM), compared to the situation without the subsidy (S).Additionally, we illustrate the influence of the elasticity of the demand (elastic vs. perfectly inelastic).In order to illustrate the effects of the subsidy, we clearly separate non-fossil fuel from fossil fuel power plants, where the subsidy applies.The figure illustrates the increase in energy at the market clearing point due to the lower cost of the supply curve (Q SM − Q ′ M ).The extra cleared energy is supplied by CCGT fossil fuel producers.Therefore, the gas subsidy created a profit opportunity for CCGT producers.This model suggests a change in the generation mix, with a higher share of fossil fuel CCGTs.We acknowledge that other factors, such as drought, variable renewables production, and temporary nuclear halts, may mask the true impact of the gas subsidy.
The subsidy application increases the consumer surplus.However, contrary to the case of perfectly inelastic demand, the impact on the total producers' surplus is unclear.Similar to the case with price inelastic demand, the surplus of non-fossil fuel producers clearly decreases in proportion to the market price difference.In contrast, the surplus of fossil fuel producers (operating profits) increases.For the sake of visual comparison, we plot both cases together in Figure 8.

Market Model with the Cross-Border Exchange without the Subsidy (XBM) and with a Subsidy in One Country (XBSM)
In this section, we build the model where two markets (two countries) are connected by a line that allows cross-border energy exchange between them.We consider that both markets work with the same market principles, as described in Section 4.1, having different cleared prices and energy on each side.A similar approach was adopted in [40] when assessing the carbon leakage in the UK.In addition to this, we add the case where one country subsidizes the gas but not the other, as described in Section 4.2.We introduce the concepts for these models: The cross-border exchange (Q XB ) refers to the quantity of energy that is exchanged between both countries, and it is limited by the cable capacity.In the EU electricity market, cross-border exchanges are traded independently before the national wholesale markets.In practice, the cross-border capacity has priority in the merit order curves over the national market results.Therefore, the cross-border energy exchange affects the prices of both markets.When country A exports energy to country B, the market in country A interprets the exchange as a demand ("country B is demanding energy from country A"), and market B interprets the same exchange as a supply ("country A is supplying energy to country B").
Congestion rents (CR) appear as operation profits generated from the participation of the cross-border line in the market clearing and the difference in prices in both countries (p A and p B ). Assuming that the line is equally owned by the two system operators, the profits are also equally divided at 50%.Therefore, we divide the congestion rent between CR A and CR B , being equal, and calculate as follows: In Figure 9, we plot the market models with cross-border exchanges with and without a gas subsidy implemented in Country A (models XBM and XBSM).The cross-border exchange capacity aims to reduce the price difference between the two countries.We highlight the influence of the cross-border exchange in the respective market curves of each country.Without the cross-border exchanges, the market clearing price in country A would be significantly lower than without the cross-border exchange, and the opposite effect for country B. Therefore, a large cross-border capacity contributes to reducing the price difference between neighboring countries.In theory, in the case of infinite capacity, the price difference would be 0, and there would be no congestion rents.
However, in Figure 9, we observe that the implementation of the subsidy contributes to the opposite effect by increasing the price difference and, consequently, increasing the congestion rents in both countries, assuming that the cross-border capacity does not change with the subsidy.

Methodology for Building Counterfactual Scenarios
As a starting point, we take the real market results published by OMIE, the Spanish market operator.OMIE publishes the simple bids from the market participants, differentiating between the offered bids and the cleared bids.The list of offered bids includes all the market participants, as well as infra-marginal and supramarginal bids, whereas the list of cleared bids does not include the supramarginal bids; hence, it stops at the clearing point.Still, many infra-marginal offered bids (generators) are not finally cleared because they could potentially create technical grid problems.Before this happens, the transmission system operator validates the feasibility of the market solution.
Therefore, the real market results correspond to the scenario with a gas subsidy and cross-border exchange in place (XBSM model).In order to build the counterfactual scenarios (XBM, SM, M), we manipulate the supply and demand bids in two ways.First, in order to extract the influence of the gas subsidy, we separate the fossil fuel bids from the nonfossil fuel bids based on the public registry of the generators' technology.Moreover, we re-calculate the hypothetical bidding price of the fossil fuel generators without the subsidy based on the public subsidy data.In this way, we can build a new supply merit order curve and estimate the new market clearing as if there was no subsidy in place (SM vs. M, XBSM vs. XBM models).
Second, in order to extract the influence of the cross-border exchange, we remove the cross-border exchange capacity "bid" corresponding to the Spain-France link, and we recalculate the market clearing (XBSM vs. SM, XBM vs. M models).In this way, we can simulate the market clearing under the different market models.We summarize the market curve manipulations for each scenario in Figure 10.The manipulation of market bids to construct the counterfactual scenarios is based on several considerations and hypotheses: 1.
We assume that the energy demand is independent of the subsidy's application, meaning that consumers have not flexibly reduced their demand in response to high gas prices.

2.
In scenarios where we remove the cross-border exchange bid (M and SM models), market clearing would not be possible due to several bids missing.Therefore, we need to extend the supply merit order curve with the supramarginal bids in order to facilitate the new clearing.We extended the supply and demand curves with the offered supramarginal bids that were not included on the list of cleared bids.We acknowledge that new technical restrictions could arise from this procedure.However, this method reduces the bias and respects the original technical restrictions.

3.
We assume that cross-border power flows between Spain and France remain the same after we remove the subsidy.This hypothesis is questionable to a large extent, as the historical records show a reasonable balance of imports and exports between Spain and France prior to the gas subsidy on 15 June 2022.Immediately after Spain introduced the subsidy, Spain became a net exporter to France.In [41], the author highlighted that, in April 2023, Spain continued to be an exporter to France, even though the subsidy application had ceased because of the recent partial nuclear halt in France.Therefore, we refuse to draw solid conclusions based heavily on this hypothesis and recommend further research on modeling the use of cross-border exchange capacities depending on the price differences between countries.

4.
Even though hydropower plants (HPPs) tend to bid similarly to CCGT, we have not applied the subsidy to their bids, so we assume the HPP water value remains unchanged by the subsidy.However, when attempting to reconstruct the aggregate supply curves without the subsidy, we lack sufficient information to estimate how the bidding price for HPPs would change.

Market Clearing Results
In this section, we estimate the impact of the subsidy and the cross-border exchange on the actual market price and energy on the Spanish side.We conveniently applied the bidding curve manipulations to the market data from June to September 2022, the months where the natural gas prices scored the highest and had larger price differences between the Iberian Peninsula and France.

Subsidy Effect
We estimate the effect of the subsidy by comparing the real measures (XBSM model) against the XBM model, where the subsidy was removed, assuming the hypothesis that the cross-border exchange does not change.This hypothesis is largely questionable, as the price difference between Spain and France would possibly be reduced, and there would be a balance between import and export episodes, similar to the situation prior to the subsidy's application.In Figure 11, we plot the effect of the subsidy on the cleared price and energy in the Spanish market.In Figure 11a, we observe that the subsidy caused a price reduction of around 100 EUR/MWh, which was sustained during the 4 months of analysis.The price reduction was larger at the end of August and the beginning of September 2022, more than 150 EUR/MWh, when the gas prices were the highest and so was the subsidy, according to (1).In Figure 11b, we observe that the subsidy induced additional cleared energy, around 2500 MWh, reaching a maximum of around 10,000 MWh extra energy in the last week of August.This additional energy was mostly supplied by gas-fueled energy.This effect has been controversial, first, because the peak of extra energy happened when the gas prices were the highest, and second, due to the increase in emissions, as addressed in [42,43].

Cross-Border Effect
We estimate the effect of the cross-border exchange by comparing the real measures (XBSM model) against the SM model, where we remove the cross-border exchange capacity while keeping the subsidy in place.Again, the hypothesis of unidirectionally exporting energy to France is questionable, given that, prior to the subsidy's application, the crossborder import/export positions were rather balanced.
In Figure 12, we plot the effect of the cross-border exchange on the cleared price and energy in the Spanish market.Here, we observe that the cross-border connection has contributed to an increase in the Spanish market price of about 10 EUR/MWh in the first months of subsidy application and about 25 EUR/MWh since mid-August, partially counteracting the price reduction due to the subsidy.The cross-border exchange also results in additional cleared energy in the Spanish market side, between 1000 and 1500 MWh, further contributing to more energy produced with gas and more emissions.

Surplus & Rents
After calculating the counterfactual cleared prices and energies, we analyze the derived magnitudes in this section: the producers' and consumers' surpluses and the congestion rents from the cross-border exchange between Spain and France.In this section, we focus on the effects induced by the subsidy, while the influence of the cross-border exchange is considered only for calculating the congestion rents.

Producer Surplus
As shown in the previous market models, the subsidy introduces changes in the producers' surplus for both fossil and non-fossil fuel generators.The producers' surplus is also known as the operating or windfall profit.The impact of the subsidy varies significantly across different technologies.We distinguish three cases of surplus: 1.
Non-fossil fuel generators (mostly renewables): these generators observe a significant reduction in profits, which we can calculate as below; recall that P XBSM < P XBM .
Extra-cleared fossil generators: These generators enter the market clearing only because the subsidy is put in place and because the demand is elastic.They are close-tomarginal units, with small profits, calculated as regular surplus.
∆surplus extra− f ossil,XBSM = ∑ q i,extra− f ossil,XBSM • (P XBSM − p bid,i ) Cleared fossil generators without the subsidy (XBM): These generators benefit from an increase in profits, derived from the demand elasticity.We calculate the increase in surplus as follows: In Figure 13, we plot the estimated increase in producers' surplus for each generation type by comparing the real measures (XBSM model) against the model without the subsidy (XBM model).We observe that the subsidy's application has been detrimental to non-fossil fuel producers, with a negative increase in the surplus, averaging −0.73 M€ every hour.Moreover, the combination of subsidy and demand elasticity has resulted in a market clearing with more energy but a market price reduction that is less than the subsidy (P XBM − P XBSM < Y), hence, creating a new surplus for near-marginal units (extrafossil, XBSM), averaging 0.17 M€ every hour.As a result, the infra-marginal fossil fuel producers without the subsidy (fossil, XBM) observe an increase in the surplus, averaging 1.01 M€ every hour, with a single peak above 6 M€ in the last week of August.In terms of surplus balance, we call this phenomenon a transfer of income from renewables to fossil fuel generators.

Consumer Surplus
The subsidy's application induces an increment in the consumer surplus, as shown in Figure 14.We recall that the consumer surplus is sensitive to the buyers' market bidding behavior, not necessarily representing a real profit.The increase in consumer surplus is 2.63 M€ every hour on average, whereas the maximum increase is 5.78 M€ at many hours by the end of August and the beginning of September 2022, with the highest gas prices.

Congestion Rents
The larger price differences between Spain and France induced larger congestion rents, which are plotted in Figure 15a, at an hourly base.Given that the price in Spain remained fairly stable at around 190 EUR/MWh during the period of analysis, the variations in the congestion rents are mostly driven by the volatile prices in France and the use of the cross-border capacities.We recall that the ownership of the cross-border link between Spain and France is divided at 50% for the transmission system operator (TSO) of each country.We plot the congestion rents for one TSO.In the case of the Spanish TSO, the additional congestion rents induced by the subsidy were dedicated to partially financing the cost of the subsidy, as plotted in Figure 3c.According to the model comparison, the extra congestion rents contributed to financing an average of 3.1% of the cost of the subsidy, with daily peaks of contribution, as plotted in Figure 15b.

Conclusions
In this paper, we presented the wholesale market effects induced by the application of the gas subsidy in the Iberian market, starting on 15 June 2022, in the context of rising natural gas prices across Europe.The subsidy aimed to lower the wholesale electricity market price and help moderate the national inflation indices, reflecting the strong relationship between natural gas prices and wholesale electricity market prices.We have restricted our analysis to the period from June to September 2022, inclusive, starting 15 days before the subsidy was implemented.
In order to systematically approach the consequences of the gas subsidy, we mapped the effects into four blocks: 1.
The design of the subsidy and its financing; 2.
The bids of the market participants and the cross-border exchanges; 3.
The actual market clearing; and 4.
The increases in producer and consumer surpluses and congestion rents.
In order to address blocks (1) and ( 2), we tracked the gas subsidy data and the market participants' bids.We noticed that, even though hydropower plants (HPPs) tend to bid similarly to gas generators, during the period of analysis, HPPs in Spain did not contribute to the electricity mix because of the drought.Hence, the electricity system strengthened its dependency on gas generators.Regarding the market buyers, we recall that a few months before the subsidy's application, the bidding price limits were extended and adjusted to the European levels, triggering a significant change, mostly in retailers bidding much higher than 180.3 EUR/MWh, primarily between 400 and 1000 EUR/MWh.Yet, the bidding price of retailers is mostly representative of the necessity of procuring energy for their customers.With the subsidy's application, the cross-border energy exchange was forced in one direction: Spain-to-France.
In order to address blocks (3) and ( 4), we built a set of market models, with and without fossil fuel subsidies and with and without cross-border energy exchange.Moreover, we highlighted the influence of demand elasticity on the effectiveness of the subsidy in lowering the market price.We designed a methodology based on appropriate bid manipulations in order to rebuild the supply and demand curves and simulate the market clearing in different scenarios while respecting, to a large extent, the technical restrictions by extending the cleared bids with the supramarginal bids.
Regarding the market clearing results, after comparing counterfactual scenarios, we observed several effects:

•
The subsidy succeeded in reducing the market price.Consequently, the consumers' surplus increased.

•
The combination of demand elasticity and the subsidy-induced market clearing resulted in extra energy being cleared, which was mostly produced with gas, hence contributing to extra CO 2 emissions.

•
In contrast, the cross-border exchange partially counteracted the price reduction of the subsidy, aiming to reduce the price difference between Spain and France.However, we cannot draw further conclusions from the cross-border influence because the use of the cross-border capacity depends on the estimated price difference between countries, which was already biased by the unilateral subsidy.• Nonetheless, the induced price difference between Spain and France yielded extra congestion rents on the Spanish side, which served to finance around 3.1% of the subsidy.

•
The increase in producers' surplus was uneven, depending on the technology.Nonfossil generators, mostly renewables, suffered a decrease in surplus, whereas fossil generators experienced an increase in surplus.

•
In the fossil generator category, we make a distinction between (a) the generators that would produce energy without the subsidy and (b) the extra generators that were cleared because of the demand elasticity.The demand elasticity reduced the effectiveness of the subsidy in lowering the market price, and consequently, produced an increase in surplus to the generators without the subsidy.

•
The combination of reduced surplus for non-fossil producers and the increased surplus for fossil producers suggests a "transfer of rents" between producers.In practice, considering the context of high gas prices, the transfer of rents effect did not receive much attention because the renewable generators were subject to additional regulations that capped the surplus before the redistribution could effectively happen, as implemented and prolonged in references [44][45][46][47][48].
We summarize the main findings from this paper in Table 3.

Discussion
The implementation of the subsidy generated some controversy for several reasons, which we do not address in the paper.

•
The subsidy is considered a state aid for gas generators.Therefore, the European Commission necessarily limits the length of the policy, even though it helps alleviate the inflation indices.The effects of this policy in the long term are questionable [49].

•
The subsidy in Spain helped lower the price in the French market, which was interpreted as subsidizing foreign electricity [50].Our estimates on the benefits to France (251 M€ in the period 15 June to 30 September 2022), are in line with the estimates from reference [51], which estimated the benefits to French consumers at 576 M€ up to December 2022, hence adding 3 months to the calculations.

•
The subsidy induced a market clearing with a lower price but more cleared energy, mostly generated with gas, at the time when gas prices scored the highest, which seems counterintuitive to economic reasoning and contradictory to the environmental EU agenda [52,53].

•
The discretionary subsidy to marginal technologies, such as CCGT, induced changes in the supply merit order curve, as in the case of the co-generation units, which became supramarginal after the subsidy's application, hence compromising their economic viability [54].

Figure 2 .
Figure 2. Map of elements in the day-ahead market.

Figure 5 .
Figure 5. Retailers, generic units, direct consumers, and HPPs in pumping mode bids (a) on 29 June 2021, at 23 h, before the subsidy, (b) on 29 June 2022, at 23 h, after the subsidy.

Figure 6 .
Figure 6.(a) Prices in France and Spain, (b) hourly traded energy exchange at the day-ahead market [8].

Figure 7 .
Figure 7. Market model without the subsidy.

Figure 8 .
Figure 8. Wholesale market models; (a) with and without the subsidy, elastic demand, (b) with and without the subsidy, inelastic demand.

Figure 9 .
Figure 9. Cross-border energy exchange between Country A (a) and B (b) when with and without gas subsidy in Country A.

Figure 10 .
Figure 10.Summary of market models and bidding curve manipulation for the estimates.

Figure 11 .
Figure 11.Effect of the subsidy on the Spanish market (a) cleared price, (b) cleared energy.

Figure 12 .
Figure 12.Effects of the cross-border exchange on the Spanish market (a) cleared price, (b) cleared energy.

Figure 13 .
Figure 13.Redistribution of producer surplus from non-fossil to fossil fuel producers.

Figure 15 .
Figure 15.(a) Difference in congestion rents with the subsidy and without the subsidy [M€], (b) contribution of the extra Spanish congestion rents to finance the subsidy [%].

Table 1 .
Evolution of the gas price cap P NG,cap [EUR/MWh] during the 12 months of the subsidy.

Table 2 .
Summary of the market models and codes.