1 Introduction

Blockchain promises deeply changes in manners we transact value. Through a clever combination of cryptography and game theory, the blockchain could be used by any participant in the network to inexpensive verify and settle transactions in the cryptocurrency (Catalini & Gans, 2016). Blockchain (also known distributed ledger technology-DLT), was first popularized as the technology behind the cryptocurrency Bitcoin and emerged in several other forms, often with the ability to store and execute computer programs such smart contracts (Cong & He, 2018).

From a technical point of view, blockchain is essentially a public distributed database of digital records of all transactions or events that have been executed and shared among participating parties of the network. Each transaction in the public ledger is verified by consensus of a majority of the participants in the system, once entered, information can never be erased (Crosby et al., 2016). From an economics perspective, this new market design solution provides a platform for several financial applications such tokens, ICOs, Crowdfunding, insurance, smart property and payment solutions. Moreover, Mougayar (2016), Tapscott and Tapscott (2016), Swan (2015) argues that blockchain benefits are more than just economic, they extend into real-world problems such political, humanitarian, social and scientific domains.

Changes in temperature, humidity, wind, solar radiation and rainfall, may affect electricity markets both on the demand and the supply sides. Also, climate patterns changes can result in changes in electricity demand Zhang et al. (2022). The higher temperatures imply lower demand for heating and higher demand for cooling, and in precipitation also involve changes in thermal and non-thermal power production (Mideksa & Kallbekken, 2010, Van Vliet et al., 2012). Moreover, the incidence of extreme weather events could affect the transformation and transportation of electricity (Mideksa & Kallbekken, 2010). Eskeland and Mideksa (2010) estimated that a 1\(^\circ\)C change in temperature will change demand by 2 kWh per year per capita via the change in heating degree days, whereas for a unit increase in cooling degree days, the demand changes by 8 kWh per year per capita. Similarly, Scott & Huang (2007) report that for a 1\(^\circ\)C increase in temperature, energy consumption is expected to change within the range of 5%. Mansur et al. (2008) founded evidence that with warmer summers and cooler winters both households and firms consume more energy in the form of electricity, gas, and oil. Burillo et al. (2019) argues that demand for electricity increases significantly as air temperatures rise in urban environments with high levels of air conditioning (AC) penetration.

According to Mideksa and Kallbekken (2010), the effects of climate change on the demand for heating and cooling is statistically significant and the results consistent across studies focusing on different regions and different time periods. Concerning this, in the early 1990s, the energy companies of the United States developed financial derivatives using underlying weather index (Aïd, 2014; Zapranis & Alexandridis, 2013, Jewson & Brix, 2005; Zeng , 2000). These financial products are structured such as futures, options or swaps, which allow exchanging weather risks (Jewson & Brix, 2005, Zapranis & Alexandridis, 2013). However, despite their potential, these instruments are timidly used in several countries.

Concerning this, the blockchain provides a low-cost infrastructure for the creation of open banking platforms. The blockchain adds an entirely new layer to the Internet to enable economic transactions, both immediate digital currency payments (in a universally usable cryptocurrency) and longer-term, more complex financial contracts Bambara & Allen (2018). This works as a starting point for the development of new financial solutions, such as the development of financial instruments to hedge against weather-related losses, hitherto not very accessible to farmers in poor countries outside the traditional banking and financial system. Regarding this, We propose a framework for trading weather derivatives, initially only HDD call options, to hedge the volatility of temperature using blockchain technology. Towards this end, we estimate and pricing weather call options to 5 Brazilian select cities. Also, we designed an Ethereum Virtual Machine (EVM) smart contract to provide to verify the technical and economic viability. The remainder of this article is organized as follows: the second part is prior theoretical background, the third part is research data and methods, the fourth part is results analysis, and the last part is conclusions.

2 Background

2.1 Weather derivatives

A weather derivative is a financial contract whose payoff is contingent on the temperature or amount of precipitation (rain, snow, wind) observed at a given location during a predetermined period (Jewson & Brix, 2005; Schofield, 2021; Zapranis & Alexandridis, 2013; Härdle & Cabrera, 2012). Weather derivatives are usually structured as swaps, futures, forwards and call/put options based on different underlying weather indices. The underlying weather index can be rainfall, temperature, humidity or snowfall, or any other weather variable (Jewson & Brix, 2005; Zapranis & Alexandridis, 2013). These financial instruments are used by organizations or individuals as part of a risk management strategy to reduce risk associated with adverse or unexpected weather conditions (Zapranis & Alexandridis, 2013).

In the early 1990s, the energy companies developed financial derivatives on electricity price in order to hedge themselves against excess production and limited consumption of electricity (Cao & Wei, 2003; Jewson & Brix, 2005; Zapranis & Alexandridis, 2013). In September 1999, the Chicago Mercantile Exchange (CME) launched the first exchange-traded weather derivatives (Jewson & Brix, 2005; Zapranis & Alexandridis, 2013). Figure 1 locates weather derivatives in the financial derivatives’ field study.

Fig. 1
figure 1

Categorization of financial derivatives

The typically weather derivative contract involves as specific features as follows: contract type; strike or future price; tick size; maximum payout; contract period; underlying index (CAT, HDDs, rainfall, snowfall); weather station from which the underlying variable data are obtained, and a premium paid from the buyer to the seller (negotiable) (Alaton et al., 2002; Cao & Wei, 2003; Jewson & Brix, 2005; Zapranis & Alexandridis, 2013; Zeng , 2000). Figure 2 summarizes the payoff structure of weather derivatives. As in the classical financial derivatives, the payout of these contracts depends on the strike price (the value at which the underlying index may be bought or sold) and the tick size (the smallest increment of the index that leads to a payout amount (Cao & Wei, 2003; Jewson & Brix, 2005; Zapranis & Alexandridis, 2013).

Fig. 2
figure 2

Payoff scheme

In option derivatives, a premium must be given from the buyer to the seller. Hence, the premium is the price of the option (Zapranis & Alexandridis, 2013). All contracts have a defined start date and end date that constrains the period over which the underlying index is calculated (Cao & Wei, 2003; Jewson & Brix, 2005; Zapranis & Alexandridis, 2013). All weather contracts are based on the actual observations of weather at one specific weather station (Cao & Wei, 2003; Jewson & Brix, 2005; Zapranis & Alexandridis, 2013). According to Jewson and Brix (2005), to structure swaps without financial limits; the pay-off is then a linear function of the index, given by

$$\begin{aligned} p(x) = D(x - K) \end{aligned}$$
(1)

where x is the index, D is the tick and K is the strike. According to Jewson and Brix (2005), Kordi (2012); Zapranis and Alexandridis (2013), usually calls and puts have a "cap" (limit) on the maximum payoff. A cap in the payout is added in order to protect the two parties against extreme adverse weather conditions. Concerning this, the payoff, p, from a long swap contract is given by:

$$\begin{aligned} p(x) = \begin{Bmatrix} -L_s&if\ x < L_1 \\ D(x - K)&if\ L_1 \le x \le L_2 \\ L_s&if\ x > L_2 \end{Bmatrix} \end{aligned}$$
(2)

where x is the index, D is the tick, and K is the strike. \(L_s\) is the limit expressed in currency terms, and \(L_1\) and \(L_2\) are the upper and lower limits expressed in units of the index. According to Jewson and Brix (2005), regarding the payoff for each of these structures from the point of view of the buyer of the contract (’long’ position), the seller of the contract (‘short’ position) will have exactly the opposite payoff. On the other hand, the payoff, p, of a long call contract is given by:

$$\begin{aligned} p(x) = \begin{Bmatrix} 0&if\ x < K \\ D(x - K)&if\ K \le x \le L \\ L_s&if\ x > L \end{Bmatrix} \end{aligned}$$
(3)

where \(L_s\) and L are related by \(L_s = D(L - K)\) . Similarly, The payoff, p, from a long put contract is given by:

$$\begin{aligned} p(x) = \begin{Bmatrix} L_s&if\ x < L \\ D(K - x)&if\ L \le x \le K \\ L_s&if\ x > K \end{Bmatrix} \end{aligned}$$
(4)

where \(L_s\) and L are related by \(L_s = D(K - L)\). In addition, there are other non-negligible structures such as collars, straddles, binaries, and baskets (Jewson & Brix, 2005).

Regarding pricing weather derivatives, several strategies are proposed by literature. The model developed by Black and Scholes (1973), to price put, and call options is still commonly used. Unfortunately, in the weather derivative, the market is incomplete, prices cannot be derived from the no-arbitrage condition (Jewson & Brix, 2005; Kordi, 2012; Zapranis & Alexandridis, 2013). Consequently, the classical Black-Scholes-Merton pricing approach, which is based on no-arbitrage arguments, cannot be directly applied (Jewson & Brix, 2005; Kordi, 2012; Zapranis & Alexandridis, 2013). Härdle and Cabrera (2012) argues that, due to their specific nature one encounters several difficulties. First, because the underlying weather indices are not tradable, and second, the weather derivative market is incomplete, meaning that the weather derivative cannot be cost-efficiently replicated by other weather derivatives. Moreover, weather indices do not follow random walks and the payoffs of weather derivatives are determined by indices that are average quantities. Concerning this, the literature distinguish between three different approaches for the valuation of weather derivatives approaches for the valuation of weather derivatives (Jewson & Brix, 2005; Zapranis & Alexandridis, 2013): (i) Burn Analysis, weather derivatives are valued using historical index values yielding the derivative’s fair value. The price of a derivative is then calculated as its fair value plus a possible risk premium. (ii) Index Modelling extends the Burn Analysis by estimating the distribution of the weather index. If the distribution can be estimated relatively well, the Index Modelling approach yields a more stable price estimation than the Burn Analysis. (iii) Daily Simulation use a stochastic method, the development of temperatures are modelled on a daily basis.

Among studies on the developing weather derivatives to the electricity market, Deng and Oren (2006) review different types of electricity financial instruments to hedge the electricity market and points out that weather derivatives can capability to mitigate climate effects. Similarly, Pirrong and Jermakyan (2008) exploiting the fundamentals of the power market and estimated prices of weather derivative for PJM Energy Market. Mount (2002) develop weather derivative to hedge against high spot prices in California.

2.1.1 Temperature derivatives

The most commonly used weather variable is the temperature (Jewson & Brix, 2005). The underlying index is based on a weather variable and defines the payoff of the contract. Usually, contracts are written on heating degree days (HDD)Footnote 1, cooling degree days (CDD) or cumulative average temperature (CAT) over a specified period which count the number of times that temperature exceeds or falls below a defined threshold over the contract period (Jewson & Brix, 2005; Zapranis & Alexandridis, 2013). Commonly, the number of HDD and CDD for a contract period consisting of n days is given by the following equations:

$$\begin{aligned} I_n^H = \sum _{i = 1}^{n} HDD \end{aligned}$$
(5)
$$\begin{aligned} I_n^C = \sum _{i = 1}^{n} CDD \end{aligned}$$
(6)

In the literature, two approaches have been proposed for the modeling of the daily avarages temperatures (DAT), the usage of a discrete or a continuous process (Zapranis & Alexandridis, 2013). Caballero et al. (2002); Cao and Wei (2003); Cao et al. (2003); Jewson and Caballero (2003); Huang et al. (2018); Rodríguez et al. (2021) make use of a general autoregressive moving average (ARMA, GARCH) framework. On the other hand, Alaton et al. (2002); Benth & Benth (2007); Dornier & Querel (2000); Zapranis and Alexandridis (2008) suggest a temperature diffusion stochastic differential equation. According to Zapranis and Alexandridis (2013), the continuous processes used for modeling daily temperatures usually take a mean-reverting form, which has to be discretized in order to estimate its various parameters. When the paramerters are estimated, the value of claim are pricing by taking expectation of the discounted future payoff. In generally, once the parameters estimated, the Monte Carlo (MC) simulations are used (Jewson & Brix, 2005; Zapranis & Alexandridis, 2013). This approach typically involves generating a large number of simulated scenarios of weather indices to determine the possible payoffs of the weather derivative.

2.2 Blockchain technology

The original idea of a blockchain was introduced in Haber & Stornetta (1991) proposal for the digital time stamping of documents in sequence to authenticate authorship of intellectual property. The first reference to this data structure a “chain of blocks” appears to come from Nakamoto (2008), whose innovations with cryptocurrency named bitcoin included the connection of the blockchain concept to a public ledger jointly updated by numerous participants in an open-source network. Blockchain technology is a distributed, transparent, immutable, validated, secured, and pseudo-anonymous database existing as multiple nodes where the trust is guaranteed by the consensus process (Bambara & Allen , 2018; Dhilon et al., 2017; Mougayar, 2016; Tapscott & Tapscott, 2016; Swan, 2015).

According to (Bambara & Allen , 2018), the blockchain is a database encompassing a physical chain of fixed-length blocks that include 1 to N transactions, where each transaction added to a new block is validated and then inserted into the block. When the block is completed, it is added to the end of the existing chain of blocks. Moreover, the only two operations - as opposed to the classic CRUDFootnote 2 - are added transaction and view transaction (Bambara & Allen , 2018). According to Bambara & Allen (2018); Bashir (2020); Halaburda et al. (2022); Swan (2015), the basic blockchain processing consists in three steps: (i) add new and undetectable transactions and organize them into blocks. (ii) cryptographically verify each transaction in the block. (iii) append the new block to the end of the existing immutable blockchain. (Bambara & Allen , 2018) argues that blocks once recorded are designed to be resistant to modification; the data in a block cannot be altered retroactively.

Moreover, the ledger itself can also be programmed to trigger transactions automatically. Blockchains are secure by design and an example of a distributed computing system with high Byzantine fault tolerance (Bambara & Allen , 2018; Halaburda et al., 2022). Figure 3 displays the blockchain structure.

Fig. 3
figure 3

Blockchain structure

According to Schuetz & Venkatesh (2019) blockchain can be characterized by three specific features. First, blockchain is a distributed ledger technology that provide visibility and transparency of the stored transactions (Bambara & Allen , 2018; Mougayar, 2016; Schuetz & Venkatesh, 2019; Swan, 2015). Second, as an immutable distributed ledger, blockchain ensures a single version of truth that helps to build trust in the stored information (Bambara & Allen , 2018; Mougayar, 2016; Schuetz & Venkatesh, 2019; Swan, 2015; Tapscott & Tapscott, 2016). Third, a blockchain provides technical conditions to execute transactions and instructions autonomously (Bambara & Allen , 2018; Mougayar, 2016; Schuetz & Venkatesh, 2019; Swan, 2015). Figure 4 displays the blockchain layers.

Fig. 4
figure 4

Blockchain layers

Regarding blockchain technology, we follow (Schär, 2021), which divided the structure into 5 layers. (1) the settlement layer consists of the blockchain and its native protocol asset, and it allows the network to store ownership information securely and ensures that any state changes adhere to its ruleset. According to (Schär, 2021; Bambara & Allen , 2018) the blockchain can be seen as the foundation base for trustless execution and serves as a platform and dispute resolution layer. (2) consists of all assets that are issued on top of the settlement layer. This includes the native protocol asset (tokens) as well as any additional assets that are issued on this blockchain. (3) provides standards for specific use cases such as decentralized exchanges, debt markets, derivatives, and on-chain asset management token compliance. Standards are usually implemented as a set of smart contracts and can be accessed by any user (or DeFi application) Schär (2021). (4) creates user-oriented applications that connect to individual protocols. The interaction is based on smart contract and usually abstracted by a web browser-based front end, making the protocols easier to use. (5) is an extension of the application layer. Aggregators create user-centric platforms that connect to several applications and protocols Schär (2021).

According to Schär (2021) there are three categories of blockchain-like database applications: public (anyone can read or submit transactions, submissions will be committed if valid, and anyone can participate in the consensus process), consortium (blockchain where consensus is controlled by a preselected set of nodes and rules for achieving consensus) and private (Write permissions are kept centralized to a single organization or part of it. Read permissions may be public or restricted to a set of known participants).In another definition, Blockchain networks can be generally categorized into permissionless or public blockchain, and permissioned or private blockchain Halaburda et al. (2020). Permissionless blockchain, such as Bitcoin network, is a peer-to-peer decentralized network. It is not controlled by any private organization, and the whole network runs on the broad consensus of all the members in the network (Bambara & Allen , 2018; Halaburda et al., 2020; Yermack, 2017; Mougayar, 2016). By contrast, the permissioned blockchain is not publicly accessible, and the users can only perform specific actions granted to them by the ledger administrators (Bambara & Allen , 2018; Behnke & Janssen , 2019; Yermack, 2017; Mougayar, 2016).

2.2.1 Smart contracts

Another main innovation provided by blockchain technology is the capability of implementing self-executing contracts. Initially theorized by Szabo (1994), the smart contract is defined as a secure, machine-readable, and executable program that can automate specified procedures, including those used in legal contexts (Bambara & Allen , 2018; Cong & He, 2018; Mougayar, 2016; Sheth & Subramanian, 2018; Swan, 2015; Tapscott & Tapscott, 2016). According to (Swan, 2015) in the blockchain context, smart contracts mean transactions that go beyond simple buy/sell cryptocurrency transactions and may have more extensive instructions embedded into them. Similarly, Bambara & Allen (2018) points out the required conditions are coded in the smart contract and once they are met the contract obligations are automatically executed. Regarding smart contracts in blockchain, the EthereumFootnote 3 platform is widely used to develop derivatives and insurance applications.

Dapps, DAOs, DACs, and DASs are abbreviated terms for decentralized applications, decentralized autonomous organizations, decentralized autonomous corporations, and decentralized autonomous societies, respectively (Swan, 2015). According to Bambara & Allen (2018); Bashir (2020); Swan (2015) these applications runs on a blockchain network in a distributed fashion with participant information securely (and possibly pseudonymous) protected and operation execution decentralized across network nodes.

3 Methodology

In essentially, the build of a weather derivative involves three stages: elaboration of the contract design; survey and careful estimation of the parameters of the underlying index; fair pricing of contracts (Jewson & Brix, 2005; Zapranis & Alexandridis, 2013). In Fig. 5 we show the step-by-step, from data to analysis.

Fig. 5
figure 5

Conceptual architecture of study

In order to build a European call option to hedge temperature volatility (HDD and CDD) to electricity market using smart contracts, we have chosen to foster one of the proposed models for temperature which appears in Alaton et al. (2002), paper, as it is a widely used model (with or without modifications) for temperature modeling. In addition, we were pricing the designed option using Monte Carlo simulation.

Subsequently, we write a decentralized autonomous organization based on a smart contracts in Ethereum Virtual Machine that provides weather options to selected cities. In addition, we verify and described the economic and technical viability to implement these financial instruments under blockchain technology. In synthesis this process can be understood as follows: observe and evaluate data (public source) \(\rightarrow\) pricing weather call option (using a statistical method suitable) \(\rightarrow\) writing contract using selected programming language \(\rightarrow\) deploy the smart code on Ethereum testnet.

3.1 Mean-reversion model

In order to model the dynamic temperature, Alaton et al. (2002) propose the use of a model that employs the mean-reverting or Ornstein-Uhlenbeck stochastic process with a piecewise constant volatility function, and assume that volatility is constant over any given month of the year. According to Kordi (2012), in Alaton et al. (2002) model, the seasonal dependence should be modeled with, for example, some sine-function of the form: sin(\(\omega\)t + \(\phi\)) where t denotes the time measured in days, and t = 1, 2, . . .n, denote January 1, January 2 and so on. Moreover, since we know that the period of the oscillations is one year (neglecting leap years) we have \(\omega\) = 2\(\pi\)/365, and the phase angle \(\phi\) enters the function because yearly minimum and maximum mean temperatures not coincide to first and last day respectively. The mean temperature \(t^m_t\) t at time t will have the following form:

$$\begin{aligned} T^m_t = A + B_t + C sin(\omega t + \phi ) \end{aligned}$$
(7)

where the parameters A, \(B_t\), C, \(\phi\) are estimated using a Ordinary Least Square (OLS) method. Moreover, the stochastic component of temperature (noise), would be \(\sigma _t W_t\), t > 0, where \(W_t\), is a standard Brownian motion. According to Kordi (2012), following Alaton et al. (2002) model assumptions, the model get a stochastic differential equation (SDE) that has the following form:

$$\begin{aligned} dT_t = \alpha (T^m_t - T_t)dt + \sigma _tdW_t \end{aligned}$$
(8)

where \(\alpha\) denotes the speed of mean reversion. The solution is given from a process that is defined as follows. Moreover, the Ornstein-Uchlenbeck process is a stochastic process that satisfies the following SDE:

$$\begin{aligned} dX_t = \alpha (\mu - X_t) dt + \alpha dW_t \end{aligned}$$
(9)

where \(W_t\) is a Brownian motion. The constant parameters are 3. First, \(\alpha > 0\) is the rate of mean reversion. Second, \(\mu\) is the long-term mean of the process. Third, \(\sigma > 0\) is the volatility square-root time of the random fluctuations that are modelled as Brownian motions.

$$\begin{aligned} \frac{dT^m_t}{dT} = B + \omega C cos(\omega t + \phi ) \end{aligned}$$
(10)

According to Dornier & Querel (2000); Kordi (2012) there are necessity to add another term to the drift which has the following form.

$$\begin{aligned} dT_t = \begin{bmatrix} \frac{dT_t^m}{dT} + \alpha (T^m_t - T_t) \end{bmatrix} dt + \sigma _t dW_t, t>s \end{aligned}$$
(11)

Jewson and Brix (2005); Kordi (2012); Zapranis and Alexandridis (2013) points out that to solve the SDE of was necessary to call Ito’s lemma.

3.1.1 Pricing a heating degree day option

Concerning pricing weather derivatives using Monte Carlo simulation, the payoff of the call option is given by the formula as follows, also we follow Alaton et al. (2002); Kordi (2012) we assume that tick size D = 1 for simplicity:

$$\begin{aligned} Payoff = D*max(I^H_n - K, 0) \end{aligned}$$
(12)

where:

$$\begin{aligned} I^H_n = \sum _{i = 1}^{n} max[18 - T_t,0] \end{aligned}$$
(13)

Similarly to Kordi (2012) and Alaton et al. (2002), the underlying process here is normally distributed, but the maximum factor makes our job to find a pricing formula rather complicated. Hence, we will try to make an approximation. We know that \(T_ti\) , i = 1, ..., n are all samples from an Ornstein-Uhlenbeck process, which is a Gaussian process. This means that also the vector (\(T_{t1}, T_{t2},.... T_{tn})\) is Gaussian. Following Kordi (2012) the sum is a linear combination of the elements in this vector, \(I_n^H\) is also Gaussian. With this new structure of \(I_n^H\) n it only remains to compute the first and second moments. We have for \(t < t_1\) and that:

$$\begin{aligned} {\mathbb {E}}^{Q} \left[ I^{H}_{n} \mid F_{t}\right] = {\mathbb {E}}^{Q} \left[ 18n - \sum _{i=1}^{n} I_{t_i} \mid F_{t}\right] \end{aligned}$$
(14)
$$\begin{aligned} =18n - \sum _{i=1}^{n} {\mathbb {E}}^Q[T_t,i \mid F_t] \end{aligned}$$
(15)

According (Kordi, 2012), hence:

$$\begin{aligned} Var[I^H_{n} \mid F_{t}] = \sum _{i=1}^{n} Var[T_{t},i \mid F_{t}] + 2\sum _{i<j}\sum Cov[T_{t}, T_{t_j} \mid F_{t}] \end{aligned}$$
(16)

Supposing that we follow Kordi (2012) and made the calculation above, and found:

$$\begin{aligned} {\mathbb {E}}^Q[I^H_n \mid F_t] = \mu _n \end{aligned}$$
(17)

and:

$$\begin{aligned} Var[I^H_n \mid F_t] = \sigma ^2_n \end{aligned}$$
(18)

Hence, \(I^H_n\) is \(N(\mu _t,\sigma ^2_n)\) distributed. Henceforward, the price at \(t \le t_1\) of the HDD call option with payoff is given by:

$$\begin{aligned} call (t) = e^{-r(t_n - t)} {\mathbb {E}}^Q[max[I^H_n - K, 0]\mid F_{t}] \end{aligned}$$
(19)
$$\begin{aligned} = e ^{-r(t_n - t)} \int _{K}^{\infty }(x - K)f_{I_n^H} (x)dx \end{aligned}$$
(20)
$$\begin{aligned} = e ^{-r(t_n - t)} \left[ (\mu _n -K)\Phi (\alpha _n) + \frac{\alpha _n}{\sqrt{2 \pi }} e^{-\frac{\alpha ^2_n}{2}}\right] \end{aligned}$$
(21)

4 Empirical results

In this section, we present the results of prices of HDD call options estimated by mean-reversion model and Monte Carlo simulation. Subsequently, we develop and test an prototype based on test an smart contract in Ethereum (blockchain) testnet.

4.1 HDD call option

The parameters A, B, C, \(\phi\) has been estimated using OLS. The mean-reversion and volatility has been estimatedFootnote 4 following equations in Sect. 3 is presented in Table 1. In addition, \(\omega\) was set \((2\pi /365)\). However, unlike the works Alaton et al. (2002); Kordi (2012) we set 3 to parameter \(\lambda\).

Table 1 Estimated parameters from the historical data

In order to price call options for temperature, a historical series of 31 years of daily temperature were observed in 5 Brazilian cities: Belo horizonte, Brasília, Porto Alegre, Salvador and, São PauloFootnote 5.

Table 2 Descriptive statistics

In these 5 cities live more than 22 million people. However, the effectiveness of climate derivatives (or parametric insurance) is closely linked to the geographical proximity of the option holder to the weather station (Jewson & Brix, 2005; Zapranis & Alexandridis, 2013).

Similarly Alaton et al. (2002); Göncü (2011); Kordi (2012) for a better adjustment and pricing, the annual average temperature of Brazilian cities was set to 18\(^\circ\) Celsius. Using 10000 replications for the Monte Carlo simulations we were pricing the options. When the temperature exceeds the pre-set limit, 18\(^\circ\)C, one HDD unit is computed. In Table 2 are presented 5 options for different strike prices K respectively of an HDD call option. In addition, the risk-free is rate r = 5% and time to maturity \(t_n\) = 59 days.

The payoff of European call options has been estimated into BRL (Brazilian Real). However, the operations made into Ethereum uses an digital currency of Ethereum blockchain named EtherFootnote 6. We argue that operations can be made with tokens provides an initial coin offering (ICO) on ERC20Footnote 7 standard. The contract premiums were estimated between 58 and 87 BRL. For each HDD observed that exceeds the strike limit, 1 BRL will be paid (for simplified, 1 BRL = 1 tick) will be paid up to the established limit. In addition, the cost of 1% on transactions was assigned to the owner of the contract. As well, for simplification, tax costs were not taken into account. This value of contracts is compatible for a wide range of buyers, from domestic users (households), small businesses to companies and farmers.

4.2 Designing weather derivative under blockchain

Due to the purpose of empirical verification, the platform was built on an experimental basis (prototype) with the deployment performed only in Kovan and Ropsten testnets. According to Bambara & Allen (2018); Bashir (2020); Halaburda et al. (2022) these are networks used by developers to test potential smart contracts in a production-like environment prior to deployment on Mainnet. Commonly, these smart contract has been made using an ERC 20 standard and TruffleFootnote 8 framework. To provides an interaction environment, a a Graphical User Interface (GUI) has been developed. This is similarly to a webpage that can be invoked smart contract functionalities with MetaMaskFootnote 9 wallet. The webpage has been developed using a combination of JavaScript framework (React Js) and Ethereum framework (Truffle).

Concerning the governance of smart contract is structured like a decentralized autonomous organization (DAO)Footnote 10 or decentralized autonomous corporation (DAC). According to Bambara & Allen (2018), in essentially it replicates the legal trappings of a traditional company or nonprofit but uses only cryptographic blockchain technology for enforcement. In addition, smart contracts provide an application layer that, through APIs, bring real-world information to the blockchain, named Oracles (Bambara & Allen , 2018; Swan, 2015). Figure 6 displays the smart contract governance struct.

Fig. 6
figure 6

Smart contract governance struct

In technical terms, the smart contractFootnote 11 is written in Solidity language and subsequently deployed on Ethereum Virtual Machine. The fundamental functionalities was systematized as follows. The contract owner deploys the smart contract into EVM. Secondly, the contract seller chose the parameters (we suggest uses previous prices and parameters), and using a function “submitOption” creates options for one of five select cities. At same time, is created a struct named “option” (including unique ID, address of seller, parameters of strike, maturity, location, limit, tick, payoff and balance). This struct “option” that represent the HDD call option, has been stored into dictionaries “optionList” and can be list with “getOptionDetails” function. If the struct selected is “buyed”, the struct is deleted of the list and, simultaneously create another struct named “order” (including unique ID, address of seller, address of buyer, parameters of strike, maturity, location, limit, tick, payoff and balance) and insert into “orderList” dictionaries. Moreover, the function “getOrderDetails” returns the information about the available orders.

Table 3 Prices of HDD options (BRL)

In general terms, the architecture of decentralized autonomous application (DApp) based on blockchain combines the business rules coded on smart contracts with the interface (Frond-end) on a website or mobile app. In permissionless blockchain, every function implies costs for their execution (Mukhopadhyay, 2018; Mougayar, 2016; Swan, 2015). In Ethereum smart contract, this costs is called gas fee. In Table 3 presents the functionalities and cost for principal functions of the smart contracts of weather derivative’s platform. Table 4 shows the costs of smart contract.

Table 4 Execution and operational costs

Bambara & Allen (2018); Mougayar (2016); Tapscott and Tapscott (2016) points out that smart contracts can be integrated into business platforms (websites, mobile apps) pre-existent. Moreover, the proposed call option was focused to be negotiated in Over-The-Counter (OTC). All functions invoked in the contract were executed, and their return was observed. However, in some tests, the need to repeat the function that requests information from Oracle was observed. This may incur additional costs in the performance of the contract.

5 Discussion and conclusion

The IPCC (2018, 2019) climate models project global warming between 1.5 and 2 \(^\circ\)C until end of the century. Concerning this, Eskeland and Mideksa (2010) estimate a unit change in HDD results in a 0.3 kWh change in electricity consumption, and a unit change in CDD has an impact four times that size. Trotter et al. (2016) argues that the impact of weather uncertainty on Brazilian electricity demand is substantial. Regarding this, Schaeffer et al. (2008), points out that climate change can result in an increase of up to 9% in electricity consumption in the residential sector and up to 19% in the service sector, due to the increased need for air conditioning. This represents an increase of 8% over the total electricity consumption projected for Brazil in 2030.

Although the range of prices is coherent, there is, unfortunately, no way to compare these prices to actual prices because, to our knowledge, this study is the first to design this specific kind of options. However, the others financial instruments can be drawn using a same blockchain architecture. Moreover, the present study provided a (step-by-step) guide on how to implement low-complexity financial instruments using Smart Contracts. This is particularly valuable in Brazil (and other poor countries) where the provision of specific financial products may prove to be inaccessible. As well, financial institutions can benefit from a low-cost platform to expand their product portfolio. To write and deploy the contract on Ethereum testnets of a fully autonomous and functional smart contract, a cost of less than 300 dollars was estimated, which is extremely inexpensive when compared to the costs of a traditional business structure with employees and other costs. General results showed that, combining an emerging technology such as blockchain (smart contracts) with financial instruments little explored in the Brazilian market (climate derivatives) can be a viable solution to provides a hedge strategy against in electricity consumption, and weather-related losses.