Implementing Contract-for-Difference Arrangements for Hedging Electricity Price Risks of Renewable Generators on a Blockchain Marketplace

The dynamic nature of competitive electricity markets means that participants often resort to some form of derivative financial instrument. One such instrument is a contract-for-difference (CFD), usually available to renewable generators in certain electricity markets to enable them to hedge their price risk. Embracing CFD presents new risks such as counterparty credit, margining, third-party, legal, and process risks. Derivative instruments existing on blockchains have recently demonstrated potential as suitable hedging tools for minimizing the risks of renewable generators. This article applies this concept for the first time to hedge the price risk of renewable generators by implementing a novel decentralized finance instrument, an Ethereum blockchain marketplace governed by a smart contract to mediate between stakeholders mutually enrolled in bilateral CFD arrangements. The employed structure mitigates the underlying risks of traditional arrangements, underpinned by a suite of autonomous mechanisms.


I. INTRODUCTION
T HE physical electricity market is the primary revenue stream for electricity generators (renewables and nonrenewables) participating in pure competitive electricity markets, as shown in Fig. 1. These generators physically deliver power to offtakers, including homes, businesses, and industries, through the central transmission system. In return, they receive revenue from these offtakers through the pool market operator, proportional to the product of the electricity volume supplied and the uniform clearing price for the trading period [1]. These spot prices are formed by supply (from generators) and demand (by offtakers) but are highly volatile because of the unique physical characteristics of electricity compared to other commodities [2]. Some of the main reasons for these volatile prices are due to an increasing grid connection of variable renewable electricity [3] and the short-term inelasticity of demand since electricity cannot be easily substituted like other commodities [4]. In fully regulated markets, such price dynamics are not borne by the generators, as they usually sell electricity to the market operator at a fixed price through long-term power purchase agreements. However, in pure competitive electricity markets, these participants shoulder these burdens [5].
Renewable generators are even more vulnerable to volatile prices than conventional plants, especially in electricity markets with significant shares of renewables, such as Germany and Ireland. In these markets, spot prices are usually higher when renewable generators underperform and lower when they overperform [6]. This price risk could result in depressed revenues, disincentivizing traditional risk-averse financiers from investing in such projects. For this reason, a range of derivative instruments in the financial market for electricity exist to hedge the cash flows of renewable generators in parallel to the physical market [2]. These derivatives are typically traded over the counter (OTC), directly between two bilateral parties or on exchanges, publicly organized, standardized, and regulated platforms, enabling multilateral transactions [7]. In practice, generators typically hold a balanced portfolio of these derivatives, as each instrument possesses unique weaknesses and strengths [2].

A. Contract-for-Difference (CFD) Instruments
CFD instruments are one of several financial derivatives that can be employed to hedge renewable generators against the electricity spot price risk exposure of pure competitive electricity markets. CFDs are typically structured between a renewable generator and a counterparty offtaker who buys out of the same physical market that the generator sells into [2]. High spot prices are good for the generator but bad for the offtaker and vice versa. Hence, it is mutually beneficial for these parties to hedge their exposure to these volatile spot prices. In a CFD, contracting parties receive or pay the difference between the trading period spot price and a preagreed strike price per unit of electricity over a specific agreement duration [8]. The strike price is a fixed price that contracting parties agree to trade a unit of electricity (MWh) and usually represents the mean expected value of electricity over the contracting period. The value of the strike price is mainly dependent on the forecasted underlying electricity price [2]. Hence, if the strike price is greater than the spot price, the generator receives a payoff from the offtaker, the difference between the strike price and the spot price per unit of electricity. Otherwise, the generator returns a payoff to the offtaker, the difference between the spot price and strike price per unit of electricity [9].
Traditional CFD instruments are bilateral contracts and, as such, are traded OTC [4]. Hence, they are liable to counterparty credit risk, the possibility that a contracting party can incur a financial loss because of a default on settlement payment by its bilateral counterparty [2]. They are exposed to high margining risks because of the infrequent settlement cycles of the intermediary (a delegated financial institution) that usually clears and settles payments due to contracting parties [10]. The nonfrequent settlement times result in accumulated settlement payments and impose the need for contracting parties to maintain high margins to reflect the quantum of cash flows to be hedged and, thus, introduce the risk of high margin payments [8]. These instruments are susceptible to third-party risks due to the probability that the clearing and settlement intermediary can become fraudulent or insolvent. Legal risks persist due to the usually cost-prohibitive arbitration processes resulting from contractual discords among contracting parties, e.g., disputed payments or payment defaults. Such legal intermediaries might also be partial, favoring certain stakeholders over others, inducing another variation of thirdparty risk. Furthermore, CFDs possess underlying process risks, the probability that a contracting party can suffer a financial loss because the procedure that supports the contractual arrangement lacks operational efficiency and reliability [4]. In CFDs, process risks emanate from the error-susceptible manual moving parts that slow nontransaction and transaction-related activities of the contract.

B. Decentralized Finance (DeFi)
DeFi instruments are financial services running on the blockchain, an immutable and decentralized digital ledger that enables transactions between parties to be recorded securely and permanently [11], [12]. DeFi instruments effectively allow disparate parties to take certain financial positions and behave rationally without the oversight of a central intermediary. The operation of DeFi instruments on the blockchain is governed by smart contracts. Smart contracts are special computer scripts (or chaincode) that execute natively within a blockchain in a way that cannot be impeded or interfered with [13]. For instance, a smart contract can autonomously hold and manage cryptographic assets based on predefined conditions. When the appropriate conditions are met, the smart contract can autonomously disburse funds to a particular counterparty or token holder.
The financial industry has seen the most substantial proposals and applications of DeFi instruments in derivative arrangements [7], [14], [15]. Here, DeFi is proving to reduce certain underlying risks of traditional financial derivatives. For instance, in [7], DeFi derivative products were proposed to hedge systemic risk in OTC contracts. The exposure to systemic risk was reported to arise from the nontransparent reporting of OTC transactions to trade repositories tasked with monitoring these transactions. In [14] and [15], a derivative market was implemented on a public blockchain to reduce counterparty credit risk. The results here also indicate the mitigation of margining risks due to prompt settlement times and third-party risks since the role of intermediaries is made redundant by the self-executing blockchain smart contracts. The trading of Bitcoin futures on the Chicago Board Options Exchange and the Chicago Mercantile Exchange represents an applied implementation of DeFi derivative products [16].
DeFi principles could be a good fit for the electricity sector since the established benefits of such instruments in financial markets can be translated therein. The earliest work on DeFi electricity derivative products was undertaken in [17]. Here, the main regulatory issues around implementing blockchainbased electricity wholesale trading for OTC transactions were investigated. Since then, only a few projects have explored this relatively novel idea. In [18], a blockchain prediction marketplace was employed to minimize the imbalance risks of wind generators in competitive electricity markets through the wisdom of the crowd. Here, the aggregated token-backed predictions from the decentralized crowd enable improved wind power forecasts to reduce imbalance exposures. Similarly, Alao and Cuffe [19] introduced the concept of weather derivatives on a DeFi marketplace for mitigating the volumetric risks of solar generators. In [8], a basic framework for a blockchain CFD derivative instrument for hedging price risks of renewable generators was sketched out. Still, this project was exploratory and intended to serve as an impetus for developing advanced and robust blockchain electricity derivatives, as the work here.
Therefore, the novel contribution of this article is a functional description and implementation of a blockchain smart contract chaincode that operates as a mediator between stakeholders mutually enrolled in bilateral CFD arrangements, underpinned by a suite of novel autonomous mechanisms, settlement, collateralization, and authentication. This proposed framework addresses the core research question: "How can the underlying risks of traditional CFD instruments be minimized?" The suite of smart contract mechanisms mitigates the risks of traditional CFDs through interconnected financial incentives that compel contracting parties that do not have to trust each other to behave rationally without the oversight of a human third-party intermediary. Credit risk is addressed through the collateralization mechanism, incentivizing contracting parties to fulfill their cross-subsidization obligations. Parties are protected from margining risks due to the settlement mechanism that enforces prompt cross-subsidization payments. Legal risks are mitigated since the smart contract arrangements are enduring and irrefutable. Process risks are also hedged due to the process automation introduced by the same self-executing, persisting, and immutable smart contracts that function based on only the predefined conditions embedded in them [13].
By addressing the underlying risks of traditional CFDs using the proposed framework, new risks are introduced into the arrangement. These risks include security risks as a result of poorly tested smart contracts or new attack vectors and interactions with other DeFi applications [20], [21], volatility risk of the native currency of the blockchain [22], account risks due to user errors [23], and design risks due to faultily designed smart contracts [15]. Although some of these risks can now be explicitly hedged, security remains the most significant risk of the blockchain CFD structure. The core functionalities of traditional CFDs are maintained in the proposed structure, thus hedging design risk, as will be seen in Section II. Cryptocurrency volatility risk is minimized by integrating a stablecoin into the smart contract. However, such interaction with a disparate DeFi application incites a potential security threat.
Nevertheless, the objective of this article is not to prove the flawlessness of blockchain CFDs but rather to demonstrate the fundamental mechanics that should exist in such new arrangements and ascertain their efficacy in overcoming the limitations of traditional structures. Therefore, this article, for the first time, envisions how CFDs may be structured on a blockchain marketplace to hedge renewable generators against electricity price risk. Furthermore, it implements such a structure on a real-world smart contract platform. Although several existing blockchains support smart contract functionalities [10], Ethereum remains the most liquid and mature network [8]. For this reason, the proposed structure has been implemented using its smart contract technology, as will be seen in the remaining sections.

II. METHODOLOGY
This section describes the structure and implementation of the proposed CFD instrument under the assumption that the physical market, as in Fig. 1, is maintained. The instrument, shown in Fig. 2, resides in the financial market, operating alongside the physical market and available to electricity market participants along with other derivatives. Renewable generators and offtakers would enter such an arrangement to hedge their spot price risk by mutually cross-subsidizing unfavorable prices. The financial instrument does not concern the physical power delivery, as generators will receive the same revenue from offtakers, regardless of whether their delivered power to the central pool market meets or exceeds their contracted CFD capacity. Reconciliations regarding excess or deficit supply are usually undertaken in a separate balancing market for electricity [5].  Central to the smart contract arrangement is a trio of novel autonomous mechanisms. The authentication mechanism manages the enrollment process in traditional arrangements without human intermediaries. The settlement mechanism also removes the need for a clearing and settlement intermediary. It enforces a prompt and irrefutable collection of cross-subsidization payments from contracting parties' collateral accounts as spot prices are observed in real time. Finally, the collateralization mechanism derisks counterparty credit exposure on-chain and autonomously since collaterals are held within the smart contract on behalf of contracting parties for settlement purposes. Contracting parties are incentivized to police the collateral accounts of their bilateral counterparties in the smart contract and indicate when they fall below the minimum requirement, as shown in Fig. 2. Hence, contracting parties are incentivized to maintain their collaterals above the minimum requirement to avoid liquidating their accounts in the smart contract.
Some critical functionalities and actors underpin the operation of the proposed arrangement on the Ethereum blockchain, as shown in Fig. 3. Transactions on Ethereum incur a fee called gas, in the native currency Ether, to compensate decentralized nodes that verify transactions and secure the network [8]. Hence, contracting parties must cover the associated transaction costs resulting from the interaction between these external features and the smart contract.
The Deployer is the entity that creates and commits the smart contract to the blockchain. Smart contract deployment is considered a transaction [23]; as such, it attracts a fee. This cfdDeployerFee, as in the implemented source code at [24], is socialized among the contracting parties. The smart contract does not naturally have sight of the fluctuating spot price published by the market operator of the physical market at every trading period. The smart contract needs an Oracle to provide this external data, as in Fig. 3 [25], to serve as the basis of payoff to the contracting parties. Invoking the differencePayment function that achieves this task costs an oracleInputFee that must be greater than the associated cost of calling the function. Such cost is distributed among the contracting parties. Notably, oracles introduce security risks to the blockchain CFD since a malicious party could manipulate its data stream to game the operation of the smart contract. Finally, the native currency of the smart contract is volatile. A stablecoin, equivalent to the denominated currency of the physical market's clearing price, is required to be integrated into the network to hedge this risk. Contracting parties incur gas fees when they deposit or withdraw stablecoins to maintain their collateral accounts within the smart contract. Again, interaction with a disparate DeFi application incites a potential security threat.
The rest of this section showcases how the proposed instrument incentivizes contracting parties that do not have to trust or know each other to maintain an enduring CFD.

A. Autonomous Settlement Mechanism
Traditional CFD instruments can be exposed to high margining risk, a financial risk that potential cash flows are lower due to the payment of maintenance margins [4]. The high margining risks prevalent in traditional CFD instruments are a result of the infrequent settlement times of the bureaucratic clearing and settlement intermediaries that manage CFD payoffs of contracting parties [8], [9]. For instance, settlement payments in the U.K. wholesale electricity market can take from a few months to up to two years to finalize [10]. Therefore, a novel autonomous settlement mechanism is proposed to remove the need for a clearing and settlement intermediary and enforce prompt and irrefutable collection of cross-subsidization payments from contracting parties as spot prices are recorded by the oracle in real time. This connotes that, in practice, contracting parties can minimize their margining risk by the factor shown in (1). The extent of this risk minimization is significant because the average settlement time for traditional arrangements τ d is much greater than that of the proposed instrument τ b The CFD payoff p for a generator i at every trading period (∀t ∈ T ) is shown in (2) [8]. V is the contracted volume, s t is the spot price, and K is the strike price. From (2), if the strike price is greater than the spot price, the generator i receives a payoff in stablecoin from the offtaker j, which is the product of the difference between the strike price and spot price and the contracted volume [9]. Otherwise, the generator i returns to the offtaker j a payoff in stablecoin as in (3), which is the product of the difference between the spot price and strike price and contracted volume [9] After every trading period (∀t ∈ T ), the collateral accounts of the contracting parties, denominated in stablecoins, are updated based on (2) and (3). This account is the same one used by contracting parties to fulfill their collateral requirements. While settlement and collateral accounts are usually separate in traditional arrangements [26], they share a single account in the proposed arrangement to enhance operational efficiency. In summary, three processes are implemented sequentially by the autonomous settlement mechanism. First, the spot price is obtained from the oracle. Second, the CFD payoff is computed within the smart contract. Finally, the collateral accounts of the contracting parties are directly updated based on the calculated payoff. Contracting parties, as they deem fit, can then make withdrawals from their collateral account in the case of a positive CFD payoff or make deposits to their collateral account in the case of a negative CFD payoff. Algorithm 1 demonstrates the sequence of execution of the autonomous settlement mechanism. This task, implemented by the differencePayment function at [24], irrevocably and irrefutably executes once invoked by the oracle.

B. Autonomous Collateralization Mechanism
Counterparty credit risk is one of the main risks of contracting parties in a derivative transaction because a party in a particular bilateral arrangement may not have the funds or the willingness to follow through on its cross-subsidizing obligations [4]. The traditional method for mitigating credit risk is depositing cash collateral in, or purchasing a letter of credit from a financial institution, such as a commercial bank. These methods expose the contracting parties to margining, third-party, legal, and process risks [27].
Therefore, a novel collateralization mechanism is proposed to derisk counterparty credit exposure on-chain and autonomously. Here, collaterals are held within the smart contract on behalf of contracting parties for settlement purposes. The collaterals contained within the smart contract must be sufficient to incentivize rational behavior among contracting parties, hence aligning with the CFD's purpose as an enduring hedging arrangement. For this reason, developing a suitable collateralization mechanism is the core design problem for such a blockchain derivative instrument. Central to collateral management is the concept of maintenance margins and termination penalties [4], [15]. The maintenance margin of a contracting party reflects its credit exposure to its counterparty in the smart contract at every instance [4]. Termination penalties are usually included in derivatives that afford contracting parties the option to leave the contract before the end of the agreement duration [15], in exchange for a premium payment.
To ensure that contracting parties always have sufficient funds in their collateral accounts to make settlement payments due to their bilateral counterparty, their minimum maintenance margin B min t is proposed to be equal to or greater than the maximum CFD payoff p max that can be due to the generator i or offtaker j at every trading period as in (4). This requirement is imposed in the smart contract because the settlement mechanism ensures autonomous CFD payoffs due to contracting parties every trading period, limiting their counterparty credit exposure to only a single trading period. The maximum CFD payoff p max that can be due to the generator i from the offtaker j at every trading period is represented in (5). On the other hand, the maximum CFD payoff p max that can be due to the offtaker j from the generator i at every trading period is shown in (6). Therefore, the minimum maintenance margin becomes as in (7).
From (5) and (6), it is evident that the maximum and minimum limits of the volatile spot price s t defines p max and thus B min t of contracting parties. Contracting parties have the liberty to propose a suitable maintenance margin during enrollment in a particular bilateral CFD arrangement in the smart contract. However, we propose that their selection must satisfy (8) to reflect the practically possible volatility band of the spot price s t . If (8) holds, then B min t of the smart contract becomes as in (9) 0 ≤ s t ≤ 2K (8) Contracting parties can terminate the smart contract prematurely (i.e., before the end of the agreement duration), either actively or due to a default on their minimum collateral requirement L min t . However, a termination penalty premium payment is proposed to discourage them from exiting the smart contract prematurely. Contracting parties can offer a suitable termination penalty Υ during enrollment in a particular bilateral CFD arrangement in the smart contract [8]. Therefore, the minimum collateral requirement L min t that must be maintained by each contracting party in the smart contract is the sum of its maintenance margin B min t and termination penalty Υ as in (10). The minimum collateral requirement ensures that contracting parties have sufficient funds in their collateral account to reduce their credit risk exposure to their bilateral counterparty. It also enforces termination penalty payment to their counterparty if they prematurely exit the contract The active exit option is invoked by calling the active-ExitGenerator function for generators and the active-ExitOfftaker function for offtakers. It gives these parties the right, but not the obligation, to exit the smart contract prematurely in exchange for a termination penalty Υ payment [15]. When an enrolled contracting party calls the active exit option, its termination penalty Υ deposit is transferred to the nonexiting contracting party. Both the bilateral exiting and nonexiting contracting parties become expelled G i,j from the smart contract. For clarity, the exiting party is the entity that initiates the exit, while the nonexiting party is its bilateral counterparty.
The alternative way contracting parties can prematurely exit the smart contract is by defaulting on their minimum collateral requirement. Contracting parties are incentivized to police the collateral accounts of their bilateral counterparties in the smart contract and invoke a default call if they fall below the minimum requirement. This call for a generator will be invoked by its counterparty offtaker, calling the exitDueToGener-atorDefault function. Similarly, for an offtaker, will be invoked by its counterparty generator, calling the exitDue-ToOfftakerDefault function. Hence, contracting parties are incentivized to maintain their collaterals within the collateral buffer region to avoid the liquidation of their accounts in the smart contract. The buffer region is realized when the collateral balance exceeds the minimum requirement. To manage these accounts, generators will replenish their collaterals by calling the depositGenerator function when it is at the buffer region but close to the minimum requirement and genera-torWithdrawdDuringPPA when it is over the minimum requirement. Likewise, offtakers will replenish their collaterals by invoking the depositOfftaker function when it is at the buffer region but at the verge of the minimum requirement and offtakerWithdrawdDuringPPA when its sufficiently above the minimum requirement.
When a default call is invoked on a contracting party whose collateral account falls below the minimum requirement, the bilateral defaulting and nondefaulting party become expelled from the contract. Before expulsion, the defaulting contracting party's termination penalty Υ deposit is transferred to the nondefaulting contracting party. For clarity, the defaulting party is the entity that defaulted on the minimum collateral requirement, while the nondefaulting party is its bilateral counterparty that invoked the default call. The order of execution of the autonomous collateralization mechanism is presented in Algorithm 2.
Importantly, the smart contract becomes closed to bilateral contracting parties after their CFD agreement duration. Prior to smart contract close, a grace period, as shown in Fig. 4, is proposed. During this time, the smart contract's operation is limited to a single function that enables both parties to withdraw any remaining balance in their collateral account. This function represents generatorWithdrawAfterPPA for the generator and offtakerWithdrawAfterPPA for the offtaker. After the grace period, parties no longer have access to the smart contract. These protocols only apply to bilateral contracting parties who have come to the end of their CFD agreement. Other parties remain in the smart contract and continue to participate according to its rules until the end of their respective arrangements.

C. Autonomous Authentication Mechanism
The enrollment of contracting parties into the smart contract is governed by an autonomous authentication mechanism, explained as follows. First, they indicate their interest in entering the smart contract by calling the expressionOfInterest function. Here, they select a position in the arrangement, either as a generator i or an offtaker j. While defining their position, they offer their CFD terms to the market. That is, a strike price K per MWh, volume V in MWh (matching the quantity of electricity that can at least be delivered by the generator or evacuated by the offtaker at every trading period in the physical market), termination penalty Υ, and agreement duration τ . The offered volume consideration is crucial to avoid incurring costs in the separate balancing market for electricity. To discourage sham registrations and hence improve the efficacy of the network, we propose that parties place an expression of interest deposit Q as in (11). Essentially, Q to be lodged by contracting parties must not be less than the minimum collateral requirement L min t calculation of the CFD terms they have offered Participants can then begin observing the smart contract's EoIDeposit events to determine when a counterparty with a similar strike price, volume, termination penalty, and agreement duration has expressed interest in registering in the contract. When a participant finds a counterparty that shares similar terms with them, they enroll themselves and the particular counterparty into the smart contract as a pair A i,j using the next available sequential ID pair count (A i,j + 1). Alternatively, they wait until a counterparty with compatible terms registers into the smart contract as a pair. This enrollment procedure is achieved when either contracting counterparty invokes the enrolParticipants function. The generator-offtaker (i, j) pair requirement is enforced by Algorithm 3 since the proposed instrument is effectively a bilateral smart contract marketplace that requires that the number and contracting terms of generator i and offtaker j correspond. Following registration, the expression of interest deposit Q is paid into the collateral account H i,j of the bilateral contracting parties. Thereafter, they can participate in the smart contract and manage their collateral accounts according to its rules.

III. TEST PLATFORM
This section describes the test platform employed to demonstrate the functioning and value of the proposed financial instrument. The instrument has been implemented as a smart contract on the Ethereum Rinkeby testnet blockchain in [24]. The arrangement with address, 0x03583b438EF5A58f72a 137697fc2230Fc85734Db, resides on block 10738784. MATLAB script located at [28] is utilized for simulating the case study and outcomes of the arrangement.

A. Notional Case Employed for the Autonomous Authentication Mechanism
Three 250-MW wind generators with a capacity factor of 32% are considered to have separately enrolled in the smart contract with three offtakers to hedge against their spot price risk in the Irish wholesale electricity market (see Fig. 5 [29]). The generators have a common agreement duration of two years with their bilateral offtaker counterparty. Their agreement is also US$ denominated and includes a preagreed strike price, contracted volume, and termination penalty with the same bilateral counterparty (see Table I). Their minimum maintenance margin is determined as per (9). Loops, iterating over the number of bilateral arrangements, numberPairAddresses, exist in the smart contract. Ethereum and other proof-of-work smart contracts discourage the use of loops without a fixed number of iterations due to high transaction costs [23]. Hence, for demonstration purposes alone, the number of enrolled contracting party pairs in the committed smart contract is capped at the previously mentioned three arrangements. However, we note that such limitations would not exist for all blockchain-enabled smart contracts. Newer and more operationally efficient blockchains, such as [30], cost as low as $0.001 per transaction, regardless of the transaction size.

B. Integration of the Proposed Instrument With Other DeFi Applications
DaiToken, the most mature and popular collateral-backed stablecoin based on DeFi and governance principles is integrated into the smart contract to hedge the blockchain CFD marketplace against Ethereum's native currency volatility risk [31]. DAI maintains a 1:1 pegging with the US$ via overcollateralization of a basket of crypto assets locked in smart contract accounts. Hence, 1 DAI is equal to US$1. Furthermore, the market-Operator that estimates and publishes the fluctuating spot price of the physical market at every trading period serves as the oracle. This source is chosen because such electricity price data is yet to be collected and aggregated by popular decentralized data feeds. Overall, the stablecoin and oracle services introduce a possible attack vector and, thus, expose the smart contract to security risks. However, these services are mature technologies currently underpinning several DeFi applications, such as in [31] and [32].

IV. RESULTS
To illustrate the operation and value of the autonomous settlement and collateralization mechanisms, the collateral accounts of the three separate pairs of participants trading in the Irish physical electricity market are examined. Their collateral accounts are analyzed on three different and nonsequential trading days, as in Fig. 5, i.e., pair A 1 on trading day 1 (see Fig. 6), A 2 on trading day 2 (see Fig. 6), and pair A 3 on trading day 3 (see Fig. 6). On all trading days, both contracting parties of the common pair commence their respective trading day with the same balance in their collateral accounts.

A. Results for the Collateralization Mechanism
In the case of A 1 (i.e., at trading day 1), both contracting parties remain in the smart contract over the trading day and abide by the collateral management requirements of the smart contract. For A 2 (i.e., at trading day 2), both contracting parties conform to the collateral management requirements of the smart contract until trading period 21 (20:00), when the offtaker decides to exit the contract. Its counterparty, the renewable generator, also becomes immediately expelled from the contract. Before being expelled, it receives a termination penalty compensation of US$ 52 160 from the exiting offtaker. For A 3 (i.e., at trading day 3), both contracting parties observe the collateral management requirements of the smart contract until trading period 22 (21:00), when the offtaker defaults on the arrangement's minimum collateral requirement. A default call is immediately invoked by its counterparty. The collateral accounts of both contracting parties get liquidated from the smart contract. Like in the case of A 2 , the defaulting party, the offtaker, forfeits its termination penalty deposit of US$ 20 368 to the generator.

B. Results for the Settlement Mechanism
The net cash flows of the renewable generators are examined to show the impact of the rapid settlement times of the proposed approach on contracting parties. Suppose that, unlike Figs. 6-8, the generators maintain their collateral accounts at an 80% level (i.e., they deposit 80% to their collateral account following a negative payoff and withdraw 80% from their collateral account following a positive payoff at every trading period). Their net cash flows become as in Figs. 9-11, respectively. From Figs. 9-11, it is evident that the hourly net cash flows of the generators enrolled in the smart contract are flatter than that of the traditional CFD. Flatter hourly cash flows imply prompt    and frequent settlement payment, thus reducing margining risk. This minimized exposure results from lower accumulated settlement obligations that mandate high collateral requirements. Particularly, the flatter cash flows from the hourly settlement payments mean that margining risk can be mitigated by 730 to up to 17 520 times [estimated using (1)], compared to traditional arrangements where settlements can take from a few months to up to two years to complete [10]. The following example reiterates the significance of margining risk. In 2021/22, skyrocketing electricity prices and volatility in the European market caused exchanges to demand additional margin payments in billions of Euros from energy companies to ameliorate credit risk. This escalated collateral requirement resulting from higher margin calls and worsened by infrequent settlement times has left some of these companies close to bankruptcy [33].

V. DISCUSSION
The results have shown that renewable generators can minimize some of the underlying risks of traditional CFDs while maintaining their core functionalities, thus hedging design risk. Counterparty credit risk, one of the main risks of contracting parties and most challenging risk to hedge, can be mitigated on-chain and without a traditional central intermediary. Margining risk is mitigated because the smart contract autonomously, seamlessly, and promptly settles transactions on behalf of parties. Although the blockchain CFD settles in real time (hourly), minimizing margining risks compared to traditional CFD instruments, the net cash flow of traditional CFD instruments after settlement (typically after many months) is the same as that of the blockchain CFD. However, this lowered margining risk could improve short-term liquidity (increased cash at hand) that the wind generators can utilize to finance other clean energy initiatives.
Third-party risk is reduced since the smart contract enforces the actions of the arrangements without the oversight of an intermediary. Legal risk is ameliorated by the autonomous mechanisms enabling enduring and irrefutable arrangements. Process risks are also minimized due to the process automation instituted by the same self-executing, persisting, and immutable smart contracts that operate based on only the prespecified conditions embedded in them. Transaction costs are not analyzed and considered in this article because the fees associated with traditional CFDs and blockchain smart contract arrangements are based on several factors. Hence, a comparison between these platforms cannot amount to a conclusive result or claim. First, CFDs are traded OTC; as such, their contracting terms are usually private. The cost of these arrangements also varies widely depending on the geographical location, market rules, liquidity, etc. [4]. Furthermore, the transaction cost of smart contracts is entirely dependent on the blockchain platform. While the proposed instrument was built on Ethereum due to its maturity, the present design of this blockchain means transactions incur relatively elevated fees [23]. However, newer and more operationally efficient blockchains solve this problem [30].
Security threats persist as the most significant risk of the blockchain CFD structure. First, building a secure blockchain marketplace does not imply its immunity from attackers since smart contracts could be susceptible to novel attack paths. The incorporated stablecoin and oracle services could also expose the smart contract to security risks. The smart contract is also susceptible to account risks related to the possible loss of private keys and unintended fund transfer to the wrong address. The account risks are significant because, in blockchain networks, cryptocurrency ownership is held in digital keys. If these keys are lost, funds associated with them become irrecoverable. In the same vein, unintended fund transfer to a wrong address implies a permanent loss of funds [8]. Since the blockchain ecosystem is still burgeoning, these threat vectors might be mitigated or eliminated in the future. Still, their impacts and effects must be thoroughly assessed and understood before the proposed instrument could become mainstream in the renewable electricity industry. The risk profile of traditional and blockchain CFD arrangements is shown in Table II, with the color green indicating low risk and red indicating high risk.

VI. CONCLUSION
This article leveraged traditional CFDs to demonstrate the implementation of blockchain electricity derivative arrangements. It also showed that renewable generators can minimize some of the underlying risks of CFDs while maintaining their conventional core structures. The proposed instrument was merely illustrative of the kind of autonomous mechanisms enabled by a blockchain marketplace and the hedging arrangements that such an instrument can support to overcome the limitations of traditional structures. Any other blockchain smart contract platform or electricity derivative arrangement could easily and usefully be developed to hedge renewable generators against other revenue risk exposures of electricity markets.