The Optimal Mechanism Design of Retail Prices in the Electricity Market for Several Types of Consumers

: In this paper, we discuss the demand side management (DSM) problem: how to incentivize a consumer to equalize the load during the day through price-dependent demand. Traditionally, the retail market offers several electricity payment schemes. A scheme is effective when the different tariffs satisfy different consumers. At the same time, the existing and generally accepted retail pricing schemes can lead to an "adverse selection" problem when all consumers choose the same price, thereby, reducing the possible general welfare. We propose an optimal design of pricing mechanisms, taking into account the interests of the electricity supplier and different types of consumers. The results of our work are that the optimal mechanism is implemented simultaneously for several periods, including the case when the ratio of types of consumers in periods changes. In addition, the mechanism proposed by us, in contrast to the studies of other researchers, provides an equilibrium close to the socially optimal maximum. We describe the implementation algorithm of the mechanism and provide examples of its action in the electric power system with different types and numbers of consumers.


Introduction
The problem of price-dependent consumption in electric power markets has recently acquired particular relevance associated with stimulating the consumer to reduce their load during peak hours and to equalize it with respect to the daily average. These are the well-known demand side management (DSM) problems. Currently, control algorithms are developed to target not only the consumers who have a control reserve of electrical appliances but also the prosumers who either generate their own electricity or have energy storage facilities. In our work, attention will be focused on methods of adopting effective incentives for consumers to optimize their loads [1].
It is known that the allocation of several possible price alternatives for electricity increases the social welfare obtained from the trade. This is a kind of "voluntary" price discrimination, which, as a whole, is beneficial to both society and its individual participants (for example, Ramsey prices [2,3]). At the same time, an increase in social welfare will only occur if consumers "agree" to choose different tariff schemes, formed taking into account the features of the expected load of the consumers. The goal of the present work is to offer efficient pricing schemes for the electricity market. To this end, we use the well-known principles of the mechanism design theory. This is justified by several considerations. In interaction, there is the problem of incomplete information. Here, the electricity supplier cannot know in advance what price the consumer will prefer or what type they will allocate themselves to. The supplier has only assumptions or knows the probabilities of a particular consumer action; therefore, the problem is associated with the correct "identification" of types. The mechanism created should encourage consumers to use a strategy of truthful communication of their preferences through the choice of certain prices intended specifically for them.
The ideas of efficient pricing are not new [4]. They were designed to achieve the highest efficiency in electric power systems and are based on cost minimization while taking into account emissions of CO 2 into the atmosphere [5,6]. Researchers noted that consumers change their behavior over time and become more actively involved in load optimization programs (demand side management, DSM) [7], including via instruments for hedging high price risks [8].
The development of modern pricing schemes in the retail electricity market is directly related to game theory [9]. The new feature of our approach is that we apply the mechanism design theory to determine the individual tariffs of individual consumers or groups of consumers. This requires understanding which parts of the mechanism design theory can be used. Despite the fact that in the retail market consumers do not explicitly form bids and their interaction with the supplier cannot be referred to as an auction, they have an option to choose from several proposed pricing schemes. Thus, the research shifts toward defining an entire price range, so that consumers have incentives to reduce the load at the right time. Such problems require special methods, including those based on the principles of identifying different types of participants and creating optimal mechanisms.
Recently, increasing researchers are addressing demand management issues. Among other things, they are driven by smart grid development, which enables communication with the consumer on the go. The development of online pricing schemes is becoming relevant, which is reflected in a number of works with game-theoretic formulations [10][11][12][13][14][15][16]. Currently, there are several approaches. A number of researchers determined the same price for all consumers, taking into account their strategic behavior [10,12,16].
In this case, an equilibrium similar to the Nash equilibrium is formed. Prices are set with different levels of detail, taking into account the electrical equipment that consumers have [12,17]. Some authors [11] proposed methods of forming incentive prices with elements of optimal contracts where consumers truthfully disclose their usefulness.
They also considered the formation of a single price based on the utility function, which is a combination of individual consumer preferences, and analyzed the behavior strategies of individual consumers as part of an aggregated group. In contrast to the works listed above, we propose the formation of an equilibrium that will be close to the maximum social welfare, i.e., in our case, part of the consumer surplus is not lost. It is important that the pricing mechanism that we offer targets each individual consumer.
In the practice of pricing in the retail electricity market, it is common to offer several types of prices at the same time, assuming that different consumers will choose different prices. However, real markets often have the so-called "adverse selection", when different consumers choose the same tariff [18] and do not participate in incentive programs aimed to optimize the load, such as TOU (time-of-use pricing) [19]. Recently, this problem has attracted attention in connection with the development of communications with an active consumer.
For example, the authors in [20] presented a pricing model (contract design) in the retail electricity market, where there are several types of consumers described by different utility functions. The authors modeled a cost function that did not have the property of decreasing returns to scale. All functions were continuous with respect to time, which greatly complicates the analysis; however, the results can be used as a good theoretical foundation for the further development of pricing mechanisms. Our article proposes a mechanism that solves the adverse selection problem using design mechanism methods. Moreover, this mechanism can be easily implemented into pricing practices.
In [21], the authors discuss optimal contracts in the electricity market under asymmetric information with detailed customer types and examine different possible outcomes for suppliers with different appetites for risk. As in our work, the distortion of equilibrium was shown in the case of asymmetric awareness of market participants about each other.
One of the tasks to be solved in this paper is the representation of the mechanism design problem in the retail electricity market in the form of an optimization problem with a set of constraints describing the specifics of the consumer choice of a certain tariff. In many works, even if the mechanisms or rules of the retail electricity market pricing implement a separating equilibrium, it remains the Nash equilibrium [10,22], which is far from maximum welfare.
Many research works ignore the fact that pricing may help achieve the maximum welfare and stability of the resulting equilibrium when the consumer chooses any of the tariffs offered by the supplier. In contrast to [16], we build a mechanism with an additional motivational condition-Incentive Compatibility, ensuring a stable equilibrium-while the resulting equilibrium will provide the maximum welfare, and all participants will have no incentive to leave.
Our approach combines techniques for creating a convex optimization mechanism. The interaction mechanism we have created will be considered feasible if consumers voluntarily choose incentive tariffs and manage their consumption according to them. This paper is organized as follows. Sections 2 and 3 present a model that implements the optimal pricing mechanism in the retail market. First, in Section 2, we formulate the base problem. Then, we describe the properties of the functions of consumers and suppliers of electricity, as well as the properties of the distribution of consumer types. Then, we provide possible pricing mechanisms and prove the imperfection (instability) of the Incentive Rationality mechanism, which implements the state of maximum social welfare.
Next, in Section 3, the optimal mechanism is formulated in a situation of information asymmetry, and a solution that delivers the separating equilibrium is found. The important result of this part is the proof that the proposed optimal mechanism can be applied if we consider the interaction of players simultaneously in several periods. Moreover, in different periods, the ratio of types may change. In Section 4, we build an algorithm that implements the optimal mechanism design. In Section 5, this algorithm is applied to an electrical power system that consists of two, three, or more consumers. We compare the effect of different pricing schemes and demonstrate the optimality of the proposed algorithm.

Problem
This section describes the problem and forms the model that serves as a basis for building a mechanism for generating electricity prices with incomplete information about consumers. As a result of applying the proposed mechanism, prices will be offered that will stimulate a consumer to reduce the load in peak hours (the DSM problem). Each consumer will truthfully disclose their type by choosing their set of prices and will have no incentive to move to prices that target another consumer. All prices will be formed taking into account electricity production costs. This section lists the main definitions and formulates the theoretical foundations of this particular optimal mechanism.

Consumers, Preferences, and Information
We consider an electric power system that comprises a power supply company and consumers. We focus on the retail market; therefore, we assume that there are no network restrictions. We include the local network maintenance costs into the total maintenance costs of the electric power system.
There are several types of electricity consumers and a finite number consumers who have different preferences from each other as described by the utility function. The consumer has information about their type θ, which belongs to the set θ ∈ Θ; Θ is personal information unknown to the supplier. However, there is a publicly available piece of information, which is a cumulative function of the distribution of consumers by type F(θ) on the set Θ with a continuous positive density f (θ). For simplicity, assume that Θ ≡ [θ, θ].
Consumer preferences are described by the payoff function V(·), which depends on the supply of electricity consumed and the solutions offered on the market. In this case, for the retail electricity market, the set of solutions M is a set of contracts m(θ) ≡ m(S(θ), P(θ)) designed by the electricity supplier. The tariff for each type of θ includes the total consumption S(θ) and the price for the supplied electricity P(θ). The set of possible consumption levels is expressed by the formula Q ∈ R + .
According to existing regulations, electricity is supplied and accounted for at every hour of the day t ∈ T. It has a different price at every moment t of time (hour of the day). In this regard, the utility function of the consumer depends on t but is not continuous with respect to t. T can be equal to [1, . . . , 24] by the number of hours in a day or to [I, I I, I I I] by the number of time zones during the day.
Let m(θ) ∈ M be the effective tariffs m(θ) offered by the electricity supplier. These tariffs are generated for each type of consumer. The consumer of type θ pays the sum p(t, θ) per hour t for the supply q(t, θ) of electricity.
The consumer has the following strategies: 1. Truthfully inform the supplier about their type. Then, they choose the tariff m(θ) and, in the period t ∈ T, obtain the following payoff: whereas the total payoff will be 2. Pretend to be any other typeθ and choose the tariff m θ obtaining in time T the payoff V m θ , θ ≡ ∑ t∈T u t, q t,θ , θ − p t,θ . ( The payoff function V(m(θ), θ) has standard regularity properties that can be justified by generally accepted ideas about the demand for the service [23].
Conjecture. The function u(t, q(t, θ), θ) is concave downward with respect to the consumption q(t, θ), increasing and three times differentiable with respect to q(t, θ) for any pair (t, q) ∈ T × Q.
This means that we have a decrease in the marginal utility of the product. The second condition will be the following [24]: Conjecture. The Spence-Mirrlees condition has the form This condition determines the ratio of utilities of different types of consumers: with an increase in the type of consumer, the marginal utility of a unit of the consumed product also increases. The Spence-Mirrlees condition is called a single-crossing condition.
In addition, the following boundary conditions are fulfilled for the utility function: Conjecture. The utility function u(t, q(t, θ), θ) is separable with respect to t.
This condition makes it easier to solve the problem of finding the optimal mechanism when considering dependencies in individual periods.
Finally, the distribution of consumer types satisfies the following property: is non-decreasing.
This property is associated with the lack of aftereffect, when the probability of an event (for any type of consumer) in any interval does not depend on whether the event occurred before. In this case, the conditional probability of an event is equal to the unconditional one. These properties are possessed by a number of distributions, including uniform and exponential. This property is important for describing consumers and determines the independence of the consumer types from each other giving a way to forming optimal mechanisms [25]. The type allocation information is available to all consumers and to the electricity supplier.

Electricity Supplier
The electricity supplier is described by the standard cost function C(t, Q), where Q t = θ θ q(t, s) f (s)ds is the total volume of electricity supplied to all consumers θ ∈ [θ, θ] in period ∀t ∈ T.
Conjecture. C(t, Q) is a strictly increasing convex function with respect to q: (7) The function C(t, Q) is infinitely continuously differentiable with respect to Q, C (t, Q) ≡ dC/dQ are the marginal costs defined for each time period t ∈ T.

Definitions
To form an optimal mechanism, it is necessary to use motivational compatibilities [26,27]. Definition 1 (Incentive Compatibility mechanism). The mechanism m(θ) is an Incentive Compatibility (IC) for the consumer i if: In this case, the formation of such a mechanism gives the consumer of type θ an incentive to disclose their type and choose a tariff designed for them. Definition 2 (Incentive Rationality mechanism). The mechanism m(θ) is the Incentive Rationality (IR) for the consumer i if: The constant k is the alternative level of utility that the consumer will receive if they do not resort to the services of the electricity supplier [28]. For example, consumers may obtain electricity from their own sources. Without a loss of generality, in what follows, k = 0. This can always be achieved by normalizing the base alternative level.
The equilibrium in dominant strategies means that the mechanism m(θ) is only realized in strategies that are optimal for each player independently of the actions of other players.

Definition 4 (Revelation Principle). The Revelation Principle for Dominant
Strategies: the mechanism m(θ) implements the players' choice in Dominant Strategies. This is the mechanism of the Incentive Compatibility.
This principle determines the type of problem where the solution yields the optimal mechanism. In this case, the problem is reduced to a mathematical programming problem.

Pricing Optimization Problems and Possible Stimulating Mechanisms
The problem is determined by the monopoly position of the electricity supplier in the retail market, as well as by imperfect information and several types of consumers. The electricity supplier should develop a profit-maximizing pricing and distribution strategy with incomplete information about individuals and the aggregate consumer demand for electricity.
Consumers are a sample of the population. The electricity supplier may not have the information about the exact characteristics of the consumer types and what type they belong to. General information is an aggregate distribution of consumers by types F(θ). Based on this, the electricity supplier determines the mathematical expectation of profit.
The supplier's profit is described as the difference in revenue from the supply of electricity to several consumers and the electricity purchase and transfer costs. The company maximizes the following function: where f (θ) is the distribution function density of all consumers F(θ). The problem domain is described through the constraints of the individual rationality of each consumer (10) in a positive orthant: if the consumer does not receive a utility greater than the alternative one, then they will not take part in the exchange of benefits. For the electric power industry, this might imply that the consumer builds their own "alternative power station" to receive the same amount of electricity. In our problem statement, we consider the case where, when it is necessary to satisfy all consumers, the domain of types of consumers Θ is a segment to which all types belong: θ ∈ [θ, θ].
Further, we consider possible pricing mechanisms. We assume that consumers (participants) will identify their type by choosing their contract (price and supply). We will determine the optimal mechanism in the sense of truthful identification of the consumer types, provided that the participants strives to maximize their profit. Theoretically, it is possible to allow all bidders to report their estimates (supplies and prices) and to develop optimal mechanisms based on this shared knowledge. However, we need to introduce some automated mechanisms that take into account the possible asymmetry of information in advance and have restrictions on the input data. Our approach develops a mechanism using a convex optimization.
The first mechanism that we consider satisfies the property of Incentive Rationality. We determine it through (10). This mechanism is not optimal because its pricing will lead to the adverse selection effects and, as a result, consumers will choose the same price. This mechanism does not detect consumer types and does not yield a separating equilibrium.

Proposition 1.
Given an estimated distribution F(θ), the mechanism of Incentive Rationality is an optimal solution to the problem: it is subject to the restrictions and does not provide a separating equilibrium.
Proof. The proof will be in two parts. The first part proves that the prices generated by the mechanism will meet the constraint (14) in the form of equality. The second part supports that consumers will choose the same price from the generated prices (there will be no separating equilibrium and the mechanism will not correctly identify the types of consumers). The proofs are detailed for pricing that does not depend on the prices in other periods. This is the case when the price function is not continuous with respect to time.
For the electric power industry, this approach is relevant, as it coincides with the principles of tariff pricing. Consider two types of consumers ∀θ,θ ∈ Θ. Let the consumer θ be of a higher type thanθ. The latter means that the utility from the same electricity supply q for the consumer θ will be higher than that for the consumerθ.
1. If the supplier quotes prices in accordance with the mechanism (13) and (14), then, for each typeθ in each period t ∈ T, we have: We assume that this is not true, and u t, q t,θ ,θ > p t,θ or u t, q t,θ ,θ − p t,θ = . In this case, the supplier may lower p t,θ by and the consumer of typeθ will continue to participate, since the condition (14) is satisfied. Therefore, the price will be expressed by (16). A similar reasoning is justified for the pricing for the type θ. Such pricing ensures that the profit of the consumers V(m(θ), θ) = 0 V m θ ,θ = 0 is zero (or, is equal to the alternative utility that the consumer obtains by not participating in the market). If the conditions satisfy IR in each period ∀t ∈ T, then the condition (14) is also satisfied.
2. The Spence-Mirrlees condition (4) implies that, for each type θ in each period t ∈ T, we have u t, q t,θ , θ ≥ u t, q t,θ ,θ , We obtain that, for the consumer θ of higher type, the choice of someone else's contract p t,θ yields the profit v t, m θ , θ ≥ 0, which is larger than if they chose their own contract p(t, θ) where u(t, q(t, θ), θ) − p(t, θ) = 0. Therefore, we arrive at the mixing equilibrium.
The mixing equilibrium is dominated by the separating one in the sense of increasing social welfare. This implies price discrimination, which, in contrast to quoting a single price, increases the total generated surplus [23]. Moreover, if a higher type of consumers chooses a contract with low pricing, then the electricity supplier also loses some of the additional profit that it may obtain by quoting higher prices to the consumer with higher utility.
This mechanism has its advantages. When implementing it, a maximum social welfare is achieved, since the fulfillment of the conditions (14) in the form (16) for all periods ∀t ∈ T predetermines the function (13) as the sum of utilities of all consumers and profits: The examples below will have calculations illustrating this mechanism.
The second Incentive Compatibility (9) mechanism defines the contract m(θ), which provides the best profit for the consumer θ compared to all other contracts m θ . This mechanism implements the dominant strategy. If (11) is satisfied, then One of the possible equilibria obtained in the dominant strategies is the Nash equilibrium. If the utility functions of all participants are concave with respect to q(·) (Here, it is assumed that the company also has a concave profit (utility) function, so its costs C(·) are convex and participate in π(·) with a negative sign.), there exists a unique Nash equilibrium [29], while the resulting equilibrium is different from the maximum social welfare (This is described in more detail in Section 2.1). Our goal is to form a mechanism that ensures the best approximation of the solution to the optimal social welfare, whereas the solution should satisfy (9).

Definition of the Optimal Mechanism
Let us formulate the optimal mechanism in accordance with the principles presented in the works of Gurvich, Muskin, and Myerson [30]. In our case, it was necessary to obtain a separating equilibrium, where each consumer will choose their contract, while disclosing their type through the choice of certain electricity prices. If we consider the mechanism where the consumers use their dominant strategies that yield the expected results, i.e., the subordinate relation (11), then the mechanism will conform to the Revelation Principle (defined in 1.3) [31]. This principle ensures truthful identification of the consumer type.
According to the Gibbard-Satterthwaite theorem (or the Dictator Theorem) [31], the realization in dominant strategies for more than three players is possible only if one of the players is a dictator. In our case, the electricity supplier is a dictator, while its actions in setting tariffs within the framework of mechanism design are regulated by the state. Then, the optimal mechanism is implemented by the electricity supplier by setting prices. In contrast to the Nash equilibrium, the result obtained will be close to the maximum social welfare.
If there exist dominant strategies, then there are strong predictions about how the players will act. However, the strong properties required for such strategies limit the set of situations in which they exist. In our case, the existence of dominant strategies is provided by the properties that we demanded from the consumer's utility functions. When setting electricity prices, a winning strategy for the consumer (choosing one of the tariffs) should provide a cost lower than any other. Therefore, it is necessary to develop a mechanism in the dominant strategies with the requirement of Incentive Compatibility [31].
Proposition 2. (i) The optimal mechanism for pricing and determining the supply of electricity in the dominant strategies (19)-(22) implements a separating equilibrium where the participants truthfully disclose their types. (ii) If the solution satisfies the conditions IR and IC in each period ∀t ∈ T, then it will generally satisfy the conditions of the optimal mechanism (20) and (21).
Proof. The proof consists of two parts. In the first part, several important facts about the IC and IR conditions for higher and lower types are proven, and the form of the separating equilibrium is determined as a ratio of utilities of different types and consumption volumes. All this is given for some t ∈ T. The second part shows that if, for each t ∈ T, we can determine the fulfillment of the IC and IR conditions, then we can build an optimal mechanism in which the conditions as a whole (20) and (21) are satisfied for each type. 1. Consider two types of consumers: ∀θ,θ ∈ Θ. Let θ be a higher type andθ be a lower type for some t ∈ T . In this case, (4) is satisfied and u(t, q(·), θ) ≥ u t, q(·),θ . We assume that (21) is fulfilled for t ∈ T. We have These inequalities duplicate the Incentive Rationality conditions for the higher type θ. This means that the mechanism should satisfy the Incentive Rationality (20) for t ∈ T only for the lower typeθ. We consider this condition. Let u t, q t,θ ,θ > p t,θ and u t, q t,θ ,θ − p t,θ = . In this case, the supplier may reduce p t,θ by , whereas the consumerθ will still participate, because the Condition (21) is satisfied in t ∈ T. Therefore, the price p t,θ will be precisely equal to the consumer utility: the Incentive Rationality for the lower type is fulfilled as an equality in t ∈ T. Now, we join the Incentive Compatibility conditions for the higher and lower type in the period t ∈ T. We obtain u(t, q(t, θ), θ) − u t, q t,θ , θ ≥ p(t, θ) − p t,θ ≥ u t, q(t, θ),θ − u t, q t,θ ,θ . (24) It follows from this inequality, the Spence-Mirrlees Conditions (4) and (5), and the increasing utility function (3) that q(t, θ) ≥ q t,θ . Additionally, it follows that one of the inequalities in (24) is strict.
Let the first inequality defined via the IC for the higher type θ be strict. Then, if the supplier raises the price p(t, θ) for the higher type θ by , then the supplier's profit increases without affecting the fulfillment of IC for θ At the same time, such a price change will not affect the fulfillment of the second part of the inequality (24). The supplier will raise the contract price until the moment when the IC condition is fulfilled as an equality. Thus, the IC condition for the higher type θ is fulfilled as an equality, and for the lower typeθ as a strict inequality. We have two active constraints in the period t ∈ T: 2. Consider any two types of consumers ∀θ,θ ∈ Θ. For each period, we define a sequence of consumer types, which may not coincide between the periods t 1 , t 2 ∈ T. Then, consider possible solutions for each t 1 , t 2 ∈ T. If the typeθ ∈ Θ in a certain period t 1 belongs to the lowest type, then the IR is fulfilled for it as an equality and the IC as a strict inequality (as proved above). Then, θ ∈ Θ, u t 1 , q t 1 ,θ ,θ − p t 1 ,θ = 0; u t 1 , q t 1 ,θ ,θ − p t 1 ,θ > u t 1 , q(t 1 , θ),θ − p(t 1 , θ).
We continue this process for all ∀t ∈ T. Then, considering the entire interval T, the consumer of typeθ has the relations from (25)- (28): Therefore, they satisfy the detection conditions in the optimal mechanism of dominant strategies. Figure 1 shows an illustration of what can happen when consumers choose prices. If contracts of Point 1 for higher type and point 2 for lower type are offered, then a mixing equilibrium will be formed, since the higher type tends to choose a contract at Point 2. If the mechanism proposes contracts 3 and 2 for higher and lower types, respectively, then a separating equilibrium will be achieved. The solution is generated in detail for each period ∀t ∈ T. The approach to solving the problem for each period is relevant for the power industry, where there are particular characteristics of load schedules. If we compare the graph of household consumers and, for example, small industrial enterprises, we may face the following situation. In the evening, the utility of a unit of electricity to households is much greater than that of a unit of electricity to small businesses. The opposite situation is observed in the daytime. Examples of graphs can be seen in Figure 2.

Optimal Mechanism Solution
The optimal mechanism (19)- (21) is represented in the form of an optimization probelm. Let us define the type of solution [23]. To this end, we use a technique from the mechanism design to find the optimal m(θ). First, we consider the restrictions for the problem (20) and (21), which, for each θ, we take the following forms in the period ∀t ∈ T: v(t, m(θ), θ) ≥ 0; (IR) The functions v t, m θ , θ attain the maximum in the point θ if the following conditions are satisfied: FOC ∂v(t,m(θ),θ) ∂θ = 0, and SOC We write these in detail for the pointθ = θ. FOC: and SOC: Since all these conditions may be fulfilled for all θ ∈ [θ, θ], we differentiate the first condition with respect to θ in ∀t ∈ T.
We find the cost of electricity for the consumer in the period ∀t ∈ T. Consider the consumer's surplus in terms of θ. It will be equal to SR(t, θ) = v(t, m(θ), θ). The first order condition of maximizing the surplus with respect to θ takes the form Taking (31) into account, we have By integrating the latter equality, we derive that the payoff of the consumer in the equilibrium, depending on the type θ in each period ∀t ∈ T, is equal to SR(t, θ) = θ θ u θ (t, q(t, s), s)ds. SR(t, θ) increases with respect to θ due to dq(t,θ) dθ > 0 (4). The consumer's surplus caused by choosing the lowest type is equal to SR(θ) = 0.
Define the cost of electricity paid by the supplier's consumer p(t, θ) = u(t, q(t, θ), θ) − SR(t, θ). Substitute the following expression into the profit function problem where the solution yields the optimal mechanism has the form We use the Lagrange method and consider the case of the strictly increasing function q(t, θ). We have that the constraint (35) is inactive and it is a sufficient find for each period ∀t ∈ T a solution to H(t, θ) = 0. The solution is defined by the system of equations [28].
For each type, the solution is unique due to the conditions (3), (6), (7), (8) and the condition dq(t,θ) dθ > 0, ∀t ∈ T. The highest type that has this obtains the largest supply among all consumers and, for which, F(θ) = 1 obtains an optimal contract, where u q (t, q(t, θ), θ) = C t, Q t .
The solution for all other types that do not match the higher type will provide supplies smaller than the optimal one. Moreover, the lower the type of consumer, the more the value will be subtracted in (36), since the function Thus, a dividing equilibrium is formed. Each type of consumer obtains a contract that satisfies the constraints (20) and (21). In this case, the lowest type has zero surplus, and the highest type receives the optimal contract. This section describes the optimal mechanism that is able to identify truthful consumer strategies, create pricing that covers the supplier's costs and find a dividing equilibrium in the retail electricity market. The next section describes a price search algorithm that excludes adverse selection and uses the optimization problem (19) and (22).

The Problem of Using the Nash Equilibrium Prices and the Maximum Social Welfare
The optimal mechanism developed above is based on the dominant strategies of the participants with additional restrictions on participation. As a result, a separating equilibrium is achieved. However, will the proposed the mechanism be better than the well-known Nash equilibrium or the search for the maximum social welfare [13]? In this case, not only is the resulting solution important but also the timing of the pricing. Consumers are offered a list of tariffs from which they choose the one that suits them best in taking into account the expected load.
Let us briefly consider the results that can be obtained under these conditions during the formation of the Nash equilibrium and the maximum of social welfare. Then, we will use an example to compare the obtained outcomes with the solution delivered by the optical mechanism .
1. Nash Equilibrium. The model forms the Nash equilibrium under conditions of complete information, and the mechanism is applied in dominant strategies. The problem that each consumer θ will solve has the form Without a loss of generality, assume that p(t, θ) = q(t, θ) · τ(t, θ), where τ(t, θ) is a price per unit of electricity offered to the consumer θ in the period ∀t ∈ T. Then, in the equilibrium point, we have that, at the equilibrium point, the consumer has the FOC of maximizing their utility satisfied: u q (t, q(t, θ), θ) = τ(t, θ) (The maximum will be unique since the utility function u(t, q(t, θ), θ) is concave.). To find the Nash equilibrium, we must solve the following problem: The created equilibrium provides different prices for consumers maximizing their utility and ensuring the supplier's profit. In the equilibrium point, the supplies satisfy where r u (t, θ) is a characteristic of the utility and demand function, which affects the distortion of the resulting solution with respect to the maximum social welfare. On the other hand, the problem (38) can be formulated through the definition of the Nash equilibrium, where the winning strategy for the consumer θ ∈ Θ at the moment t ∈ T is the strategy of choosing such q(t, θ), p(t, θ) that u(t, q(t, θ), θ) − p(t, θ) ≥ u t, q t,θ , θ − p t,θ .
This corresponds to the fulfillment of the Incentive Compatibility condition in the mechanism (9). Despite the fact that we form a separating equilibrium in which no one is interested in leaving, this equilibrium provides a solution that is far from the socially optimal one. Later, we will illustrate this by an example.
2. The model for maximizing social welfare.
where p(t, θ) = τ(t, θ) · q(θ, t) is the revenue from each consumer θ in the period t ∈ T. The solution is pricing in accordance with the FOC of the problem (41): In the context of imperfect information, it turns out to be advantageous for consumers with a higher utility to choose a contract where the prices will correspond to the lower type utility, since, in this case, when (42) is fulfilled, they will be able to choose larger supplies than within their own contract. Therefore, the mechanism of Incentive Rationality or Max Welfare is not applicable in practice because it does not provide a separating equilibrium (Proposition 1) and, therefore, a social maximum.
The next paragraph describes the algorithm for applying the optimal mechanism, which will be implemented by each consumer to choose their contract while the maximum social welfare is achieved.

The
Step-By-Step Algorithm of Optimal Pricing Step 1. The input data is the characteristics of the electric power system, which includes the load curves of all consumers incorporated into the power system, and the characteristics of the supplier's costs. Based on the average consumption for each user, the characteristics of the utility functions (or elastic demand) in different time periods are restored.
Step 3. Based on the sorted levels of consumer types, active restrictions are determined in accordance with Proposition 2: for the lowest type, the participation restriction (20) will be active, and, for the rest, the consistency restrictions will be by type with respect to the contract of the previous consumer type (21).
Step 4. Solve the optimization problem (19)- (22) and obtain the optimal contract. The next section provides an example of the optimal pricing mechanism for the electric power system.

Data. Initializing the Cost and Utility Functions
Step 1. We used the data on real loads of several consumers of different types. All consumers belong to the same category with a load below 670 kW and a low voltage level. Load curves, which are taken as a basis, represent an estimate of the mathematical expectation for the consumption per month (December 2109) for several different consumers. These loads were recorded under a Flat tariff (constant prices during the day) that was used to restore the supplier's cost function. All prices are given in Russian rubles and correspond to Russian prices as of December 2019. For the sake of generality, we may assume that these are conventional units. Several types of consumers are analyzed: • a dormitory with a load schedule similar to that of ordinary households (Consumer one), • a small business that only operates during the day (Consumer 2), and • several households with a low load (Consumer 3).
The total load changes insignificantly. The experiment will focus on redistributing the shares of different types of consumers, as well as on increasing the number of individual households within the same (approximate) total consumption. Figures 3 and 4, Table A1 in Appendix A show the initial average loads of Consumer 1 (θ 1 ) and Consumer 2 (θ 2 ).  The supplier's costs are defined as quadratic C(Q t ) = d · Q t + c 2 Q t . They have the same characteristics d, c in all periods t ∈ T. If necessary, these coefficients can be varied depending on time. For the current example, d = 4, 5, c = 0.01.
The first stage implies initialization of the consumer utility functions based on real consumption for a Flat tariff. Electricity demand is traditionally described as linear functions with low elasticity.
This function satisfies the properties (3)-(5): r u (z) = r u (z) = 0. More precisely, (44) Figure 2 shows indifference curves of the utility functions for consumers of different types in a certain period of time. They satisfy the Spence-Mirrlees single crossing conditions (4) and (5). Having the initial hourly load and pricing data and assuming that the consumer θ maximizes their income v(t, m(θ), θ) under these conditions (flat tariff, which, in this case, was 6.08 rubles), we can restore the main characteristics of the utility function (44). For Consumers 1 and 2, γ = 0.011, θ t , t ∈ T vary. The results of evaluating the characteristics of utility for some periods are presented in Table 1. These characteristics are recalculated every time the composition of consumers changes, since the price depending on the total volume of consumption also changes. 6.1 6.1 6.1 6.2 7.0 7.0 7.0 6.9 6.9 6.9 6.7 6.6

Comparison of Different Pricing Schemes
Step 2. In this part, we will compare pricing schemes based on the Nash equilibrium principle and the maximization of social welfare (Incentive Rationality mechanism), taking into account imperfect information (optimal mechanism). Let us solve two problems for the data presented in Section 3.1: • finding the Nash equilibrium (38) and (39), • social welfare maximization (41). Solving this problem corresponds to the application of the mechanism with Incentive Rationality and a solution to the problem (13)- (15).
Step 3. Based on the Incentive Rationality mechanism, we define the higher type of consumer and then form and solve (Step 4): • problem (19)- (22) implementing the optical mechanism.
All pricing schemes that were formed as a result of solving these problems stimulate a reduction of the load during peak hours and align the schedule with respect to the average. The loads adjusted with respect to the initial state ( Figure 3) are shown in Figures 5a-7a, whereas the prices are given in Figures 5b-7b. The general characteristics of the results obtained can be seen in Table 2. All results are given in rubles. Profits and the consumer surplus are calculated by month. For comparison, the Table 2 in the first column shows the results for a Flat rate. The pricing in all models is done in accordance with the incentive principle: the higher the consumption, the higher the price. This corresponds to the costs that grow with increasing consumption.

May 18, 2021 submitted to Journal Not Specified 17 of 24
Step 3. Based on the Incentive Rationality mechanism, define the higher type of con the results obtained can be seen in Table 2. All results are given in rubles. Profits and 571 the consumer surplus are calculated by month. For comparison, the Table 2 in the first 572 column shows the results for a Flat rate.

574
The pricing in all models is done in accordance with the incentive principle: the 575 higher the consumption, the higher the price. It corresponds to the costs that grow with 576 increasing consumption.  Figure 7. The optimal mechanism pricing. The optimal load (a) and prices (b). 579 Figure 7. The optimal mechanism pricing. The optimal load (a) and prices (b).
Here, V(m(θ), θ) = V 1 m θ 1 , θ 1 + V 2 m θ 2 , θ 2 , and each consumer θ i chooses their contract m θ i , i ∈ {1, 2}. V 1 m θ 2 , θ 1 is the revenue of the consumer θ 1 due to selecting the contract m θ 2 of the consumer θ 2 . The calculation results in the "Nash" and "Max Welfare" columns are carried out under the conditions of complete information, where the contract of the consumer θ 1 is used to calculate the prices of the contract of the consumer θ 2 only in terms of changes in the total marginal costs. After calculating the prices according to the "Nash" and "Max Welfare" rules (Table 2), the consumers are ranked in accordance with Step 2: -using the model of "Max Welfare", compare the profit of the consumer θ 1 ensured by their own contract m θ 1 (the profit is 922 rub.) with the profit delivered by choosing the contract of the consumer m θ 1 (the profit is 1163 rub.). Therefore, the strategy of the consumer θ 1 is to choose someone else's contract. The pricing in the "Nash" model does not give an incentive to switch to someone else's contract, however, the consumer payoff in the "Nash" model is smaller than that in the model of "Max Welfare"; -similarly, consider actions of the consumer θ 2 in the "Max Welfare" model. If θ 2 chooses their own contract, it yields the profit of 981 rub.. However, if θ 2 chooses the contract of θ 1 , the profit is 731 rub.. Therefore, the strategy of θ 2 is to choose their own contract. The "Nash" model delivers the same result.
In the case considered above, the consumer θ 1 is of higher type and has the Incentive Compatibility as an active constraint, while the consumer θ 2 is constrained by the Incentive Rationality (20) (Step 3) (Here, we do not provide the details of ranking consumers for each of the periods t ∈ T. We carry this out when solving problems, but only give its aggregated version here.). Now, the optimization problem for creating the optimal mechanism is formulated and its solution is presented in the column "Opt mechanism". Analysis of the results. 1. The most effective pricing mechanism is the one that maximizes social welfare (line V(m(θ), θ) + π(m(θ))). Here, V(m(θ), θ) = V 1 m θ 1 , θ 1 + V 2 m θ 2 , θ 2 , and it is assumed that each consumer chooses their own contract.
2. The Nash equilibrium delivers the largest profit to the supplier. The maximum social welfare pricing reduces profits, partially redistributing the surplus of the supplier in favor of the consumers. This effect is further enhanced when prices are set according to the optimal mechanism (line π(m(θ))).
3. The "Nash" mechanism implements an equilibrium that is stable in terms of the incentive to choose one's contract, since the basic principle of its formation is the Incentive Compatibility condition. On the other hand, the resulting equilibrium differs significantly from the social maximum, especially in the case of a low elasticity of demand. (As is well-known, the demand for electricity has a low elasticity, which is defined in our model through a high marginal utility. As a result, the Nash equilibrium prices appear to be higher than the marginal cost by a significant amount due to the parameter r u (t, θ).) This is what makes the "Nash" pricing model faulty.
4. The "Max Welfare" pricing model is not feasible in practice. The contracts it designs do not satisfy all consumers. Only the low type will choose their contract. It will be beneficial for a higher type to adhere to the contract of another consumer. 5. The optimal mechanism "Opt Mechanism" forms stable contracts in the sense that the consumer chooses "their own" contract. Table 2 shows that the profit ensured by choosing their own contract (truthfully declaring their own type) is higher than when choosing someone else's contract (for θ 1 V 1 m θ 1 , θ 1 = 1067 ≥ V 1 m θ 2 , θ 1 = 982 and similarly for θ 2 ).
6. Due to the asymmetry of information in the optimal mechanism, social welfare is partially lost in comparison with the "Max Welfare". Pricing is efficiently done for the higher type consumers, and the lower type loses some of their profit in their favor. This is clearly seen from the last two rows of Table 2. Here, we have the indicators of the mismatch between marginal costs and marginal utilities. For "Max Welfare", the marginal utility Mu θ i = ∑ t∈T u t, q t, θ i , θ i is equal to the marginal cost MC = ∑ t∈T C (Q t ). This does not happen in the optimal mechanism. 7. The optimal mechanism is as close as possible to the solution that delivers the maximum social welfare.

Features of Optimal Contracts for Various Configurations of the Electric Power Systems
This part discusses several examples of different consumer compositions. In the first paragraph, there are two consumers, but of different sizes. This is different from the previous example, where the total load was approximately equal throughout the day. The second case considers three consumers, each assigned to their contract. The third case focuses on the situation with many small consumers.

Two Consumers of Different Sizes
We consider consumers with the same load configurations as before. The difference is that Consumer 1 is now larger and accounts for about 60% of the aggregated load, and Consumer 2 is, respectively, smaller. Figure 8 shows the load graphs optimized by the optimal mechanism. Figure 9 demonstrates the effect that such pricing has on the system as a whole. It also shows the aggregated load before and after applying incentive pricing. For the given example, the scatter was calculated with respect to the day average. The use of incentive prices for several consumers at the same time can reduce the the scatter around the average up to 32% for the given conditions. Next, we present the results of numerical modeling of the equilibrium parameters when Consumer 1 (higher type) shifts from 0.5 to 0.9. Figures 10 and 11 show the changes in the supplier's profit, social welfare, consumer surplus for Consumers 1 and 2. A complete table of values is given in Appendix A Table A2.

Assigning Contracts to Three Different Consumers of the Power System
We considered a system that has three consumers of different supply. The graph of Consumer 3 represents a typical household load. Using the algorithm given in Section 2.2, we determined the optimal loads and prices for each of the consumers. Figures 12 and 13 show the main characteristics of the equilibrium obtained by the two models in comparison with the initial Flat tariff. Figure 12. Chart of the load and prices before and after applying maximizing welfare pricing ("Max Welfare"). Figure 13. Chart of the load and prices before and after applying the optimal mechanism ("Opt mechanism"). Table 3 summarizes the general equilibrium characteristics for the optimal mechanism. Price 1 denotes the prices offered to Consumer 1. It can be seen that consumers choose their own prices as the consumer surplus is maximal. For comparison, Table 4 shows the results of calculations according to the welfare maximum model, where we have a mixing equilibrium, since it is profitable for Consumers 1 and 2 to switch to the contract of Consumer 3. In addition, if the prices of Consumer 3 are unavailable, Consumer 1 chooses the contract of Consumer 2.
By reacting to prices, electricity users regulate their load. For the given conditions, price-dependent optimization of the load by consumers decreases the variation in the electricity consumption with respect to the daily average by 16%. This is less than for two consumers, and is associated with the characteristics of the load of individual users. The examples given above demonstrated the effectiveness of the proposed mechanism with two or three types of consumers. If we introduce more prices in the market, this will cause confusion for consumers and, therefore, such a situation is not considered here. At the same time, if the promising pricing schemes embedded in smart grid systems target individual consumers, then the proposed approach may also be relevant.
In our study, testing was carried out with a large number of users and two pricing schemes. We considered from 10 to 60 consumers that were divided into two types. We obtained regularities similar to Section 5.3.1. The higher the type of consumers, the larger the supplier's profit and the consumer surplus. The proposed optimal mechanism also proved to be effective, confirming possible scaling to any number of participants.

Conclusions
Electricity markets are actively regulated by the state as power supply systems are critical infrastructures for the economy and life. Therefore, price regulation methods are aimed at maximizing social welfare. This paper discusses the pricing method driven by welfare maximization models and reveals its inconsistency. We demonstrated that, in this case, there was a mixed equilibrium where all consumers tended to choose the same prices. As a result, the maximum social welfare was not achieved and the incentives to optimize the consumer's load were reduced.
We propose an optimal mechanism based on the fulfillment of the Incentive Rationality and Incentive Compatibility conditions. We used this mechanism to set prices, and, as a result, we obtained a separating equilibrium, when each consumer was inclined to choose their own prices. The solution obtained was close to the maximum welfare. This also enabled optimization of the load schedule of the electric power system, which leads to more effective functioning (the scatter is reduced with respect to the daily average, and pronounced peaks are smoothed out). This is what constitutes the novelty and relevance of our study, which is in contrast to the available publications that propose to determine tariffs in accordance with the Nash equilibrium, as a result of which, a significant part of the social welfare is lost.
To formalize the model, a number of statements were proven. One of the key statements is the proposition that it is possible to use the Incentive Compatibility condition in certain periods to build a pricing mechanism for several periods. This will ensure the fulfillment of the Incentive Compatibility condition, which is crucial for the optimal mechanism during the entire time interval considered. The proposed mechanism will also work in a situation where, in one period of time, the first consumer receives a utility from a unit of electricity that is higher than the second consumer, and, in another period, they change roles. Then, the consumer types are not transitive with respect to each other over time.
The mechanism was demonstrated on various configurations of a multi-consumer power system. We compared pricing schemes according to the Nash, the maximum social welfare, and our mechanism. We demonstrated the effectiveness of the "Opt Mechanism" when compared to other schemes.
The use of smart meters enables the regulation of prices and consumption on the go. Electricity supply companies can use the proposed pricing mechanism in real-life problems. The mechanism is quite straightforward for implementation. and it will work successfully when planning for a day that is a week in advance, through providing incentives for the consumer to correctly disclose their types and optimize the load, which will ensure the effectiveness of the pricing scheme for the entire power system. To develop the current task, we propose to study the issues of dividing a large number of consumers into several consistent groups for the optimal formation of the load schedule. In this study, this issue was resolved for individual consumers; the transition to a group is associated with additional difficulties in the formation of an aggregated utility function that will not violate the incentives for individual players to be in it.