EXAMENSARBETE INOM DATATEKNIK, GRUNDNIVÅ, 15 HP STOCKHOLM, SVERIGE 2021

Reducing for a linear and stable growth in a

Encourage spending, while providing a stable store of value over time in a decentralized network

GUSTAF SJÖLINDER

CARL-BERNHARD HALLBERG

KTH SKOLAN FÖR KEMI, BIOTEKNOLOGI OCH HÄLSA

Reducing volatility for a linear and stable growth in a cryptocurrency

Encourage spending, while providing a stable store of value over time in a decentralized network

Reducering av volatilitet för en linjär och stabil tillväxt i en kryptovaluta

Uppmana användning, samt tillhandahålla ett värdebevarande över tid i ett decentraliserat nätverk

Gustaf Sjölinder Carl-Bernhard Hallberg

Degree Project in Computer Engineering First cycle,15 ECTS Stockholm, Sverige 2021 Supervisor at KTH: Luca Marzano Examiner: Ibrahim Orhan TRITA-CBH-GRU-2021:047

KTH The School of Technology and Health 141 52 Huddinge, Sverige

Sammanfattning

Internet gav människor möjlighet att utbyta information digitalt och har förändrat hur vi kommunicerar. Blockkedjeteknik och kryptovalutor har gett människan ett nytt sätt att utbyta värde på internet.

Med ny teknologi kommer möjligheter, men kan även medföra problem. Ett problem som uppstått med kryptovalutor är deras volatilitet, vilket betyder att valutan upplever stora prissvängningar. Detta har gjort dessa valutor till objekt för spekulation och investering, och därmed gått ifrån sin funktion som valuta.

För att en valuta ska anses som ett bra betalmedel, bör den inte ha hög volatilitet. Detta är inte bara begränsat till kryptovalutor, då till exempel Venezuelas nationella valuta Bolivar är en fiatvaluta med historiskt hög volatilitet som förlorat sin köpkraft på grund av hyperinflation under de senaste åren.

Med detta i åtanke föreslår vi en ny kryptovaluta; Dynamic Network Token, vars uppgift är att reducera volatiliteten i en kryptovaluta genom att reglera utbudet dynamiskt med hjälp av burning och minting. Denna implementeringsuppgift är att minska hög volatilitet till fördel för en mer stabil och linjär tillväxt och samtidigt uppmana användare att använda Dynamic Network Token mellan varandra i nätverket.

Nyckelord

Kryptovalutor, Volatilitet, Burning, Minting, Dynamiskt, Värde, Investering, Stabil, Tillväxt

Abstract

The Internet provided humans a new way to exchange information digitally and has changed how we communicate. and have given humans a new way to exchange value over the internet.

With new technology, new possibilities arise, but not always without issues. One problem that has risen with cryptocurrencies is their high volatility, meaning that the currency has big price swings. It has made these currencies objects for speculation and investment almost exclusively, and therefore they have lost their functionality as a currency.

For a currency to be viewed as a good means of payment, it cannot be associated with high volatility. This is not only restricted to cryptocurrencies, as for example the Venezuelan Bolivar is a fiat currency with historically high volatility and has been losing its purchasing power due to hyperinflation in the recent years.

In regard to this we propose a new cryptocurrency; the Dynamic Network Token, which aims to reduce the volatility in a cryptocurrency by regulating the supply dynamically with burning and minting. The implementation of this functionality will strive to remove the high volatility in the token for the benefits of a more stable and linear growth, and at the same time encourage users to transact with the Dynamic Network Token between each other.

Keywords

Cryptocurrencies, Volatility, Burning, Minting, Dynamic, Value, Investing, Stable, Growth

Acknowledgment

To whom it may concern, the authors are grateful for the aid received during the work done in this thesis project.

- Vires in numeris.

Glossary

Bitcoin - The first cryptocurrency. It uses proof of work for validating transactions on its blockchain and has a hard cap.

Blockchain - A distributed digital ledger, storing blocks of transactions made with the native currency related to the specific blockchain. It is maintained and validated by nodes in a decentralized peer-to-peer network.

Burning - A method that removes tokens from the total supply.

Cryptocurrency - A digital currency recording transaction in a decentralized network using cryptography.

Ether - The native token of the protocol.

Ethereum - A cryptocurrency ecosystem powered by the EVM (Ethereum Virtual Machine) allowing for the deployment of smart contracts and decentralized apps.

Ethereum test-net - Ethereum development network used for developing and testing cryptocurrencies and other decentralized applications. Two examples are the Goerli and Ropsten test networks.

ERC20 - A token deployed on the Ethereum blockchain as a .

EVM - Ethereum Virtual Machine.

Fiat Currency - A physical currency such as the U.S dollar and Swedish krona controlled by the government.

Hard Cap - A cryptocurrency with a finite supply.

Market Cap - The total value of a fiat currency invested in an asset, often nominated in dollars. In cryptocurrencies the market cap is calculated by multiplying price with circulating supply.

Miner - A computer that solves a computational problem to verify transactions.

Minting - A method that adds tokens to the total supply.

OpenZeppelin - A library provider for developing cryptocurrencies.

Residual - A measurement of how far a data point is from a regression line.

Smart Contract - A self-executing transaction protocol with terms of agreement between a buyer and a seller being written in code that is deployed on a blockchain.

Stable Coin - A cryptocurrency, which is pegged to a fiat currency, i.e., has a 1:1 ratio.

Tether - A stable coin with a 1:1 ratio to the U.S dollar.

Token - A type of cryptocurrency representing an asset residing on a blockchain. It is fungible and tradable, meaning that one token is always equal to another making it suitable for transactions.

Table of contents 1 INTRODUCTION ...... 1

1.1 PROBLEM ...... 1 1.1.2 SUPPLY AND DEMAND ...... 2 1.1.3 VOLATILITY IN CRYPTOCURRENCIES ...... 3 1.1.4 HYPERINFLATION ...... 4 1.2 GOALS ...... 5 1.2.1 THE DYNAMIC NETWORK TOKEN ...... 5 1.2.2 CAUSES FOR VOLATILITY IN CRYPTOCURRENCIES ...... 6 1.2.3 CONTROL OF VOLATILITY IN CRYPTOCURRENCIES ...... 6 1.2.4 REGULATE GROWTH IN CRYPTOCURRENCIES ...... 7 1.2.5 SELECTION OF PARAMETERS ...... 7 1.3 DELIMITATIONS ...... 8 1.4 CONTRIBUTION OF AUTHORS ...... 9 2 THEORY AND BACKGROUND ...... 11

2.1 INFLATIONARY CURRENCIES ...... 12 2.2 DEFLATIONARY CURRENCIES ...... 12 2.3 BITCOIN ...... 13 2.4 ETHEREUM ...... 14 2.4.1 SMART CONTRACTS ...... 14 2.4.2 ERC-20 TOKEN ...... 15 2.4.3 BURNING AND MINTING IN AN ERC20 ...... 16 2.4.4 DEPENDENCY OF ETHEREUM ...... 17 2.5 ...... 17 2.6 BLACK-SCHOLES PRICING MODEL ...... 18 2.7 REAL WORLD USE CASES ...... 18 2.7.1 IMPLICATIONS OF DYNAMIC NETWORK TOKEN ...... 19 2.8 RELATED WORK ...... 20 2.8.1 BURN AND MINT IN CRYPTOCURRENCIES ...... 20 2.8.2 BURN MINT EQUILIBRIUM ...... 21 2.8.3 RELATED PRICE MODELS ...... 22 2.8.4 EVALUATION MODELS ...... 22 2.8.5 RELEVANCE OF RELATED WORK ...... 22 3 METHODOLOGY ...... 25

3.1 ROAD MAP ...... 25 3.2 LITERATURE STUDY ...... 26 3.2.1 WHITEPAPERS AND REPORTS ...... 27 3.2.2 DOCUMENTATION ...... 27 3.3 TOOLS ...... 28 3.3.1 OPEN-ZEPPELIN ...... 28 3.3.2 INTEGRATED DEVELOPMENT ENVIRONMENTS ...... 28 3.4 BURNING AND MINTING ...... 29 3.4.1 BURNING ...... 30 3.4.2 MINTING ...... 33 3.5 ALTERNATIVE METHODS FOR CONTROLLING THE VOLATILITY ...... 35 3.6 SIMULATION OF PRICE ...... 36

3.6.1 JAVA PROGRAM ...... 36 3.6.2 VOLATILITY AS STANDARD DEVIATION ...... 37 3.6.3 GEOMETRIC BROWNIAN MOTION ...... 37 3.6.4 BLACK-SCHOLES MODEL ...... 38 3.6.5 GEOMETRIC BROWNIAN MOTION PROGRAM ...... 39 3.7 ALTERNATIVE SIMULATION METHODS ...... 40 3.7.1 CONSTANT ELASTICITY OF VARIANCE ...... 40 3.7.2 SABR VOLATILITY MODEL ...... 41 3.8 LINEAR REGRESSION MODEL ...... 41 3.8.1 R-SQUARED AND RMSE ...... 42 3.9 TESTING OF THE TOKEN ...... 43 3.9.1 METAMASK AND ETHERSCAN ...... 43 3.9.2 TRUFFLE AND GANACHE ...... 44 4 RESULTS ...... 45

4.1 PRICE SIMULATION ...... 45 4.1.1 UNREGULATED PRICE ...... 45 4.1.2 REGULATED PRICE ...... 45 4.2 COMPARISON OF PRICE SIMULATIONS ...... 46 4.3 EVALUATION OF LINEAR REGRESSION ...... 49 4.3.1 LINEAR REGRESSION WITH REGULATION ...... 50 4.3.2 LINEAR REGRESSION WITHOUT REGULATION ...... 51 4.3.3 COMPARISON OF REGRESSION MODELS ...... 53 5 ANALYSIS AND DISCUSSION ...... 55

5.1 INTERPRETATION OF PRICE SIMULATIONS ...... 55 5.1.1 RELIABILITY OF SIMULATED RESULT ...... 55 5.2 ACCURACY OF REGRESSION MODELS ...... 56 5.3 IMPACTS OF THE DYNAMIC NETWORK TOKEN ...... 56 5.3.1 ECONOMICAL IMPACT ...... 56 5.3.2 SOCIAL AND ETHICAL IMPACT ...... 57 5.3.3 ENVIRONMENTAL IMPACT ...... 58 5.4 ASSUMPTIONS ...... 58 5.5 BLACK-SCHOLES FOR CRYPTOCURRENCIES ...... 59 5.6 CHOICE OF BURN AND MINT METHOD ...... 59 5.7 CHOICE OF SIMULATION METHOD ...... 60 5.8 REALISTIC PRICE SIMULATION ...... 61 5.9 RESTRICTIONS AND LIMITATIONS ...... 61 6 CONCLUSIONS ...... 63

6.1 FUTURE WORK ...... 63 7 REFERENCES ...... 65 APPENDIX A - LINEAR REGRESSION MODELS ...... 77 APPENDIX B - BLACK SCHOLES AND GBM CODE ...... 79 APPENDIX C - REMIX TRANSFER FUNCTION ...... 81

1 Introduction | 1

1 Introduction

This chapter intends to lay out the introduction of this paper as well as presenting the problem set to solve for this thesis project. In section 1.1, the problem regarding volatility will be presented along with crucial concepts related to the problem. Section 1.2 will formulate the goals of the work and section 1.3 will set the delimitations to reduce the workload to something comprehensible. To finish this chapter, section 1.4 will discuss the contribution of the authors.

A digital currency seems less unintuitive today than ever before. Humans have gone from using physical means of payments such as metals commodities or cash, to almost paying everything with credit cards [1].

With Bitcoin becoming a household name and the rapid growth of adoption for cryptocurrencies [2], the birth of a new form of transacting value emerges. This new way of transacting contrasts with the traditional credit or debit card, fully decentralized and uses the distributed ledger of a blockchain with no middle hand intervening, delaying, or taking a percentage on the transaction [3].

The functionality and capabilities of the blockchain and cryptocurrency technology seems promising, but it still is in its infancy and needs improvement.

As with most new technologies, for example as with the electric car manufacturer Tesla, their cars were more inclined to catch on fire in the early days than they are now. According to their vehicle safety report, the rate of a fire related accident has dropped from one each 170 million miles to one each 205 million miles between 2018 and 2020 [4]. This is a good example of how new technologies may experience problems in the beginning, but still have great use cases which will improve and bring benefits for the world in the long run.

This is the case with cryptocurrencies as a means of payment. Bitcoin, which was intended as a means of payment or “electronic cash” [5], is almost solely viewed as a store of value because of its deflationary properties [6].

1.1 Problem

In recent years, the popularity and interest in cryptocurrencies has grown rapidly and it is not slowing down. As this asset class is in its infancy, its place in society is not clear nor well defined. Today we view cryptocurrencies as currencies and not as

2 | 1 Introduction securities or commodities [7], which put them in the same category as any other fiat- currency such as the Swedish krona or the U.S dollar.

But even though cryptocurrencies are viewed as a form of currency, they share many attributes of commodities and securities, as they are subject to volatility and price speculation. In most cases the volatility is greater than that of commodities like gold or oil [8]. This creates a problem for the asset class, as it is not a property suited for a currency.

According to Gresham's Law [9], bad money will drive out good money in a society. This means that currencies with the same face value in a society will experience a higher circulating supply (i.e., higher spending) of the currency that is viewed as less good, as the good money will be more desirable to keep [10]. This principle can in a way be applied to cryptocurrencies against fiat currencies when it comes to spending because of the volatility associated with cryptocurrencies. This is because it creates an opportunity to capitalize on volatility to the upside, as well as lose purchasing power if the cryptocurrency experiences volatility to the downside.

To create more of an equilibrium and to get users of cryptocurrencies to spend the currencies, the volatility must be removed or reduced significantly to encourage spending. For example, if you look at Bitcoin which as of 8th of April 2021, is the number one cryptocurrency by market cap [11], it has gone from being created with an intention to be used as a means of payment between two parties without a middle hand [5], to now be viewed as a store of value similarly to gold or an investment opportunity. This is a direct consequence of its high volatility to the upside and has led to less spending and more holding and trading of the asset.

Another consequence is when the volatility is high to the downside, as Bitcoin loses its purchasing power. Meaning that the holders of Bitcoin cannot buy as much as before due to high drops in value compared to its fiat pairing. The result of volatility to the upside and the downside is the discouragement of spending, as the stability of value becomes speculative and unpredictable.

1.1.2 Supply and demand

Volatility arises consequently from an uneven balance between buyers and sellers in any given asset. When there are more buyers than sellers, the price goes up and vice versa. This phenomenon is what is known in economic theory as supply and demand, and it is the standard model used to evaluate the price of any commodity or asset of today. The supply and demand theory states that; if the demand is high, but the supply is scarce or getting scarcer with the same demand, it will increase the price of the asset in the upwards direction. The same goes for the opposite; if the supply is 1 Introduction | 3

high and the demand is low or the demand is low and the supply is increasing, this will create an uneven balance of the price in the downwards direction [12].

When it comes to commodities like gold for example, the supply can be viewed as limited. This is because the process of extracting gold is not only time consuming but also hard due to the rarity of the metal [13].

This restriction of supply is one of the main factors making gold historically looked upon by most people and societies as a store of value or an investment [14]. As the supply is low and the demand is high, this creates a rise in price.

1.1.3 Volatility in cryptocurrencies

Bitcoin is known to be an asset associated with high volatility. In 2017 it experienced a 1318% increase in price, making an unforgettable impact in the financial world when reaching its high of 19114 U.S dollars in late 2017.

Figure 1.1: Chart of Bitcoin in U.S Dollars between Sep-16 to Jan-18, Source: Thompson, 2021.

In mid-2018 the price of Bitcoin dropped 72.6% from its peak, creating a yearly range from 16477 down to 3314 dollars. As can be seen, both the positive and negative years when it comes to price for Bitcoin can be considered extremes. Even the average annual return from Bitcoin is 408.8%, which also can be considered extreme [15].

Bitcoin is not the only cryptocurrency experiencing this extreme price volatility. Both the number two and three cryptocurrencies Ethereum and Binance Coin, behave in the same way in regard to volatility [16] which can also be seen in figure 1.2. For instance, Binance Coin, which is a relatively young currency in comparison to Bitcoin, has experienced an increase in price like Bitcoin in its infancy. In the span

4 | 1 Introduction of three years, Binance Coin has had a 4635% increase in price which furthermore proves the volatility in the cryptocurrency market [11].

Figure 1.2: Chart of Ethereum and Binance Coin’s volatility between Feb-17 to Mar-20. Source: Cryptoz.ai, 2018.

1.1.4 Hyperinflation

Cryptocurrencies are custom to volatility as described in section 1.1.2. This can be seen on the price over time graphs for most of the cryptocurrencies [17]. But cryptocurrencies are not the only currencies experiencing high volatility, as traditional types of fiat currencies can experience what is known as hyperinflation.

All fiat currencies of today experience inflation to some degree, due to the government's ability to print more money. This means that the purchasing power of the currency weakens over time, resulting in a price increase of goods and services [18]. Hyperinflation can be viewed as inflation, with the main difference being the rate of the weakening of the currency. If the rate of inflation grows with more than 50 percent per month, the currency is experiencing hyperinflation [19].

A good example of hyperinflation in a fiat currency would be the Bolivar, which is the national currency of Venezuela. In comparison to the U.S dollar, the Bolivar has gone from being worth 0.232558 per one dollar in 2012, to zero per one dollar as of April 20th, 2021 [20].

1 Introduction | 5

Figure 1.3: 10-year chart of the Bolivar in comparison to the U.S Dollar. Source: Xe.com.

This is not exclusive to the Venezuelan bolivar, as there have been many cases of hyperinflation in history. For example, the Zimbabwe dollar experienced it a decade ago, peaking out in 2008, resulting in the discontinuation of the local currency the Zimbabwe dollar [19]. When a nation experiences hyperinflation, the usual response is that the people seek to store their wealth in some other currency, commodity, or asset. But as no fiat currency is immune to inflation and commodities or assets do not provide a good way to transact in day-to-day life, the cryptocurrency developed in this thesis can provide a solution to the problem.

1.2 Goals

This section intends to present the goals for this thesis project, giving a clear insight into what needs to be done when developing the cryptocurrency in regard to the problem of volatility postulated in section 1.1.

In 1.2.1 the presentation of the token developed called the Dynamic Network Token will be laid out, and by narrowing down the theoretical work needed to four specific topics presented under 1.2.2, 1.2.3, 1.2.4 and 1.2.5, the goals of the thesis become more tangible for the development of the cryptocurrency.

1.2.1 The Dynamic Network Token

The practical goal for this thesis is the development of a cryptocurrency that will be called Dynamic Network Token or in short, DNT. This development will be done with the aim of trying to solve the problem of volatility in cryptocurrencies described in 1.1. For the development to succeed, the topics brought up in the other subsections needs to be addressed and studied. If these topics can be answered and implemented

6 | 1 Introduction in the Dynamic Network Token, the practical goal of creating a less volatile cryptocurrency will be achieved.

To summarize the goals that needs to be achieved in the implementation of the Dynamic Network Token, which are separately described in the subsections 1.2.2, 1.2.3, 1.2.4 and 1.2.5, the following questions and its relevant concepts must be understood and studied:

● What causes the volatility in cryptocurrencies? ○ Hard caps ○ Supply and demand

● Can the volatility be controlled in a cryptocurrency? ○ Burning ○ Minting

● Is it possible to regulate the growth so it becomes more linear and stable? ○ Linear growth ○ and geometric Brownian motion ○ Burn-to-mint ratio

1.2.2 Causes for volatility in cryptocurrencies

For the project to succeed, the question of what factors causing the volatility in cryptocurrencies must be derived. Concepts such as supply and demand discussed in section 1.1.2, in combination with concepts such as hard caps and deflationary currencies described in 2.1, will bring more clarity to the causes behind the volatility.

The goal of identifying the reasons behind the volatility will make it possible to focus on controlling these aspects when implementing the functionality for the Dynamic Network Token. This results in us understanding regarding what creates or does not create the volatility in other cryptocurrencies.

1.2.3 Control of volatility in cryptocurrencies

As cryptocurrencies can be viewed as programmable money [21], the reduction of the volatility will be achieved through taking the methodological approaches using functionalities such as minting and burning in the smart contract protocol governing the Dynamic Network Token. Minting and burning itself is adding and subtracting tokens from the total supply of the token, which will create a possibility to regulate the price of the token. 1 Introduction | 7

Minting implies as with traditional central banks, following the monetary banking system [22], the printing of money. In the case for a cryptocurrency, the minting implies adding coins or tokens to the total supply.

Burning is the concept of reducing the total supply by sending coins or tokens to a “black hole” address [23], making these coins or tokens non-retrievable. This will create a regulation in the supply of the currency, making it scarcer.

By the knowledge gained from studying causes for volatility in other cryptocurrencies as mentioned in section 1.2.1, the practical focus can be targeted at developing functionality preventing volatility in the Dynamic Network Token.

1.2.4 Regulate growth in cryptocurrencies

To regulate the price growth and to reduce the volatility, a model for achieving this must be created for the Dynamic Network Token. The goal of creating linear growth for the price of the token will be achieved by controlling the volatility as mentioned in 1.2.2.

To see if the functionality of the algorithm for minting and burning tokens works, development of a Python script implementing the geometric Brownian motion formula using the Black-Scholes model [24], simulating price growth over time and studying the results obtained is a good approach. Implementing the script with the use of geometric Brownian motion came to be because of its use in the traditional financial markets for pricing options [25], giving an idea of where price is going based on the three factors of starting price (s0), (�) and volatility (�). By studying the results with different values for these three parameters; starting price, interest rate and volatility, a better understanding of how the price will behave in different scenarios can be derived. This will give insights regarding how the price growth will hypothetically look like over time and if the burn-to-mint ratio is sustainable.

1.2.5 Selection of parameters

The different parameters needed for the geometric Brownian motion program utilizing the Black-Scholes model for price simulation, will govern how the price and volatility will behave in the simulation. This section therefore intends to present the selection process of these parameters.

The first parameter is the starting price or s0. Selecting the starting price can be done

8 | 1 Introduction somewhat arbitrarily, because it is not known in the simulation stage what the price will be when deploying the Dynamic Network Token. It is also the parameter which sets the starting point for the of the Brownian motion, thus only dictating the start of the walk and will not interfere in the studying of volatility.

As the Dynamic Network Token does not yield interest simply by holding the token in a standard cryptocurrency wallet, the interest rate parameter or � will be chosen based on the average yield from Bitcoin, Ethereum and Tether as of the 26th of April 2021, from holding the cryptocurrency in an interest account with the company BlockFi [26].

Standard deviation is seen as the statistical measure of volatility in a market or asset [27]. Therefore, the volatility parameter should be calculated from the standard deviation of price over iterations. To obtain this parameter, an iterative Java- program will be developed and then the standard deviation can be derived from the total number of transactions from the iteration.

1.3 Delimitations

The delimitations set in the thesis intend to restrict the theoretical work to the studies of a few cryptocurrencies and concepts such as Ethereum's ecosystem, smart contracts and the ERC20 token standard [28].

The ERC20 standard offers a secure and interoperable way to implement a cryptocurrency with well documented and audited libraries provided by OpenZeppelin [29]. This will reduce the practical work surrounding the development, so it can be more directed at implementing functionality handling the volatility in the Dynamic Network Token.

The following bullet points provide a summary of the delimitations set:

● Deeper studies of other cryptocurrencies will be restricted to: ○ Bitcoin ○ Ethereum ○ Tether

● Cryptocurrencies with burning and minting will be restricted to: ○ Binance Coin ○ Helium ○ Factom

| 9

● Development of the currency will follow the ERC20 standard for minimizing the risks associated with un-audited code.

● Development using the ERC20 standard will also reduce the amount of code to be written, so the focus can be targeted at implementing the functionality solving the postulated problem.

● Dependencies and libraries used during development will solely come from OpenZeppelin, as they provide the most secure and audited libraries in the cryptocurrency space.

1.4 Contribution of authors

The distribution of the workload between the authors has been divided equally, from writing the code, to the testing and writing the report. During programming of the Dynamic Network Token, the method of couple programming was used. This method makes it easier to detect errors in the code, as one person programs and the other supervises the code live. It also makes it easier to find better solutions, as a discussion on implementation can be had simultaneously as programming.

For testing of the token, both the authors have been active as users of the token in the network. Gustaf has been deploying the smart contract on a Ethereum test-net, mainly Ropsten and Goerli which are the names of two of the most common test- nets for developing, then sending tokens to Carl-Bernhards wallet on the same test- net. This made testing of the practical functionality of the token possible, as we could evaluate if the token behaved as we wanted.

Work that was done separately was the detailed study of different coins. As Gustaf had a lot of prior experience using the Ethereum network and transacting ERC20 tokens, he focused on the details of Ethereum, Ethereum’s whitepaper, its ecosystem and the ERC20 standard. Carl-Bernhard focused on the study of the stable coin Tether, its whitepaper, and its stabilization mechanisms, as it was needed for a better understanding of how a low to non-volatile cryptocurrency can be created.

10 |

2 Theory and background | 11

2 Theory and background

This chapter intends to lay out the theory and background regarding the problem with volatility in cryptocurrencies and how it came to be, as well as presenting the theoretical framework proposed for the solution. The choice of the coins mentioned in this chapter has been carefully selected because of their respective functionality, contributing to the implementation in this thesis project.

The first two sections 2.1 and 2.2, intend to explain the two main types of currencies in use today. These are inflationary currencies, which are the most common type of currencies used by any government today in the form of fiat-currencies [30]. The other type of currencies are deflationary currencies, which are often not only currencies, but rather a means of payment.

In section 2.3, a summary regarding the first cryptocurrency Bitcoin, inflationary currencies and deflationary currencies will be presented. Bitcoin was chosen because it has the most history and has some properties of a deflationary currency i.e., it has a hard cap and a regulated supply due to the halvening mechanism [31]. It has also experienced high volatility historically, making it the most suitable deflationary and volatile coin to study.

In section 2.4, the Ethereum cryptocurrency and ecosystem will be presented, along with the concept of smart contracts and ERC-20 tokens. Ethereum was chosen for its ability to host another token, making it suitable as a platform for our project, as it reduces the development time and provides greater interoperability between our token and other ERC-20 tokens.

Section 2.5 presents the concept of a stable coin and Tether, the stable coin issued by Tether Limited, which is of current time the most used stable coin. The choice of studying a stable coin seemed to be the most natural contrast to a highly volatile coin such as Bitcoin, as it is a coin with low volatility in comparison.

Under section 2.6 the Black-Scholes model is presented, which is a model used for pricing of stocks and options. This model was chosen because of its wide usage in traditional finance and wide recognition.

Section 2.7 will address the potential use cases for the Dynamic Network Token and what impacts it could have in the real world. These use cases being that it is inflationary resistant, provides a vehicle for investment and is fair in regard to its users.

12 | 2 Theory and background

In the last section, 2.8, the related work surrounding the choices made for the methods implemented will be acknowledged. This includes the studies of other cryptocurrencies, price simulation models and evaluation models.

2.1 Inflationary currencies

Today every country is using some form of physical cash or currency backed by a government [32]. These currencies are known as fiat-currencies and share two important aspects; centralized governance and are by nature inflationary.

In economics, the concept of inflation is simple. It can be viewed as a growth of the general price level, resulting in less purchasing power for any given currency. A currency experiences inflation when more of it is added to the circulating supply, resulting in a devaluation of the currency itself [18]. As the process of creating new fiat currency is relatively easy and does not have the same uncertainties as for example gold mining [33], the possibility to add fiat currency is quite simple in comparison.

Figure 2.1: Graph of the total money supply of the U.S dollar from 1959 to 2021. Source: fred.stlouisfed.org

2.2 Deflationary currencies

The most known asset that can be used as means of payment and can be considered deflationary is gold. Throughout history, gold has been one of the main metals used in coins because of its rarity, practicality, and sustainability against the elements [34]. This was what made it valuable and accepted among different societies.

What makes gold deflationary is the long and hard process related to the extraction of the precious metal [33], making the minting of new gold to the total supply an 2 Theory and background | 13

uncertain and difficult process. As the chance of finding gold makes the metal scarce, it is considered an asset that has a finite supply or a hard cap.

Bitcoin is another example of a currency with deflationary properties [31]. As opposed to traditional currencies (fiat-currencies), Bitcoin has a built-in mechanism in its protocol known as the halvening, that cuts the reward that miners receive for each block that has been mined in half. Miners are the nodes validating transactions through solving cryptographic puzzles, keeping the Bitcoin blockchain and its distributed ledger secure [35].

This mechanism impacts the supply in a predictable way and reduces the adding of the circulating supply, i.e., slowing down the growth rate for Bitcoins in circulation [36]. The effect of the halvening results in a deflationary behaviour, making the supply of bitcoins less available over time.

Bitcoin also has what is known as a hard cap, meaning that there will never be more than a certain number of coins in circulation. This function in tandem with the halvening, contributes to deflation as the supply gets scarcer and there is only a finite number of coins, resulting in demand only being the factor that can drive the purchasing power [37].

2.3 Bitcoin

In the ashes of the financial crash of 2008, Bitcoin emerged seemingly from nowhere as a means of payment with the vision to be resistant against inflation and centralized governance. In Bitcoins whitepaper, it is stated in the abstract that the idea of Bitcoin is to act as a pure peer-to-peer electronic means of payment to rule out the middle hand, i.e., financial institutions [5]. Bitcoin provides an optional way to exchange value, but as its protocol is programmed to be deflationary in regard to supply, there is no encouragement to spend as there would be in an inflationary currency losing its purchasing power over time. Therefore, Bitcoin has become a store of value rather than being a means of payment which was the intention of Satoshi Nakamoto when presenting Bitcoin’s Whitepaper in 2008.

The evolution for Bitcoin has thus gone from being intended as an electronic cash system, to a currency used as an asset similarly to gold. And by every means, the two assets share many attributes such as: it has a finite supply, i.e., scarcity, it is fungible and divisible, thus it can be used as a means of payment and its supply behaves deflationary. This has led to the minting of the terms “Gold 2.0” and “digital gold” [38] as reference to Bitcoin because of its similarities to gold.

14 | 2 Theory and background

2.4 Ethereum

Ethereum in comparison to Bitcoin, is vastly different. The intention the Ethereum initiative had with proposing the idea for Ethereum in 2013 was to create an alternative protocol for building decentralized applications where anybody could execute scripts, deploy a smart contract containing immutable code and run decentralized applications on the Ethereum Virtual Machine.

In Ethereum’s whitepaper, it is stated that the design behind Ethereum is intended to follow five core principles. The first principle, simplicity, is Ethereum’s way of saying that the protocol should be as simple as possible and that optimization that adds complexity should only be implemented if it provides substantial benefit for the network.

The second principle that is stated in Ethereum’s whitepaper, universality, is the idea of providing a programming language which a programmer can use to construct any smart contract or transaction type that can be mathematically defined.

The third principle, modularity, where Ethereum’s protocol is designed to be as modular and separable as possible. This leads to better security and less need for modification for the application stack when one has modified a small protocol.

The fourth principle, agility, is there for constant changes in the Ethereum protocol if it is beneficial for the network. In short, the details of the Ethereum protocol are not set in stone.

The final principle, the non-discrimination principle simply means that anyone can use the protocol without restriction or prevent specific categories of usage. For example, a programmer could run a program that infinitely increments a variable by one in an infinite loop if the programmer pays the per-computational-step transaction fee in Ether [39].

2.4.1 Smart contracts

Smart contracts can be viewed as a protocol or program, governing transactions by executing them according to the terms defined in the contract.

The objective of a smart contract is to rule out any third-party governing transactions, i.e., a trusted intermediate who has the role to create trust between the two parties transacting. As every transaction is stored publicly and all users oblige to the same rules in the protocol, smart contracts create a way of transacting between arbitrary participants without the need of trust from a third party. 2 Theory and background | 15

To execute a smart contract, it must be compiled and stored on a blockchain. Often associated with the compiling and storing of the smart contract on a blockchain, is a transaction fee. In the case with Ethereum, the smart contract will be executed on the EVM after the payment of this transaction fee made in Ether. This transaction fee is also known as “gas” [40].

2.4.2 ERC-20 token

The ERC20 (Ethereum Request for Comments 20) token is a fungible Ethereum based token, meaning that one token is always equal to another token from the same smart contract, creating a means of payment when utilizing the token between two parties.

To be viewed as an ERC20 token, it must have some standard functionality related to it. This incorporates the following functions and events:

Functions needed for an ERC20 token:

● function name() public view returns (string) ● function symbol() public view returns (string) ● function decimals() public view returns (uint8) ● function totalSupply() public view returns (uint256) ● function balanceOf(address _owner) public view returns (uint256 balance) ● function transfer(address _to, uint256 _value) public returns (bool success) ● function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) ● function approve(address _spender, uint256 _value) public returns (bool success) ● function allowance(address _owner, address _spender) public view returns (uint256 remaining)

Events needed for an ERC20 token:

● event Transfer(address indexed _from, address indexed _to, uint256 _value) ● event Approval(address indexed _owner, address indexed _spender, uint256 _value)

The ERC20 standard also provides interoperability between different ERC20 tokens, as they all are built upon the Ethereum blockchain, making it easier to interact with different types of ERC20 tokens [28].

16 | 2 Theory and background

2.4.3 Burning and minting in an ERC20

The ERC-20 token is the standard for smart contract tokens deployed on the Ethereum blockchain. By implementing the functions and events mentioned in section 2.4.2, a token can be defined as an ERC-20 token.

The ERC-20 standard thus creates a possible base for every token in the Ethereum ecosystem, making it possible to transact [41]. The ERC-20 standard alone will not make it possible for a token to become volatility resistant, therefore the concepts of burning and minting must be added to the implementation.

Burning and minting are two concepts related to smart contract development, making it possible to control the number of tokens in existence. Burning is the functionality that will reduce [42] the number of tokens and minting is the functionality creating new tokens, adding them to the supply in the same way as traditional mints add to the supply of a fiat currency [43]. The implementation of burning and minting is something that is unique to every token, as the developer(s) must come up with algorithms or protocols for the functionality suiting the goals for their specific token.

It is common to implement burning so it will interact with the transfer function of the ERC-20 standard. In this way, burning can be achieved when transferring a token or some conditions regarding the transfer(s) of ERC-20 tokens.

When a burn is called in the protocol of the smart contract, the number of tokens set to be burned will be sent to the 0x0 address, also known as the “black hole address” [23]. This address can be viewed as an address that is consuming ether and tokens, never to be retrievable again, making it a “black hole”.

Figure 2.2: Overview of the 0x0 Address as of 28th of April 2021. Source: Etherscan.io.

2 Theory and background | 17

Minting is the opposite of burning, as it adds new tokens to the supply. Every smart contract, and therefore every ERC-20 token, must do at least one minting when the contract is deployed [44]. This will create the initial supply, setting the balance of the wallet address deploying the smart contract equal to the amount minted.

As minting new tokens to the supply of a cryptocurrency is in practice the same thing as governments printing fiat currency, most cryptocurrencies will not use minting functionality embedded in the protocol as it will increase inflation of the token.

2.4.4 Dependency of Ethereum

As all ERC20 tokens are deployed as smart contracts on the Ethereum blockchain, the dependency of Ethereum is inevitable. This implies that the functionality for any ERC20 relies on the Ethereum project and its ability to function properly.

If the Ethereum network would stop working, become insecure or the value of the Ether in dollars would go to zero, the miners on the Ethereum network would no longer have an incentive to keep the network running because there would not be any value in the reward earned from fees. This would result in exposure to problems such as double spending which would devalue the network or even destroy it [45]. If things like an insecure Ethereum blockchain or a low to zero value of ether in dollars would occur, all ERC-20 tokens would be affected as they reside on the Ethereum blockchain. It could even result in making the transacting of any ERC20 token impossible, thus removing the value in the tokens.

Alas Ethereum makes it easier for the deployment of a cryptocurrency with great interoperability potential, but at the same time it also creates a dependency where faith in the value of Ether is necessary.

2.5 Tether

Tether Limited is a company behind the Tether cryptocurrency whose purpose is to have a one-to-one ratio with the U.S Dollar in contrast to Bitcoin whose vision is to be resistant against inflation and centralized governance. In their proposal of the Tether cryptocurrency, the main benefit is the ratio to the dollar and the possibility for world assets to migrate to the Bitcoin blockchain since Tether is running on top of Bitcoin’s blockchain via the Omni Layer protocol [46].

Since it is hard to match the dollar with a one-to-one ratio, Tether states in their whitepaper that proof of reserve is the way to ensure a one-to-one ratio. This means that for every US Dollar transferred to Tether Limited’s bank account, they will issue

18 | 2 Theory and background the same amount of dollars transferred into Tether. This ensures a one-to-one ratio to the dollar and makes Tether a so-called “stable coin” [47].

However, the proof of reserve method does not come without any problems that need to be solved. In Tether’s whitepaper it is stated that four weaknesses have been identified and handled by Tether Limited to ensure the security of their assets. Tether Limited, the company that issues Tether’s could go bankrupt but the assets that are in circulation would still be safe and redeemable. Their bank could go insolvent, but Tether’s assets are insured by the banks that they use, as the banks accept Tether’s business model. The most dangerous weakness with Tether is the fact that their bank could freeze or confiscate the funds which would lead to Tether’s being worth absolutely nothing [48].

2.6 Black-Scholes pricing model

The Black Scholes model is a model for pricing options and stocks in the traditional financial markets [24]. Since its inception, it has become a standardized way to predict and simulate the price of different assets. The model itself makes use of what is known as a geometric Brownian motion [25] to create a continuous process. Using a Brownian motion or wiener process in combination with the parameters � (interest rate) and � (volatility), the Black-Scholes model makes it possible to simulate the behavior of a financial asset such as an or a stock.

The model provides a way to simulate and predict prices of assets in the financial markets, it is used heavily by economists and large companies around the world. For example, PricewaterhouseCoopers (PwC) stated in their Stock Compensation report from 2017 that over 82% of large companies solely relied on the Black-Scholes model for predicting prices of stock compensations [58].

2.7 Real world use cases

Postulated in section 1.1, the problem of volatility is not only restricted to cryptocurrencies. A fiat currency experiencing hyperinflation, is also experiencing high volatility. In 2.1 and 2.2 the concept of inflationary and deflationary currencies was postulated. These concepts are somewhat opposites of each other. The inflationary approach taken in fiat currencies diminishes the purchasing power of a currency by adding more of it, i.e., adding to the supply.

In contrast, a deflationary currency like Bitcoin regulates the supply by making it scarcer with mechanisms such as the halvening and by having a hard cap. This brings up a dilemma. That in theory, deflationary money should be preferred over 2 Theory and background | 19

inflationary types of money, as it increases the purchasing power over time. But the problem that arises with deflationary money is that it demotivates spending in accordance with Gresham’s law [10] and by the definition of deflation, as it will presumably be more valuable over time.

As the goal of the Dynamic Network Token is to remove high volatility coming either from deflation or inflation, this creates a real-world use case where users get the best of the two; a growing value over time with incentive to spend the token as a means of payment.

2.7.1 Implications of Dynamic Network Token

The Dynamic Network Token which is proposed as the solution to volatility within cryptocurrencies can be used in several ways. Not only as a means of transacting to other entities in the network or store for financial gain. But more importantly it could be used as an exchange of value without being affected by inflation and deflation.

Stated in 1.1.3, the problem with the national currency of Venezuela experiencing hyperinflation, could seek a solution in the use of the Dynamic Network Token or a currency with the same functionality, as it is inflation resistant. The usage of such a currency would result in slowing, reducing, or removing the possibilities of hyperinflation, bringing back the purchasing power to the Venezuelan people. By exchanging their national fiat currency for the Dynamic Network Token or begin the development of their own national digital currency with the same properties as the Dynamic Network Token, they can avoid losing purchasing power.

Besides looking at the possibilities of helping troubled countries with their inflation, the project also provides investors seeking to gain capital an opportunity by holding the Dynamic Network Token. Even though the token’s utility is highly based on using the token as a currency, investors can still use it as a means of capital gains by holding the token until they are satisfied with the results.

Since the Dynamic Network Token will be built upon its community, implementations within real world scenarios are endless depending on what the community needs and what it wants to be developed. In case the community wants to use the token for online purchases, it can be developed for the satisfaction of the community.

20 | 2 Theory and background

2.8 Related work

This section intends to bring up the related work. Section 2.8.1 will address related work regarding the implementation of burning and minting in other cryptocurrencies, section 2.8.2 will address other hybrid solutions using burning and minting. Section 2.8.3 will bring up related work regarding other pricing models that could have been used for simulating price, and 2.8.4 will acknowledge relevant work done regarding evaluation models for cryptocurrencies. Lastly, the relevance of this related work will be stated in section 2.8.5.

2.8.1 Burn and mint in cryptocurrencies

Prior to this work, research in the cryptocurrency field regarding burning and minting was done. The focus of the research targeted projects using this type of functionality, and how these projects had implemented it. With different goals and ambitions, projects use different approaches to this area.

The projects chosen for studying these functionalities are Binance coin and the Helium token. Both projects are considered well established and have drawn a lot of capital to them and reside in the top 100 rankings by market capitalization as of April 2021 [11]. Helium was chosen mainly for its minting functionality, while Binance coin was chosen for its unique approach to burning.

Other projects under consideration for the studying of the functionality were and Safemoon Protocol. Dogecoin was considered as it mints 10,000 new coins for each block mined, which leads to approximately 14 million new coins being minted every day [49]. Safemoon Protocol was considered due to its burning fee functionality that both locks liquidity and distributes a percentage of the transaction to all its token holders.

However, these were disregarded due to the projects being considered unserious. For example, Dogecoin developers have recently started working on the project again due to its media attention and its creator admittingly says it was created as a joke [50]. Dogecoin also as of May 2021 has the highest volatility of all cryptocurrencies [51], making it very unstable and therefore also making the study of the mintings impact on volatility hard. In the case with Safemoon, it has functionality implemented preventing some users in the network from paying the burning fee when transacting, making it an unfair network and is therefore unserious [52].

Binance coin is the native coin of the Binance blockchain, whose approach to burning their coins is interesting. From the initial coin offering of Binance coin, the company announced that they would burn 50% of its total supply by buying back Binance coins 2 Theory and background | 21

and then burning them. In their 2021 Q1 report, Binance had burned around 13% of its total supply which was equivalent to 426,304,000 U.S Dollars [53]. By studying how the price was affected after each burn and over time with more iterations of burns, knowledge regarding burning and its long and short-term effects on price could be obtained for Binance coin.

Figure 2.3: Chart over BNB burned vs price between July-17 and Sept-19. Source: Bitcoinsuisse.com.

Helium mints its tokens based on a basic algorithm which starts minting 5 million tokens each month and every second year, this amount is cut in half [54]. This implies that Helium’s inflation rate will decrease 50% every second year until the minting is no longer affecting the price. By studying how the price reacts to this, a better understanding on how Heliums approach to minting can potentially decrease the volatility could be achieved.

2.8.2 Burn mint equilibrium

BME or the Burn Mint Equilibrium, is a model for burning and minting used by a few cryptocurrency projects such as Factom and Helium [55]. The idea behind the BME is that any goods or services in a crypto network should be bought with coins or tokens with the sole purpose of burning. When the amount is agreed upon, the buyer burns the amount of so-called value-seeking tokens. This is with the knowledge that the amount will be minted in so-called payment tokens, and these can then be sent to the service or product creator [56].

22 | 2 Theory and background

Factom was the pioneer of BME by implementing it in its protocol. All services offered in the Factom ecosystem are settled with the buyer burning the agreed amount for the service. Each month the protocol mints 72933.12 new tokens which are distributed to the validators providing the services offered in the network [57].

2.8.3 Related price models

The constant elasticity of variance or CEV model, is one of the earliest contestants to the geometric Brownian motion and Black-Scholes, introduced by Cox and Ross in 1976 [59]. The model can be viewed as an extension of the geometric Brownian motion [60], making use of another to predict options and stock prices. The use of the CEV model has become popular in the calculation of theoretical prices, sensitives, and [61].

In , the Stochastic Alpha Beta model, also known as the SABR model. The purpose of the model is to capture the in derivatives markets was proposed and developed by Patrick S. Hagan, Deep Kumar, Andre Lesniewski and Diana Woodward in 2002 [62]. This model has become the dominant model for interest-rate derivatives markets due to the underlying forward rate and the dynamic volatility. This is essential to capture the volatility smile in these markets which makes it useful [63].

2.8.4 Evaluation models

In a study done by Yang [64], a linear regression model was developed to study the price of Bitcoin. One part of this study focused on the impact total supply had on the price. To evaluate the results, metrics such as R-squared and standard error of residuals were used. This yielded insights in how Bitcoin price behaved in regard to supply and how accurate the results were.

In another paper published by the International Journal of Engineering & Technology [65], a regression-based analysis was done on Bitcoin. The analysis concluded high accuracy when using linear regression to predict the price of Bitcoin, using evaluation metrics such as R-squared and root mean squared error or RMSE.

2.8.5 Relevance of related work

The relevance of the related work can be viewed as useful for the development of the Dynamic Network Token. The study of other cryptocurrencies with burning and minting implemented, is needed for the understanding of this kind of functionality.

| 23

For the pricing models, the relevance is that of the ability to simulate price behavior. This is needed as a tool for testing the implemented burning and minting to see if it has an impact on the volatility.

Lastly, the relevance for the evaluation models is due to the work regarding evaluating bitcoin based on different metrics such as R-squared and root mean squared error using linear regression. The results can then be used to determine the accuracy of the implemented burning and minting.

24 |

3 Methodology | 25

3 Methodology

This chapter will present the methods and tools used to achieve the goals postulated in section 1.2. The choice of methods used to gather the necessary information regarding the creation of a cryptocurrency and how and if it is possible to reduce the volatility.

Section 3.1 of this chapter will present the road map of the project, giving a clear overview of the work from start to finish. In section 3.2 a layout of the pre-study and the methods used to conduct it will be presented. For section 3.3 and its subsections, a presentation of the tools used and motivations to the use of the tools will be acknowledged. This includes libraries used for the implementation of the cryptocurrency, choice of integrated development environments (IDEs) when developing and platforms used for testing functionality of the currency. Section 3.4 intends to describe the unique implementations and the math used behind the burning and minting. Section 3.5 will address other potential methods for controlling volatility.

Section 3.6 describes how the implementations of burning and minting can be used to simulate price with and without this functionality, and 3.7 will describe alternative simulation methods. Linear regression models will be described in 3.8 and lastly, section 3.9 will bring up the testing of the Dynamic Network Token, with the burning and minting implemented.

3.1 Road map

The method of using a road map to get a clear overview of the project and its different timeframes, makes it easier to structure the work. By dividing the goals from section 1.2 into partial goals along a road map, the work can proceed more straightforwardly and become more organized.

Beginning with a literature study gathering knowledge regarding other cryptocurrencies, fiat currencies and concepts such as inflation and deflation, the first steps toward the creation of DNT could be taken. By extracting what reasons there are causing volatility or not in the different types of cryptocurrencies such as Bitcoin, Ethereum and Tether along with the study of fiat currencies experiencing hyperinflation, a foundation for the practical work could be laid out.

Continuing the theoretical path, the next step revolves around reading documentation about tools and if they are suitable for implementation in this project, i.e., if they are a good match for solving the problems based upon the

26 | 3 Methodology knowledge gained in the first stop. It should also include the studies of Brownian motion, geometric Brownian motion and the Black-Scholes model for better understanding how the practical work regarding simulating the price will be possible.

The third part should contain the first practical work. This includes development of price simulation models with the functionality creating a more stable and linear growth by reducing the volatility. This functionality will be derived from knowledge gained in the first and second stop on the road map.

Lastly, the fourth step should be the hands-on practical, where all the knowledge from the earlier stops merge into a final product, namely the Dynamic Network Token. Development with the token itself will start and all knowledge that has been gained from the studies and discussion is implemented within the code of the Dynamic Network Token.

3.2 Literature study

Volatility in cryptocurrencies is a fact, making them subject to speculation and an asset class mainly used for investing and trading [66]. As the cryptocurrency space grows, different cryptocurrencies emerge, with different technologies and implementations.

Although different cryptocurrencies are designed to have unique functionality and utility, the problem of volatility seems to be a common denominator for all cryptocurrencies [67]. To identify causes for volatility in cryptocurrencies, a literature study, studying different kinds of cryptocurrencies provides a suitable method for gaining knowledge. In this way, factors contributing to volatility can be derived and more closely examined to help with the implementation of functionality reducing volatility in the Dynamic Network Token.

Most cryptocurrencies have what is known as a whitepaper [68] associated with them. This paper describes the use case, the implementation and the vision of the currency and has become a standard in the space. By reading the whitepapers for the cryptocurrencies mentioned in section 1.3 i.e., Bitcoin, Ethereum and Tether, knowledge regarding causes of volatility from different types of cryptocurrencies can be derived. These three cryptocurrencies, their whitepapers and published articles related to them will be the focus of the literature study. But there will also be some literature studies done on Binance coin and their burning reports [53], as they have functionality related to burning and minting.

3 Methodology | 27

Worth noting regarding Ethereum and ether, is that it is not only restricted to being a cryptocurrency made for transacting value, as in the case with Bitcoin [69]. The Ethereum project also provides a platform for deployment of smart contracts and therefore also provides a way for the Dynamic Network Token to be deployed. This makes Ethereum’s whitepaper useful in multiple ways, both in regard to the study of volatility of the Ether token, but mainly for its ability to host other tokens on its blockchain.

3.2.1 Whitepapers and reports

Since Bitcoin as of today April 9th, 2021, is the most valuable asset according to market cap [11], studying the Bitcoin whitepaper is a crucial step to gain insights and understandings to the implementation of the halving and hard cap, making Bitcoin a scarce and deflationary currency in regard to supply [5]. As mentioned in the background under section 2.2 and 2.3, Bitcoins hard cap and the shortage of coins added to circulation due to the halving, creates scarcity which is contributing to Bitcoin’s volatility.

In contrast to Bitcoin, Ethereum’s whitepaper [39] was studied to understand the fundamentals of an ERC20 token, what smart contracts are and a deeper understanding of the Ethereum ecosystem. One other key insight gained from Ethereum’s whitepaper, is the ability to develop and deploy a smart contract by using their blockchain as a host for the contract.

Tether [48] was chosen because of its stable value. The one-to-one ratio to the U.S Dollar and how they implemented it using the proof of reserve method to ensure a one-to-one ratio. With this information regarding how they mint and burn tokens, a better understanding of how to keep a value stable and regulated in regard to another asset was achieved.

3.2.2 Documentation

Reading documentation of a code library provides a good insight into the functionality of the library. As the use of well audited and tested libraries was crucial for the project, reading of documentation was a necessary step to gain knowledge about which libraries to use.

Documentation also provides a way for developers to learn how to use functionality by reading. In the case for the Dynamic Network Token, the implementation of burning and minting was a necessary step to reduce the volatility. Provided in the

28 | 3 Methodology documentation of Open-Zeppelin [29], skeletons for implementing this kind of functionality can be found and studied, making the implementation easier.

3.3 Tools

The practical work surrounding the development of the cryptocurrency, was made easier utilizing tools. These tools will be presented in the subsections below, starting with section 3.3.1 presenting the Open-Zeppelin library, 3.3.2 presenting the IDEs chosen for development and simulating.

3.3.1 Open-Zeppelin

Useful tools are everywhere and have been developed during the emergence of cryptocurrencies. One tool that can be very helpful is the Open-Zeppelin library for smart contracts. The library itself holds several different standards for ERC tokens such as a standard for the ERC-20 and many others [70].

The pre-developed ERC-20 standard functionality by Open-Zeppelin [29], provides developers with an audited and well documented code base for development. The basic functionality of a cryptocurrency is implemented and ready to be used. This drastically reduces the time it takes to create an ERC-20 token.

Using the Open-Zeppelin library, development of the currency could focus on the goal of reducing the volatility, instead of everything else surrounding a cryptocurrency. The skeleton provided by this library gives a great starting base for any ERC20 token, and with the possibility to override functions, the integrity of the ERC-20 standard remains intact while unique functionality can be added on top of it.

In the case of the Dynamic Network Token, code regarding the transfer of tokens would need to be modified to fulfil the necessary implementations needed for reducing the volatility in price. This includes adding minting and burning with special conditions to be met, satisfying the algorithms implemented in the protocol before executing.

3.3.2 Integrated development environments

Ethereum offers developers an integrated development environment (IDE) named Remix that is used for developing smart contracts on the Ethereum blockchain. This IDE can directly deploy the smart contract in a test environment that Ethereum is providing [71]. These are test networks that do not run on the main Ethereum 3 Methodology | 29

network. This means that it is easy to both deploy and test tokens with the help of Ethereum's Remix IDE. By pairing the Remix IDE with Metamask, which is described in section 3.5.1, a simple but smooth development of tokens is available.

IntelliJ is also an IDE used for developing smart contracts since there are plugins that can be installed to make Solidity compatible with IntelliJ [72]. This will be done to make it possible to not only write code but also push the code to Github. The main idea is to use IntelliJ and Remix for development but only Remix for testing the token on Ethereum’s test networks.

Another IDE used for the project is PyCharm. PyCharm is an IDE for developing in Python [73], coming from the same company JetBrains as Intellij. As Python is suitable for data science and simulations, the simulation of how price and volatility behaved in response to burning and minting could be graphed out and give insights if the work were going in the right or wrong direction.

3.4 Burning and minting

The method chosen for reducing the volatility in the Dynamic Network Token consists of implementing burning and minting functionality. The reason for choosing this method is partly because of the foundation for the functionality being incorporated in the ERC-20 standard as provided by Open-Zeppelin [74]. But the main reason for choosing burning and minting as a method to reduce the volatility, is because the functionality is compliant with the quantity theory of money or “QTM”. This theory states that a greater quantity of money in a society, leads to a higher price in labor and commodities [75].

To make use of the QTM theory in a cryptocurrency with burning and minting functionality, the heightening price of labor and commodities when adding to the total quantity of the cryptocurrency is replaced with a fiat currency, for example the U.S dollar. This means that if minting occurs, its value in comparison to the U.S dollar should become lower and if burning occurs, its value should become higher. In essence, the QTM theory applied this way in a cryptocurrency dictates that minting twice as much of that currency, will split the value of that currency in half compared to its pairing, for example the U.S dollar [76].

In accordance with the QTM theory, the burning and minting functionality should have an impact on volatility. By burning tokens when a sell transaction occurs, the impact should be that the price is not affected as negatively and losing as much value. In the same way, by minting tokens, the price impact to the upside should be more controlled when a buy transaction occurs and reducing potential volatility.

30 | 3 Methodology

How the implementation of the burning and minting should look is up to the developers of the project to decide. In the case with Binance, a quarterly burn will occur until the supply is cut in half [53]. In the case with Helium, a minting will occur every month, adding five million tokens to the total supply [54].

However, these methods used by Binance and Helium are static approaches to burning and minting. They will occur based on a timeline and not happen dynamically. Therefore, these approaches are not suitable for a cryptocurrency trying to control volatility dynamically.

The burning and minting must be implemented in a way where it interacts with transactions rather than using a timeline. By utilizing the transfer function from the ERC20 standard, this can be achieved.

With the use of the transfer function, a mathematical formula for deciding the number of tokens to be burned or minted needs to be chosen. This formula should behave in a way where the ratio is in favor for the burning, which in accordance with the QTM should result in a more deflationary cryptocurrency [75].

As burning and minting affects the total supply, the number of tokens burned, or mint must be realistic in proportion to the total supply. By looking at transactions of other cryptocurrencies such as Bitcoin, the median transaction is small [77]. This should indicate that the average transaction for the Dynamic Network Token also will be small. To handle this when burning and minting, the mathematical formula should make use of logarithms and exponents, as their functionality enables a good relation between the number of tokens and their percentage as displayed in table 3.1 and 3.2.

3.4.1 Burning

Burning is the functionality that is reducing the supply of a token by removing tokens from the total supply. This can be done in different ways, for example with a condition or by executing a transaction.

The burn functionality is possible to implement in the standard contract for ERC20 tokens by Open-Zeppelin [29], which makes it a suitable choice for the Dynamic Network Token. With the use of the existing burn functionality provided by Open- Zeppelin [78] in combination with the transfer function integrated in the standard contract for ERC20 tokens, the option to create a custom burn algorithm could be achieved based on the amount that is being transferred when a sale occurs.

3 Methodology | 31

To figure out when to burn, a condition that checks if the receiver is either the reserve- or owner-address will determine if the transaction in question is a sell- transaction, and the burn will be initiated.

If the condition is met, and the transaction is a sell-transaction, the first step before the actual exchange of tokens between the seller and the reserve address is the calculation of the burn. This calculation is based on a logarithmic or exponential function depending on the amount that is being sold, resulting in the amount to be burned.

When the amount to be burned is calculated, it is reduced from the reserve address and is sent to the 0x0 address, resulting in the burning of the tokens. After this process is done, the transfer from the seller to the reserve is done, finishing the transaction.

Figure 3.1: Flow chart of the burning functionality

To get a good ratio between the amount that is being transferred and how many tokens should be burned, a logarithmic/exponential approach was chosen as mentioned in the introduction to this section. Because a logarithmic function behaves as an inverse to an exponential function, burning for smaller transactions which presumably will be most transactions based on Bitcoin distribution in wallets [79], will experience a higher burn percentage than larger transactions as can be seen in table 3.1 and 3.2. This will also result in a better distribution of tokens burned in regard to total supply, as a high percentage of a small transaction results in a small number because of the size of that number being small.

As mentioned in related work under section 2.7 Binance Coin has an implemented approach to burning [53], which could be an approach used in Dynamic Network Token. However, it would remove the functionality of being dynamic and would have a negative effect on users transacting the token. The goal is to encourage the use of the token and not intervene when transacting with the token but only intervene when capital gain is in place.

32 | 3 Methodology

To calculate the number of tokens to be burned, the amounts of the last two transactions are added, where t1 being the previous transaction amount and t2 the current. The result is then stored in a variable totalAmount and can be described as ����������� = �1 + �2 . The totalAmount is then divided by the logarithm of itself and multiplied by four, resulting in (1).

���� = (1) ()∗

Where the result stored in the burn variable from (1) constitutes the number of tokens that will be burned.

Table 3.1: Table showing the logarithmic burn functionality. T1 T2 Total Log(Total Log(Total)* Burn Percent ) 4

2 3 5 0,69897 2,79588002 1,78834 0,3576691 6 4

20 30 50 1,69897 6,79588002 7,35739 0,1471479 9 8

200 300 500 2,69897 10,79588 46,3139 0,092627 6 93

2000 3000 5000 3,69897 14,79588 337,931 0,067586 9 38

20000 30000 50000 4,69897 18,79588 2660,15 0,0532031 7 5

200000 300000 500000 5,69897 22,79588 21933,7 0,043867 9 58

As the log of one is zero and the log of a number below one is negative, the function to calculate the burn must be changed below one. With a condition checking if the log value is negative, the implementation of the function changes from dividing by log, to division with the exponent times four of the total amount resulting in (2).

���� = (2) ()∗

3 Methodology | 33

Table 3.2: Table showing the exponential burn functionality. T1 T2 Total exp(total) exp(total)*4 Burn Percent

0,2 0,3 0,5 1,64872127 6,594885083 0,07581 0,1516326 6 6

0,02 0,03 0,05 1,0512711 4,205084386 0,01189 0,2378073 6

0,002 0,0003 0,005 1,00501252 4,020050083 0,00124 0,2487531 4 2

3.4.2 Minting

In contrast to burning, minting tokens can be viewed as the opposite, meaning that there is an addition to the supply. By adding tokens to the total supply, the purchasing power of the token will decrease depending on how many tokens are added.

Minting is a necessary functionality for any ERC20 token using Open-Zeppelin as it provides the functionality for the creation of the initial supply [44]. Thus, also making minting a part of the Open-Zeppelin standard contract.

The implementation of the minting utilizes the same transaction function as the burn functionality, i.e., the necessary transfer function of the ERC20 standard contract. With the help of a condition checking that the transaction is a purchase from the reserve or owner address, the contract knows that it should initiate a mint based on the amount bought.

Mentioned in related work under section 2.7 is Heliums approach to minting. This is an inflationary approach that in theory decreases in the long run, but with the potential to stay inflationary [54]. This would not be suitable for Dynamic Network Token, as it would make the token inflationary and not dynamic since their approach is to mint a static number of tokens each month which is divided by two every second year.

If the condition for a purchase transaction is met, a calculation of how many tokens that should be minted is done. The calculation for the minting is as with the burning, based on a logarithmic or exponential function with the difference being the percentage being lower.

34 | 3 Methodology

When the calculation is done, the amount to be minted is transferred to the reserve address, adding to the total supply of the token. After the minting process is done, the actual transfer between the reserve and the buyer occurs, finalizing the transaction.

Figure 3.2: Flow chart of the minting functionality

The logarithmic minting uses the same functionality as the burning with the only difference being that the four is changed to an eight, giving the function seen in (3).

���� = (3) ()∗

This leads to an algorithm that will have a burn to mint ratio of approximate 2:1.

Table 3.3: Table showing the logarithmic minting functionality. T1 T2 Total Log(Tot Log(Total Mint Percent al) )*8

2 3 5 0,69897 5,59176 0,894173 0,178834 6

20 30 50 1,69897 13,59176 3,678699 0,073574

200 300 500 2,69897 21,59176 23,15698 0,046314

2000 3000 5000 3,69897 29,59176 168,966 0,033793 2

20000 30000 50000 4,69897 37,59176 1330,079 0,026601 6

3 Methodology | 35

The exponential minting works in the same way as with the exponential burn, with the only difference being that the root of the division is multiplied by eight instead of four, resulting in (4).

���� = (4) ()∗

Thus, creating an approximate 2:1 burn and mint ratio for the exponential functionality as well, resulting in more burning than minting regardless of the size of the transaction.

Table 3.4: Table showing the exponential minting functionality. T1 T2 Total exp(total) exp(total)* Mint Percent 8

0,2 0,3 0,5 1,64872127 13,18977017 0,03790 0,075816 8 3

0,02 0,03 0,05 1,0512711 8,410168771 0,00594 0,118903 5 7

0,002 0,0003 0,005 1,00501252 8,040100167 0,00062 0,124376 2 6

3.5 Alternative methods for controlling the volatility

The method chosen for controlling the volatility in the Dynamic Network Token resulted in the implementation of burning and minting as discussed in 3.4. However, there are other potential methods that could have been implemented to reduce volatility.

One method that could have been implemented is by restricting the ability to transact. This could be done by implementing conditions in the transfer method from the ERC-20 standard mentioned in 2.4.2. By doing this, the smart contract governing the Dynamic Network Token could control the volatility in a way where the users are restricted to a limited amount of buying or selling. This method would be an interpretation of what is known in traditional finance as a trading halt [80]. A trading halt is a way for an exchange to control trading in an asset when it experiences big price swings due to some event. This restricts the traders from buying or selling during a period, or in a worst-case-scenario remove trading of the asset completely [81].

36 | 3 Methodology

Since the Dynamic Network Token is supposed to be dynamic, any method that does not involve a dynamic approach was ruled out. However, there are still other approaches that are worth looking into. For example, Binance and their time-based approach to burning [53] could be a choice, with the addition of a time-based minting to get a good burn-to-mint ratio. This would lead to a supply correction depending on some conditions in the smart contract that could possibly impact the volatility as well.

Another method that makes use of the burn and mint functionality is the BME method described in 2.7.2. This method is intended to be used in a network mainly for the purpose of buying and selling services [56] and the functionality is not implemented for the purpose to regulate volatility. Therefore, the BME method makes good, related work to study, but not an actual method worth implementing in the Dynamic Network Token.

3.6 Simulation of price

Before any work could be done on the smart contract containing the protocol for the Dynamic Network token, simulations of the price had to be done to see how the price hypothetically would behave. The idea of controlling the price dynamically by burning and minting tokens, should reflect a predictable behavior of the price in the simulations, reducing the volatility when compared to a token with the same conditions but without this dynamic functionality.

3.6.1 Java program

To start simulating the price, a simple iterative Java-program was developed. The function of the program is to both simulate price with the regulations of burning and minting implemented from section 3.4.1, 3.4.2 and at the same time simulate price without regulation.

The result of running the program was the creation of two arrays containing regulated and unregulated price growth. These arrays, containing the price over N- transactions, were later used to calculate the standard deviation i.e., the volatility. With help of the two datasets, it could be used with the geometric Brownian motion equation to give a hypothetical price prediction for the token for N-days by using the calculated volatility as a parameter. 3 Methodology | 37

3.6.2 Volatility as standard deviation

The result of running the Java program is the creation of two arrays containing price with burning and minting functionality and price without the burning and minting functionality. These arrays, containing the price over N-transactions, can be used to calculate the standard deviation of log return i.e., the volatility. By taking the two arrays or datasets, the volatility can be calculated as the standard deviation following the formula in (5).

∑ ( ) � = √� = (5)

Where � represents the standard deviation, n the number of observations, � the mean and � the specific value for the i-th observation. From (5), the volatility can be compared directly between the two price arrays. It can also be used as the volatility variable in the GBM-program discussed in 3.6.5.

3.6.3 Geometric Brownian motion

As the asset class of cryptocurrencies is still young, there is no standardized way or model of calculating, simulating, or predicting the price over time. Therefore, the decision for the price simulation model had to come from traditional finance and economics.

One of the most popular price and options prediction models is by utilizing geometric Brownian motion [82] which can be applied in the simulation of price for the Dynamic Network Token.

In mathematics, a Wiener process or Brownian motion, is a over continuous time [83]. This makes it a great candidate for simulation of a stock or currency price, as it behaves randomly. The stochastic or random process in a Wiener process, describes a series of predeceasing random steps creating a timeline, making up for what is known as a scaled random walk [84]. The importance of the Wiener process as a limit of random walk for the simulation of price will be because of its random behavior, and it can be described as in (6).

1 � (�) = ∑ ��, ��[0,1] (6) � √� 1≤�≤[��]

Where �� represent a sequence (�1, �2. . ��) of independent, identically distributed random variables, having a mean of zero and a variance of one, i.e., � �[0,1], which constitutes the limit for the Wiener process of random walks [85]. With the limit and

38 | 3 Methodology sequence defined, each � ≥ 1, will be a defined continuous time stochastic process or Wiener process (�(�)) following (6). The result of the function is the creation of a random step function.

A stochastic process, such as the Wiener process (Brownian motion), can be said to follow geometric Brownian motion if it satisfies the stochastic differential equation in (7).

��� = ����� + ������ (7)

where � constitutes the Wiener process (6), � represents the time, � represent the constant drift and � represents the standard deviation of log returns or volatility [86].

The choice of geometric Brownian motion over ordinary Brownian motion or Wiener process, for simulating the price is necessary because of its intrinsic property of not being able to take on non-negative values [25]. Ordinary Brownian motion, however, can take on negative values making it unsuitable for price predictions as a stock or currency cannot go lower than zero.

3.6.4 Black-Scholes model

Postulated in 1973 by Black and Scholes [24], the process governing the price S of an asset, can be formulated as a stochastic differential equation satisfying the geometric Brownian motion with a constant initial value of S0 > 0. This insight was the foundation to what would become the Black-Scholes model.

The Black-Scholes model is a model used in mathematical economics for predicting option prices [87]. It utilizes the stochastic differential equation satisfying the geometric Brownian motion, where S is the price (S0 represents starting price), r is the interest rate (representation of the drift or (�) and � (Sigma) is the volatility calculated as the standard deviation of the logarithmic return. With all the parameters accounted for, the formula for the Black-Scholes model can be derived from the SDE satisfying the geometric Brownian motion by using the stochastic chain rule in the Itô formula [88], resulting in (8).

1 � = � exp (�� + � − �2 �) (8) � 0 � 2

By satisfying the conditions for geometric Brownian motion in the Black-Scholes model, it can simulate a random walk with constant drift. Thus, price can be seen as governed dynamically by the geometric Brownian motion, as it creates a source of 3 Methodology | 39

uncertainty and randomness in regard to the price. The result is a somewhat realistic simulation of price behavior for a stock, making it a good model for the simulation of price for the Dynamic Network Token.

3.6.5 Geometric Brownian motion program

To make use of the geometric Brownian motion (GBM), and applying it in practice, a Python program was developed. Using the datasets mentioned in 3.6.1, the standard deviation or � could be calculated, thus giving the volatility variable for the stochastic differential equation.

For the program to work, the two other parameters had to be applied. These two parameters where S0, representing the starting price and the r or �, representing the interest rate.

The starting price S0 was chosen arbitrarily to start at 0.2, as the focus of the thesis is to control volatility and the actual price in practice will be determined on different factors that are not known at this time.

Interest rate in cryptocurrencies is somewhat unheard of, as there is no interest gained in just holding a cryptocurrency or token in a regular cryptocurrency wallet. There is, however, the possibility to put them into interest accounts [89], earning interest on holding your cryptocurrencies in these accounts. Therefore, the interest rate or � in the SDE was set based on the average yield from Bitcoin, Ethereum and Tether, holding your cryptocurrency in an interest account with the company BlockFi.

The choice of these three coins and their respective interest rate was chosen because of their intrinsic properties related to the Dynamic Network Token. Bitcoin represents the yield from a deflationary coin mentioned in 2.1.2, Ethereum for its more inflationary behavior and relation to the ERC20 token mentioned in 2.1.1 and 2.2.2. Tether represents the yield from a stable coin aspect mentioned in 2.3.

The average yield from Bitcoin, Ethereum and Tether on BlockFi as of 26th of April 2021, can be calculated as in (9) which will be used as the�variable, representing the interest rate.

6 + 5,25 + 9,3 / 3 = 6,85 (9)

With all the parameter variables sorted out, the actual formula for solving the Black- Scholes PDE using GBM could be written. The equation was converted into a

40 | 3 Methodology function in Python code, taking all the parameters needed as arguments, then performing the calculation of the price and returning it.

Figure 3.3: PDE solving for Black-Scholes equation converted into Python code.

By storing the value returned from the function in a variable, a loop where each iteration representing the daily price could be stored in an array, simulating the price development over time using the Black-Scholes model.

In the program, two arrays were created to represent both datasets mentioned in 3.3.1. This is because of the option to plot the simulated price with and without the burning and minting side by side, giving a good idea of how the price would behave over time.

3.7 Alternative simulation methods

This section intends to bring up other methods and models for simulating the price of the Dynamic Network Token. In section 3.7.1 the constant elasticity of variance will be brought up and in 3.7.2 the SABR volatility model will be discussed

These models were however disregarded in favor of the Black-Scholes model due to several reasons. The first reason being the standardization of the Black-Scholes model and therefore its recognition in traditional finance. Other reasons being the complexity of the other models, making them harder to implement and thus taking up more time.

3.7.1 Constant elasticity of variance

The constant elasticity of variance or CEV model, is a model trying to capture volatility as a power function of the underlying spot price [90]. The CEV model in comparison to the Black-Scholes model solves for a different stochastic differential equation, with some similarities. The CEV model as well as the Black-Scholes model makes use of a Wiener process or Brownian motion for the creation of a random walk, and it has a stochastic drift parameter or � representing the interest rate.

One difference between the models, is that the CEV model takes on an extra parameter gamma or �, which controls the relation between volatility and price. The gamma variable allows the CEV model to have a higher degree of flexibility in comparison to the Black-Scholes model and brings a potential for better accuracy. 3 Methodology | 41

However, the flexibility is achieved on the cost of making the CEV model more complex and dependent on more accurate parameters [91].

3.7.2 SABR volatility model

In contrast to the Black-Scholes model which was mentioned in section 3.6.4, the SABR model handles volatility a bit differently. Instead of having a fixed volatility, the SABR model handles volatility by allowing it to be a function of both time, and current . The model is given by three equations, whereas one is for the forward price process, one for the volatility process and the last one for the correlation coefficient for the two Brownian motions in the first two equations [92].

The SABR model is composed of three variables, alpha, beta, rho. Whereas alpha describes the magnitude of the volatility in the price of the asset or commodity. Beta is described as the sensitivity of forward price movements and lastly, rho is the correlation between these movements in the forward price and the volatility of the price of the asset or commodity [93].

3.8 Linear regression model

Linear regression is a simple but effective way to evaluate the relationship of two continuous variables [94]. Therefore, the choice of creating a linear regression model, where metrics such as R-squared and root mean squared error (RMSE) can be evaluated is a good fit for evaluating the price simulation of the Dynamic Network Token.

With the GBM program discussed in 3.6.3, the possibility to simulate price with and without the functionality of burning and minting can be studied. As the GBM program creates two arrays of data, one with the burning and minting functionality and one without, this data can be fitted into the regression model.

The result from fitting the simulated price data to the regression model can then be used for graphing a regression line, visualizing the linearity of the simulated price. This will give an overview of how high the volatility is for both the regulated and unregulated price, making it easy to compare these two by examining the deviation from the regression line.

42 | 3 Methodology

3.8.1 R-squared and RMSE

The linear regression model, besides making it possible to visualize the simulated price in regard to a regression line on a graph, will also be able to evaluate the two metrics R-squared and root mean squared error. This will give insights in the accuracy of the model [95].

R-squared is the statistical metric that indicates how much variation of a dependent variable is explained by the independent variable in a regression model. The model is used to measure how accurate a dataset is following a regression line. The R- squared measurement is measured from zero to one, where zero indicates that all movements by the dependent variable cannot be explained by the independent one and a value of one indicating the opposite [96].

The formula for calculating R-squared follows (10), where SSE is the sum of squares due to regression and SSyy (SSR) is the total sum of squares [97].

��� �2 = 1 − (10) ����

Root mean squared error or root mean squared deviation, measures the distance between the values or samples predicted called residuals, to the regression line. The RMSE measures the spread of the residuals, where a low value indicates a low spread from the line, meaning a higher concentration with less errors [98].

RMSE is used as a metric for predicting accuracy in a model, where a low number indicates a lower chance of error in the prediction and higher indicates a greater chance of error.

The formula for calculating the RMSE follows (11), where N represents the number of data points, y(i) represents the specific measurement with index i (i-th) and ŷ is its matching prediction for that measurement [99].

∑ |()^()| ���� = (11)

3 Methodology | 43

3.9 Testing of the token

In this section, testing of the Dynamic Network Token will be addressed and the different methods used for testing. The primary method for testing of the token will be with the use of Metamask and Etherscan as mentioned in section 3.9.1. This method of testing was primarily chosen due to its ability to visualize how transactions will act on the main-net. Metamask is also one of the primary wallet providers used for transacting ERC20 tokens [100] and provides an easy-to-use service for testing and transacting ERC20 tokens on an Ethereum test-net such as Ropsten or Goerli.

Another way of testing is with Truffle and Ganache as stated in 3.9.2. This was performed on the localhost, focusing on testing other functionality than the transfer functionality within the smart contract governing the Dynamic Network Token. This was also the reason for using the Truffle and Ganache testing environment, as it provides a way for testing separate methods such as checking wallet balances etc.

A method that was considered for testing was the use of Waffle. Waffle is a newer framework aiming to replace Truffle with easier and faster testing [101]. The reason for using Truffle and Ganache over Waffle was due to the amount of documentation available for Truffle and prior experience.

3.9.1 Metamask and Etherscan

Metamask is a cryptocurrency wallet provider only available for the Ethereum network. It is used for many different reasons such as accessing decentralized applications (dapps) on the Ethereum blockchain a bit easier. Metamask can be used for sending and receiving tokens to test the functionality by switching from the main Ethereum network to one of the test networks Ropsten or Goerli [102]. With this platform, testing a new token on Ethereum test networks is made easy and will be used as a tool for the development of the Dynamic Network Token.

Why Metamask was chosen as the primary testing platform is because of the connection to Ethereum’s test networks and a real visualization of transactions with tokens. This gives the opportunity to see how a token behaves, with the only difference being that transactions are not done with real money [103].

Etherscan is an independent block explorer for the Ethereum blockchain. It provides documentation of transactions made on the different networks of Ethereum. This is a useful tool for analysing transactions made with Metamask, giving the insights if the functionality is working as it should.

44 |

Figure 3.4: Example of a test transaction of 50,000 DNT, with minting and burning on Etherscan.

3.9.2 Truffle and Ganache

When developing on a localhost using an IDE, the tools Truffle and Ganache provided by Trufflesuite [104], can be used for compiling smart contracts and testing them in a sandbox environment.

Truffle provides an easy way to compile solidity code, i.e., smart contracts, on your localhost without having to interact with the EVM on the Ethereum main-net. This is useful for testing, as every deployed smart contract on Ethereum is associated with a transaction fee. It can also be used for testing other functionality in the contract such as checking the balance of a wallet, or any other functionality implemented in the contract.

Figure 3.5: Testing the balances of accounts using Truffle.

Ganache provides a command line interface (CLI) version and a user interface (UI) version, used for simulating wallets on the Ethereum network. The Ganache interface will create ten wallets starting with 100 Ether each, which can be used to cover the gas-fee when deploying smart contracts or transacting [103].

However, the lack of visualization for how the tokens behave in a real environment on the blockchain, made it a secondary choice for testing the transfer functionality. The most important functionality being the transferring of tokens, it should be tested in a way similar to the real case scenario. Therefore, Metamask and Etherscan were chosen primarily for the testing of transactions, while Ganache and Truffle were used for testing functions within the smart contract by reading and writing to it.

4 Results | 45

4 Results

This chapter intends to present the results. Section 4.1 and its subsections will lay out the result of the price simulations with and without the approach of burning and minting. Section 4.2 will compare the result from the simulations and 4.3 will explain the result from the linear regression model for both the prices and compare them to each other.

4.1 Price simulation

The method chosen for reducing the volatility in price consisted of implementing the concepts of burning and minting as described in 3.4. By simulating transactions with and without this functionality, two results could be derived which here on will be defined as the regulated and unregulated price.

4.1.1 Unregulated price

The unregulated price did not contain any burning or minting functionality. Using the Java-program developed for simulating transactions, the average standard deviation or � could be calculated over N-iterations. The resulting average standard deviation could then be used as the volatility parameter in the Black-Scholes model used to create a simulation of the price for Dynamic Network Token.

By running 15 iterations of the Java-program, 15 different scenarios for the volatility could be obtained and used for calculating the average standard deviation for unregulated price. The volatility calculated for the unregulated price, resulted in an average standard deviation of 0.44774127 over these 15 iterations, which is about 44.77 percent.

The impact no regulation had on price growth resulted in high volatility. This is further validated by the high average standard deviation obtained over the 15 iterations.

4.1.2 Regulated price

The regulated price contained the burning and minting functionality, trying to reduce the volatility in price. By using the Java-program to simulate price over N- transactions, datasets could be obtained to later be used to calculate the average standard deviation which would be used as the volatility parameter in the Black- Scholes model for creating a simulation of the Dynamic Network Token.

46 | 4 Results

Same as with the unregulated price, the price was simulated in 15 iterations, creating 15 different scenarios using the Java-program which was then used to calculate the average standard deviation. The volatility calculated for the regulated price, resulted in an average standard deviation of 0.38645927 over 15 iterations, which is about 38.64 percent.

The impact regulation had on price growth resulted in a reduction of volatility in comparison to the unregulated price. As can be seen in (12), the average standard deviation for regulated price over 15 iterations were reduced by 6,128%.

4.2 Comparison of price simulations

To evaluate if the implemented functionality of burning and minting had an impact on the price, a simulation of both unregulated and regulated price using the average volatility derived from section 4.1.1 and 4.1.2 was plotted on the same graph using the GBM-program from section 3.5.3. The standard deviation was also used to see the difference in volatility over 15 iterations, represented in figure 4.1.

Figure 4.1: Staple diagram showing the standard deviation (�) for regulated and unregulated prices.

As can be seen in the staple diagram in figure 4.1, all 15 iterations of the regulated price had a lower standard deviation than the unregulated price. This resulted in a lower average standard deviation for the regulated price for the total of iterations in comparison to the average standard deviation for the total of iterations for the unregulated price.

4 Results | 47

By using the average standard deviation or�for both regulated and unregulated, we can calculate the difference between them to see the impact on the price volatility. By subtracting the unregulated volatility with the regulated volatility, the following result was obtained:

0,44774127 − 0,38645927 = 0,061282 (12)

The results in (12) is a 6,128% difference between unregulated and regulated average standard deviation.

Figure 4.2: Simulation of price with and without regulation over 365 days using the average�.

Using the average standard deviation for both the regulated and unregulated price, a simulation over 365 days containing both types of prices could be plotted on a graph. In figure 4.2 unregulated price experiences a much higher volatility than the regulated price. It can also be seen that the regulated price is going down over time in this specific simulation. However, the volatility fluctuations are much lower and the evolution more linear.

48 | 4 Results

To illustrate the result further, figure 4.3 and 4.4 presents the five first iterations of the 15 iterations simulated, containing the regulated and unregulated price over 90 days.

Figure 4.3: Graph over five iterations of unregulated price simulated over 90 days.

As can be seen in figure 4.3, all the five iterations deviate rapidly from each other after 40 days. The only iteration that can be considered having low volatility is the first iteration, due to its residuals being closer together which is creating a more stable price evolution. This iteration however seems to be an outlier as the other iterations shows a higher spread of residuals and a more volatile evolution of price.

4 Results | 49

Figure 4.4: Graph over five iterations of regulated price simulated over 90 days.

In contrast to figure 4.3, figure 4.4 containing the regulated price shows less of a deviation between iterations. With almost every iteration having a very similar evolution over the 90 days, it seems as if the regulated price is more predictable and less volatile than the unregulated price.

4.3 Evaluation of linear regression

To evaluate if the burning and minting functionality had an impact on the linear growth over time, a linear regression model was created and fitted to both the regulated and unregulated price simulations.

The results from the linear regression with regulation will be presented in 4.3.1 along with the evaluation of the R-squared and root mean squared error (RMSE).

In section 4.3.2 the result from the linear regression for the unregulated price will be presented, along with the evaluation of the R-squared and root mean squared error (RMSE).

In section 4.3.3 a comparison between the regulated and unregulated price fitted to the linear regression model using the average standard deviation from 4.1.1 and 4.1.2.

50 | 4 Results

4.3.1 Linear regression with regulation

The results obtained by creating a linear regression model and inserting the regulated price showed an improvement in the reduction of volatility. The price is following the linear regression line, with a few deviations, which indicates that our mathematical implementation to dynamically regulate the price is working.

By fitting the simulated price with regulation to the regression model, the results obtained from the chosen metrics for evaluation were as follows:

R2:0.8608742733463043 RMSE: 0.031974880043300014

As can be seen, the R-squared value obtained is above 80% which can be considered high. A high R-squared for regulated price data indicates that it fits the regression model well. This is represented as well in figure 4.5, where there are no extreme deviations from the regression line.

Looking at the RMSE for the regulated price, the value obtained is low. This is generally a good result for an RMSE as it indicates the spread of the residuals is low. This is also shown in figure 4.5 as the concentration occurs around the line, meaning that there are less errors in deviation. 4 Results | 51

Figure 4.5: Graph over linear regression model with regulated price over 365 days.

Even though the price in the simulation went down over the one-year period, the price is closely following the regression line, indicating a good fit and a reduction in volatility.

4.3.2 Linear regression without regulation

The results shown from the linear regression without any regulation shows a very different story compared to the results from the regulated one. By looking at figure 4.6, the price simulation from the unregulated price is not following the regression line. There is also a lot of fluctuation in the price simulation due to the high standard deviation.

By fitting the simulated price without regulation to the regression model, results could be obtained from the chosen metrics for evaluation and were as followed:

R2: 0.2092963109804813 RMSE: 0.14663562653286338

52 |

The R-squared value that was obtained is very low, which implies that the unregulated price data does not fit the linear regression model very well compared to the regulated one. Shown in figure 4.6, the deviations from the regression line are big and are not at all following the regression, indicating a poor fitment.

The RMSE score obtained from the simulation was relatively high compared to the score with regulation. This indicates that the spread of the residuals is high and there is a low concentration around the regression line.

Figure 4.6: Graph over linear regression model without regulation of price over 365 days.

| 53

4.3.3 Comparison of regression models

By comparing these two regression models, the regulated price is experiencing less volatility than the unregulated price. This is due to the regulated price having a lower standard deviation or σ, making it fit the regression line better.

As a good score for R-squared was obtained in the regulated model and not the unregulated one, it implies that the regulated price follows the regression line with less fluctuation than the unregulated model.

Subtracting the R-squared from the regulated model with the R-squared from the unregulated model, we can see the difference as shown in (13).

0.860874 - 0.209296 = 0,651578 (13)

The difference for the R-squared between the models is 0.651578 as can be seen in (13), indicating a big difference in the fitment to the regression line for the regulated and unregulated price.

Comparing the RMSE score for both the regulated and unregulated models, the results showed that the RMSE score obtained from the regulated model was lower and prone to fewer errors. By subtracting the high value for the RMSE obtain from the unregulated price with the RMSE of the regulated price, the result is shown in (14).

0.146635 - 0.031974 = 0.114661 (14)

With a difference of 0.114661 as seen in (14), the unregulated model is more prone to errors and its residuals will be further away from the regression line than the regulated model as its RMSE is considerably lower.

54 |

5 Analysis and discussion | 55

5 Analysis and discussion

This chapter intends to analyse the results obtained in chapter 4 in section 5.1 and 5.2. It will also state if the goals in section 1.2 regarding controlling the volatility and achieving a linear growth have been fulfilled and if the results account for the goals set for the thesis.

Section 5.3 will explain aspects regarding the environmental impact of Dynamic Network Token, section 5.4 will describe assumptions regarding the Java-program and 5.5 will look at the Black-Scholes model approach to price simulation. Other approaches to both burning, minting, and simulating price will be discussed in section 5.6 and 5.7.

Discussion regarding the Java-program and if it is a realistic way to simulate real world crypto asset trading will be brought up in section 5.8 and lastly, the restrictions and limitations of this work will be addressed in section 5.9.

5.1 Interpretation of price simulations

From the Java-program in 3.6.1, 15 iterations for both regulated and unregulated prices were created. From the iterations, an average standard deviation could be calculated, representing the impact of the burning and minting functionality discussed in 3.4.1 and 3.4.2 had on the price. The results showed that the average standard deviation for the regulated price was lower, and it can also be seen in the staple diagram of figure 4.1 that each of the iterations validates this result.

5.1.1 Reliability of simulated result

The result achieved is leaning towards a reduction in volatility, but there can be a few things to take into consideration before drawing any conclusions. Firstly, the Java- program is not necessarily the best price-generating program due to its simplicity. Secondly, the number of iterations for the simulation of price are to be regarded as low.

The Java-program only considers the most crucial variables for calculating the price of a cryptocurrency, such as the market cap and circulating supply. This is because in its simplest form price is derived from dividing market cap by circulating supply.

For the number of iterations to be viewed as good, the number should have been at least 100 or above. With only 15 iterations, the chances increase drastically that the result will not be reproduced. There is a possibility that it can be a matter of

56 | 5 Analysis and discussion coincidence that each of the outcomes reduced the volatility in the regulated price against the unregulated price due to the low number of simulations. The reason for using 15 iterations was due to time restrictions. Each iteration had to be manually transferred into the price simulation program, creating a time-consuming task which could have potentially been avoided if automated.

5.2 Accuracy of regression models

The accuracy measured in the two regression models, indicates that the regulated price behaves more linear with a shorter distance between residuals. For example, the difference in R-squared which measures the fitment to the regression line, is more than four times better in the regulated price. This can be seen as a good result and a step towards reaching the goal of linear growth postulated in 1.2.

With the RMSE having a difference of 0.114661 between the regulated and unregulated price model as shown in (13). The spread of the residuals is far greater in the unregulated price than in the regulated. This is also validated if comparing figure 4.5 and 4.6, as the data points have a wider spread in figure 4.6.

The result of the RMSE in the regulated price indicates that the goal of reducing volatility has been achieved when compared to the unregulated price.

Worth noting regarding the accuracy of the regression models, is that a high R- squared and low RMSE does not always equals a good model. This is because these metrics cannot know if the predictions are biased, therefore invalidating the result. In the case of the datasets used for these two models, the problem can be that of low number of iterations, creating a larger room for a bias in the result.

5.3 Impacts of the Dynamic Network Token

This section aims to bring up and discuss the economic, social, ethical, and environmental impacts that the Dynamic Network Token will experience.

5.3.1 Economical impact

The potential economic impact for the Dynamic Network Token in a society can be substantial. For example, in a country where the national fiat-currency is experiencing hyperinflation, a currency with the inflation-reducing properties of the Dynamic Network Token can potentially help reduce or even eliminate the problem. This could result in a restoration of the purchasing power and maintaining it.

5 Analysis and discussion | 57

As the Dynamic Network Token is deployed on the Ethereum blockchain, which is decentralized and not owned by any company or nation, there are no restrictions regarding when a payment can be made. This can be a huge advantage in some cases, as it creates a possibility to move value anywhere in the world at any time, with the only restriction being that of the confirmation for the transaction on the Ethereum blockchain.

Furthermore, the development of the Dynamic Network Token does not have any significant economic impact in regard to development cost, due to the only need of a computer and the knowledge of programming to get started. There is no need for initial investments or capital compared to newly started companies.

5.3.2 Social and ethical impact

All it takes to be a part of the Dynamic Network token ecosystem is internet access. This can be a huge opportunity for people in developing countries where there is internet, but perhaps a lot of corruption within the banking system. Because the power of decentralization is creating a way for each participant in the network to be the manager of their funds, it eliminates the possibility of corrupted banks having access to the individual's wealth.

With decentralization and the individuals' possibility to be “their own bank”, it also creates opportunity for criminal activity. It becomes easier to transfer funds without the government or any other authority to monitor the transactions. A result from this would be that criminals have a way to avoid being detected when performing illegal transactions.

To encounter this, a reasonable solution would be the implementation of some form of identification before gaining access to the network, so the wallets do not remain completely anonymous. By implementing some form of identification process before gaining access to the network, some participants may feel that it is an ethical impact violating their rights to be anonymous.

Following the SATORI framework for ethical impact assessment [105], the threshold analysis regarding the potential use for criminal activity in the Dynamic Network Tokens ecosystem, makes the identification step an ethical impact worth taking.

58 | 5 Analysis and discussion

5.3.3 Environmental impact

The Dynamic Network Token does not have a substantial negative impact on the environment. As the Dynamic Network Token runs on the EVM, the biggest concern regarding the environment is how much power the Ethereum network consumes. As of today, 23 May 2021, the Ethereum project is still using the Proof of Work consensus algorithm but is slowly moving away to an eco-friendlier Proof of Stake.

Moving from Proof of Work to Proof of Stake will indirectly make the Dynamic Network Token more sustainable in terms of energy consumption than Bitcoin and traditional banking systems. Looking at banks and their estimated power consumption, it is four times as high compared to Bitcoin [106] and Ethereum’s power consumption will decrease by 99.5% when moving to Proof of Stake [107]. The possible outcome for the Dynamic Network Token is to have barely any environmental impact at all compared to both Bitcoin and traditional banking systems.

5.4 Assumptions

The work with simulation of price for the Dynamic Network Token, could not have been done without assumptions. Starting from the calculation of the volatility as the standard deviation, the Java program developed to simulate random transactions was based upon the calculation of price with cryptocurrencies. However, there are a lot of variables measured to update the price of a cryptocurrency, an assumption was made that we do not need all the variables to showcase that our regulation works. The variables used in the java program was restricted to market cap, price and circulating supply.

Our approach to variables used to calculate price can be compared to Coin360 who collects data from 25 verified exchanges to define the price and volume of each cryptocurrency. They use a quite complex calculation every eight seconds to update the price. The variables used in the calculation are the price of the last transaction, the minimum and maximum price in the past 24 hours, the current trade volume in base currency and quote currency calculated in the last 24 hours for each pair on all these 25 exchanges. These are calculated for the i-th couple on the e-th exchange [108].

5 Analysis and discussion | 59

5.5 Black-Scholes for cryptocurrencies

As the Black-Scholes model used to create the GBM program mentioned in section 3.6.3 is a model used in traditional finance, an assumption was made that the model also could be applied for the price prediction of cryptocurrencies.

This model has three parameters needed, where one of them being the r or interest rate, constituting the drift in the model. The interest rate parameter is hard to apply to cryptocurrencies because interest is not so common for a cryptocurrency wallet. Therefore, an assumption was made that the average yield from having a Bitcoin interest account with the company BlockFi, should function as a good approximation for the parameter. The assumption is not a guarantee that it is a good fit, taking into consideration that the average interest rate from such an account is to be considered a high interest rate of 6.85% as shown in (9). Compared to the average interest rate from traditional brick-and-mortar banks which as of January 2021 had a 0.04% annual percentage yield (APY) and online banks had a 0.31% APY [109].

5.6 Choice of burn and mint method

The approach taken to burning and minting for the Dynamic Network Token could have been different. For example, the implementation of restricting transactions in the protocol could have been a solution for controlling the volatility. This method would be an interpretation of a “trading halt”, making it a solution already in use in traditional finance [81]. The problem with this method and the functionality of a trading halt, is the centralization of power. A trading halt gives the exchange the power to stop trading, leaving the traders left with no ability to make their own choice with their own funds. As one of the main benefits in cryptocurrencies is decentralization and no central authority of power, this would remove one of the core values of the Dynamic Network Token.

We could have implemented a similar solution to the burn mint equilibrium discussed in 2.7.2, as it is also a form of hybrid solution. This would however not create a reduction of volatility in the same way, as the BME solution is mainly created for transacting between users and service providers in a network. The burning in this method is used for creating a commitment from the buyer and displaying that the service provider did complete the work.

For the Dynamic Network Token this is not necessary, as the idea is to encourage spending between parties in the network, and to regulate when there is a new entry to the network or someone exiting. Therefore, the custom designed burning and minting approach is a good fit, as it does not remove the dynamic part of the token. Its burn-to-mint ratio is also almost 2:1, which in theory leads to more burning of

60 | 5 Analysis and discussion tokens over time. This could also be seen as a deflationary property of the Dynamic Network Token.

5.7 Choice of simulation method

As stated in section 3.6.3, geometric Brownian motion was chosen due to its ability to not take on negative values. This means that it is a good fit for the simulation of price, as it follows a continuous stochastic process unable to become negative.

The work done in academia regarding Black-Scholes and geometric Brownian motion is overwhelming, resulting in many well written publications which can be used for studying the model and the stochastic process. With the widespread use of the Black-Scholes model in traditional finance, it can be seen as a golden standard for price predicting. This also appealed to why we chose to use it for the simulation, as the recognition for the model is great.

Other models which were considered for the simulation of price were the CEV and the SABR volatility model. Both models also make use of the Brownian motion or Wiener process, but they are not quite as standardized and well documented as the Black-Scholes model.

In a report by MacBeth and Merville published in the Journal of Finance in 1980 [110], a test comparing the constant elasticity of variance model or CEV against the Black-Scholes model was performed. The findings in the report were that the CEV model for pricing stocks and options was a far better fit than the Black-Scholes model.

In 1988 Tucker, Peterson and Scott discovered the same thing in their report published in the Journal of Financial Research [111]. However, this report received criticism and was the subject for a paper published in the International Journal of Humanities and Social Science in 2017. The paper stated that the findings made by Tucker lacked consistency because of the redefining of the CEV model used. Also, the result indicated that the standard error became smaller over time for both the CEV model and Black-Scholes model, making them similar in performance [112].

Due to the flaws of the Black-Scholes model, the SABR model might be a better fit to simulate price growth. With the dynamic volatility part with the SABR model where the calculation is based on both time, strike price and current forward price, could result in a more realistic simulation. Because the Black-Scholes model is using a fixed volatility assumption, which has been proven that it is not in line with market behavior, the prediction using the model leads to a wrongful result in contrast to SABR [93]. 5 Analysis and discussion | 61

With the knowledge of the CEV and SABR model being a potential better fit for simulation of price for the Dynamic Network Token, the Black-Scholes model still was the model of choice. This is due to its standardization in finance and its wide recognition. It was also chosen because it is less complex, making it easier to implement in the code. As the other models would take longer time to implement, the actual development of the Dynamic Network Token would suffer, and other parts of the thesis would have to be more restricted as a result. Also, the datasets of price created with the Java-program generating the volatility parameter could be flawed due to its simplicity. This could be a reason for the inaccuracy of the price simulation model, making either choice of model redundant because of this bad parameter. A more complex model would again take up to too much time. Therefore, the CEV and SABR models were disregarded in favor of the Black-Scholes model.

5.8 Realistic price simulation

Due to the assumptions made when simulating price, the simulation cannot be considered the same as a live trading cryptocurrency. There are a lot of factors in deciding the price of a cryptocurrency and without those factors in our simulation, it cannot be a realistic simulation but only an approximation based on the assumptions.

For a price simulation to become more realistic, more factors need to be considered as mentioned in 5.3 regarding Coin360’s calculation model to update prices and volume for cryptocurrencies. However, even with a simulation that could be able to simulate these factors, there will always be one factor that will be missing, the human factor. There is no way to simulate how the human psyche works and how fluctuations within the price affects a human. For this reason, a price simulation can never be accurate and only an approximation of the real world.

5.9 Restrictions and limitations

The creation of a cryptocurrency and the subject of volatility can be studied quite deep. By having a time limitation when taking on such a task, it becomes a restriction. With more time, a better study could be done regarding volatility and the regulation of price. For example, data from more iterations, the reading of more whitepapers and publications related to the subject, could result in a clearer picture regarding if the approach to controlling the volatility works or not.

A restriction regarding gaining data about how our regulation is affecting the price was the need of transferring the datasets obtained from the Java-program simulation between the two parties. These datasets were used to calculate the average standard

62 | 5 Analysis and discussion deviation that later was used in the Black-Scholes model. So, this resulted in less datasets used for our study which have affected the reliance of the data. A better approach regarding this would have been to calculate the standard deviation at the same time the Java-program simulation was done so the result could have been transferred between the two parties.

6 Conclusions | 63

6 Conclusions

To conclude the work in this thesis project regarding the reduction of volatility in a cryptocurrency, the results show promising potential. The regulated price managed to reduce the volatility during the simulations, and it was possible to implement the functionality in the smart contract governing the Dynamic Network Token. This conclusion in summary is satisfying the goals postulated for this thesis, as we could in fact see the reduction of volatility in the simulations. Furthermore, the regulated price growth also became more stable and linear compared to the unregulated.

However, a better result is possible if not the limitation of time, thus reducing the number of simulations among other things. For the result to be more validated, the need of more iterations with the implemented functionality is required. This would lead to more trustworthy results, as the of error is decreased.

There could also be the possibility that the approach taken with burning and minting is not the optimal way. An approach with restrictions regarding how many transactions can be done within a period could perhaps yield better results. But on the other hand, this would also compromise the freedom for each participant in the network and how they wish to spend their tokens.

Finally, the chosen method for price simulation could potentially be replaced with another method. Both the CEV and SABR model are good contenders and would potentially yield better results. This is something that could be interesting for future work.

6.1 Future work

The potential to further work on this study is absolutely something to consider due to the time limitation. Even though results came out promising, they could in fact be invalidated and make this whole study obsolete. To counter this possibility, more iterations would be a huge improvement. With more data gained from a larger number of iterations, a more accurate result could be obtained and is potentially something that would change the results.

Analysing and studying more approaches regarding burning and minting tokens is also further work worth looking into. The approach that was chosen might not be the best approach out there.

Lastly, improving the Java-program to better simulate how prices update would be a factor that could be improved. Since our simulation as of this moment is very

64 | simple compared to other price calculation models out there, this is something that could be the focus for future work.

7 References | 65

7 References

[1] Parker, D., 2015. A Brief History of Payments. [online] Polymathconsulting.com. Available at: https://www.polymathconsulting.com/Cache/Downloads/A-Brief- History-of-Payments-from-Polymath-Consulting.pdf [Accessed 17 May 2021].

[2] Alzahrani, S. and Daim, T., 2019. 2019 Portland International Conference on Management of Engineering and Technology (PICMET). Piscataway: IEEE.

[3] Reiff, N., 2020. What Are the Advantages of Paying With Bitcoin?. [online] Investopedia. Available at: https://www.investopedia.com/ask/answers/100314/what-are-advantages-paying- bitcoin.asp [Accessed 17 May 2021].

[4] Tesla. 2021. Tesla Vehicle Safety Report. [online] Available at: https://www.tesla.com/sv_SE/VehicleSafetyReport [Accessed 20 April 2021].

[5] Nakamoto, S., 2021. Bitcoin: A Peer-to-Peer Electronic Cash System. [online] Available at: https://bitcoin.org/bitcoin.pdf [Accessed 7 April 2021].

[6] Baur, D., Hong, K. and Lee, A., 2017. (PDF) Bitcoin: Medium of Exchange or Speculative Assets?. [online] ResearchGate. Available at: https://www.researchgate.net/publication/321988034_Bitcoin_Medium_of_Exch ange_or_Speculative_Assets [Accessed 17 May 2021].

[7] Rooney, K., 2018. SEC chief says agency won’t change securities laws to cater to cryptocurrencies. [online] CNBC. Available at: https://www.cnbc.com/amp/2018/06/06/sec-chairman-clayton-says-agency- wont-change-definition-of-a-security.html [Accessed 13 April 2021].

[8] Ghorbel, A. and Jeribi, A., 2020. Investigating the relationship between volatilities of cryptocurrencies and other financial assets. [online] Link.springer.com. Available at: https://link.springer.com/content/pdf/10.1007/s10203-020-00312-9.pdf [Accessed 26 April 2021].

[9] Encyclopedia Britannica. 2021. Gresham's law | economics. [online] Available at: https://www.britannica.com/topic/Greshams-law [Accessed 26 April 2021].

[10] Selgin G. (2020) Gresham’s Law. In: Battilossi S., Cassis Y., Yago K. (eds) Handbook of the History of Money and Currency. Springer, Singapore. https://doi.org/10.1007/978-981-13-0596-2_9

66 | 7 References

[11] CoinMarketCap. 2021. Cryptocurrency Prices, Charts And Market Capitalizations | CoinMarketCap. [online] Available at: https://coinmarketcap.com [Accessed 8 April 2021].

[12] Setia, V., 2019. supply and demand | Definition, Example, & Graph. [online] Encyclopedia Britannica. Available at: https://www.britannica.com/topic/supply- and-demand [Accessed 8 April 2021].

[13] Matthews, R., 2021. Why is gold rare?. [online] BBC Science Focus Magazine. Available at: https://www.sciencefocus.com/science/why-is-gold-rare/ [Accessed 8 April 2021].

[14] Downey L. What Is a Store Of Value? [Internet]. Investopedia. 2021 [cited 27 April 2021]. Available from: https://www.investopedia.com/terms/s/storeofvalue.asp

[15] Thompson, M., 2021. Bitcoin: Historical Annual Returns. [online] Upmyinterest.com. Available at: https://www.upmyinterest.com/fund?tick=Bitcoin [Accessed 7 April 2021].

[16] Cryptoz.ai. 2018. Cryptoz.ai. [online] Available at: https://cryptoz.ai/#!/crypto-currency/volatility [Accessed 26 April 2021].

[17] Coinmarketcap.com. 2021. Hard Cap | CoinMarketCap. [online] Available at: https://coinmarketcap.com/alexandria/glossary/hard-cap [Accessed 14 April 2021].

[18] Crsreports.congress.gov. 2020. Introduction to U.S. Economy: Inflation. [online] Available at: https://crsreports.congress.gov/product/pdf/IF/IF10477 [Accessed 21 April 2021].

[19] Corporate Finance Institute. 2021. Hyperinflation - Definition, Causes and Effects, Example. [online] Available at: https://corporatefinanceinstitute.com/resources/knowledge/economics/hyperinfl ation/ [Accessed 21 April 2021].

[20] Xe.com. 2021. Xe: VEF / USD Currency Chart. Venezuelan Bolívar to US Dollar Rates. [online] Available at: https://www.xe.com/currencycharts/?from=VEF&to=USD&view=10Y [Accessed 21 April 2021].

7 References | 67

[21] Lund, J., McCaleb, J. and Kennedy, M., 2019. Charting the evolution of programmable money. [online] Ibm.com. Available at: https://www.ibm.com/downloads/cas/GDKQKR6O [Accessed 22 April 2021].

[22] IMF.org. 2021. Monetary Policy and Central Banking. [online] Available at: https://www.imf.org/en/About/Factsheets/Sheets/2016/08/01/16/20/Monetary- Policy-and-Central-Banking [Accessed 18 May 2021].

[23] Garg, P., 2018. Ethereum Genesis Address: The “Black Hole” That Has Over $520 Million Worth Of Tokens | BTCMANAGER. [online] BTCMANAGER. Available at: https://btcmanager.com/ethereum-genesis-address-black-hole-520- million-worth-tokens/ [Accessed 28 April 2021].

[24] Black, F. and Scholes, M., 1973. The Pricing of Options and Corporate Liabilities. [online] Cs.princeton.edu. Available at: https://www.cs.princeton.edu/courses/archive/fall09/cos323/papers/black_schol es73.pdf [Accessed 26 April 2021].

[25] Sigman, K., 2006. [online] Columbia.edu. Available at: http://www.columbia.edu/~ks20/FE-Notes/4700-07-Notes-GBM.pdf [Accessed 22 April 2021].

[26] BlockFi.com. 2021. Interest Rates. [online] Available at: https://blockfi.com/rates/ [Accessed 26 April 2021].

[27] Fidelity.com. 2021. Standard Deviation Indicator - Fidelity. [online] Available at: https://www.fidelity.com/learning-center/trading-investing/technical- analysis/technical-indicator-guide/standard-deviation [Accessed 27 April 2021].

[28] Yusuf E. ERC-20 Token Standard | ethereum.org [Internet]. ethereum.org. 2021 [cited 14 April 2021]. Available from: https://ethereum.org/en/developers/docs/standards/tokens/erc-20/

[29] Docs.openzeppelin.com. 2021. ERC 20 - OpenZeppelin Docs. [online] Available at: https://docs.openzeppelin.com/contracts/2.x/api/token/erc20 [Accessed 21 April 2021].

[30] Hermele, K., 2014. Commodity Currencies vs Fiat Money - Automaticity vs Embedment. [online] Portal.research.lu.se. Available at: https://portal.research.lu.se/portal/files/5999214/5147123.pdf [Accessed 18 May 2021].

68 | 7 References

[31] Meynkhard, A., 2019. Fair market value of bitcoin: halving effect. [online] Pdfs.semanticscholar.org. Available at: https://pdfs.semanticscholar.org/c3a0/6dcc40c78d09c74d9db1dac8b3f4e5d1f7b7. pdf [Accessed 18 May 2021].

[32] Chen, J., 2021. Fiat Money. [online] Investopedia. Available at: https://www.investopedia.com/terms/f/fiatmoney.asp [Accessed 28 April 2021].

[33] Grätz, T., 2003. Gold-Mining and Risk Management: A Case Study from Northern Benin. [online] researchgate.net. Available at: https://www.researchgate.net/publication/233065045_Gratz_Tilo_2003_Gold- mining_and_risk_management_A_case_study_from_northern_Benin_Ethnos_6 82_92-_208 [Accessed 18 May 2021].

[34] Schoenberger, E., 2011. Why is Gold Valuable? Nature, Social Power and the Value of Things. [online] researchgate.net. Available at: https://www.researchgate.net/publication/254082428_Why_is_Gold_Valuable_ Nature_Social_Power_and_the_Value_of_Things [Accessed 18 May 2021].

[35] Khairuddin, I. and Sas, C., 2021. An Exploration of Bitcoin Mining Practices: Miners’ Trust Challenges and Motivations. [online] Dl.acm.org. Available at: https://dl.acm.org/doi/pdf/10.1145/3290605.3300859 [Accessed 18 May 2021].

[36] Moritz, C., 2021. CfC St. Moritz – Understanding the Bitcoin Halving. [online] CfC St. Moritz. Available at: https://crypto-finance- conference.com/blog/understanding-the-bitcoin-halving [Accessed 7 April 2021].

[37] Coinmarketcap.com. 2021. Deflation | CoinMarketCap. [online] Available at: https://coinmarketcap.com/alexandria/glossary/deflation [Accessed 27 April 2021].

[38] 3. Beck M. Bitcoin & the Rise of Digital Gold [Internet]. New York: Grayscale Investments LLC; 2019. Available from: https://grayscale.co/wp- content/uploads/2019/09/Grayscale-Bitcoin-the-Rise-of-Digital-Gold-September- 20191.pdf

[39] Buterin, V., 2013. Ethereum Whitepaper | ethereum.org. [online] ethereum.org. Available at: https://ethereum.org/en/whitepaper/ [Accessed 7 April 2021].

7 References | 69

[40] Lipton A, Levi S. An Introduction to Smart Contracts and Their Potential and Inherent Limitations [Internet]. The Harvard Law School Forum on Corporate Governance. 2018 [cited 13 April 2021]. Available from: https://corpgov.law.harvard.edu/2018/05/26/an-introduction-to-smart- contracts-and-their-potential-and-inherent-limitations/

[41] . 2021. Ethereum's ERC-20 Tokens: The Definitive Standard | Gemini. [online] Available at: https://www.gemini.com/cryptopedia/erc20-token-standard- ethereum [Accessed 18 May 2021].

[42] Coinmarketcap.com. 2021. Burned | CoinMarketCap. [online] Available at: https://coinmarketcap.com/alexandria/glossary/burned [Accessed 28 April 2021].

[43] Brock, T., 2021. Mint Definition. [online] Investopedia. Available at: https://www.investopedia.com/terms/m/mint.asp [Accessed 28 April 2021].

[44] docs.openzeppelin.com. 2021. Creating ERC20 Supply. [online] Available at: https://docs.openzeppelin.com/contracts/2.x/erc20-supply [Accessed 27 April 2021].

[45] Hertig, A., 2017. Ethereum 101 - CoinDesk. [online] CoinDesk. Available at: https://www.coindesk.com/learn/ethereum-101/ethereum-mining-works [Accessed 28 April 2021].

[46] 9. FAQs | Tether [Internet]. Tether. 2021 [cited 14 April 2021]. Available from: https://tether.to/faqs/

[47] Hayes, A., 2020. Stablecoin. [online] Investopedia.com. Available at: https://www.investopedia.com/terms/s/stablecoin.asp [Accessed 18 May 2021].

[48] Tether.to. 2016. [online] Available at: https://tether.to/wp- content/uploads/2016/06/TetherWhitePaper.pdf [Accessed 14 April 2021].

[49] Leech, O., 2021. Want to Buy Dogecoin? Read This First - CoinDesk. [online] CoinDesk.com. Available at: [Accessed 26 May 2021].

[50] Harper, C., 2021. Dogecoin's Surging Price Resurrects Its Tech Development - CoinDesk. [online] CoinDesk.com. Available at: [Accessed 26 May 2021].

70 | 7 References

[51] Finance.yahoo.com. 2021. Yahoo is now a part of Verizon Media. [online] Available at: [Accessed 26 May 2021].

[52] GitHub.com. 2021. safemoonprotocol/Safemoon.sol. [online] Available at: [Accessed 26 May 2021].

[53] Zhao, C., 2021. 14th BNB Burn | Quarterly Highlights and Insights from CZ. [online] Binance Blog. Available at: https://www.binance.com/en/amp/blog/421499824684901482/14th-BNB-Burn- %7C-Quarterly-Highlights-and-Insights-from-CZ [Accessed 27 April 2021].

[54] Helium.com. 2021. The New Wireless Economy.. [online] Available at: https://www.helium.com/hnt [Accessed 10 May 2021].

[55] Adams, G., 2019. Crypto Research, Data, and Tools. [online] Messari.io. Available at: https://messari.io/article/burn-and-mint-equilibrium [Accessed 18 May 2021].

[56] Atanasovski, P., 2019. Burn and Mint equilibrium Pro’s and Con’s. [online] Medium.com. Available at: [Accessed 26 May 2021].

[57] FACTOM GOVERNANCE DOC 001. 2019. Doc 001 - Factom Governance. [online] Available at: https://docs.google.com/document/d/1RVaVR7lvfGgOBMG- 7oca9TtpnR7qaEfr6XJVaZJwd3M/edit# [Accessed 18 May 2021].

[58] Stoler, K., 2017. Stock Compensation 2017 assumption and disclosure study. [online] pwc.es. Available at: https://www.pwc.es/es/publicaciones/legal- fiscal/assets/pwc-stock-comp-2017-assumption-disclosure-study.pdf [Accessed 18 May 2021].

[59] Cox, J. and Ross, S., 1976. The for alternative stochastic processes. [online] sciencedirect.com. Available at: [Accessed 26 May 2021].

[60] Wang, A., Yong, L., Wang, Y. and Luo, X., 2014. The CEV Model and Its Application in a Study of Optimal Investment Strategy. [online] hindawi.com. Available at: [Accessed 26 May 2021].

7 References | 71

[61] Cox, J., 1996. The constant elasticity of variance option pricing model - ProQuest. [online] Proquest.com. Available at: [Accessed 26 May 2021].

[62] Hagan, P., Kumar, D., Lesniewski, A. and Woodward, D., 2002. Managing Smile Risk. [online] Lesniewski.us. Available at: [Accessed 26 May 2021].

[63] Deloitte.com. 2016. Stability of the SABR model. [online] Available at: [Accessed 26 May 2021].

[64] Yang, E., 2018. Predicting bitcoin price using linear regression model. [online] Issuu. Available at: [Accessed 26 May 2021].

[65] Fahmi, A., Samsudin, N., Mustapha, A. and Razali, N., 2018. (PDF) Regression based Analysis for Bitcoin Price Prediction. [online] ResearchGate. Available at: [Accessed 26 May 2021].

[66] Peetz, Dietmar and Mall, Gregory, Why Bitcoin is Not a Currency But a Speculative Real Asset (September 9, 2017). Available at SSRN: https://ssrn.com/abstract=3098765 or http://dx.doi.org/10.2139/ssrn.3098765

[67] Callahan, M., 2019. Why are cryptocurrencies so volatile? | Smart Insights. [online] Smart Insights. Available at: https://www.smartinsights.com/digital- marketing-strategy/volatile-cryptocurrencies/ [Accessed 27 April 2021].

[68] Hayes, A., 2021. White Paper: What Everyone Should Know. [online] Investopedia. Available at: https://www.investopedia.com/terms/w/whitepaper.asp [Accessed 27 April 2021].

[69] Reiff, N., 2020. Bitcoin vs. Ethereum: What's the Difference?. [online] Investopedia. Available at: https://www.investopedia.com/articles/investing/031416/bitcoin-vs-ethereum- driven-different-purposes.asp [Accessed 12 May 2021].

72 | 7 References

[70] GitHub. 2021. OpenZeppelin/openzeppelin-contracts. [online] Available at: https://github.com/OpenZeppelin/openzeppelin- contracts/tree/master/contracts/token [Accessed 19 May 2021].

[71] Remix - Ethereum IDE & community. 2021. Remix - Ethereum IDE & community. [online] Available at: https://remix-project.org [Accessed 19 May 2021].

[72] JetBrains.com. 2021. Intellij-Solidity - Plugins | JetBrains. [online] Available at: https://plugins.jetbrains.com/plugin/9475-intellij-solidity [Accessed 19 May 2021].

[73] JetBrains.com. 2021. PyCharm: the Python IDE for Professional Developers by JetBrains. [online] Available at: https://www.jetbrains.com/pycharm/ [Accessed 19 May 2021].

[74] Docs.openzeppelin.com. 2021. Presets - OpenZeppelin Docs. [online] Available at: [Accessed 26 May 2021].

[75] Friedman, M., 2010. Quantity Theory of Money. [online] SpringerLink. Available at: [Accessed 26 May 2021].

[76] Calcaterra, C., Kaal, W. and Rao, V., 2020. Stable Cryptocurrencies: First Order Principles. [online] Stanford Journal of Blockchain Law & Policy. Available at: [Accessed 26 May 2021].

[77] BitInfoCharts. 2021. Bitcoin (BTC) - Price, Blocks Count, Difficulty, Hashrate, Value. [online] Available at: [Accessed 26 May 2021].

[78] docs.openzeppelin.com. 2021. ERC20Burnable. [online] Available at: https://docs.openzeppelin.com/contracts/3.x/api/token/erc20#ERC20Burnable [Accessed 6 May 2021].

[79] Canellis, D., 2018. 80% of wallets holding Bitcoin contain less than $100. [online] TNW | Hardfork. Available at: https://thenextweb.com/news/bitcoin- addresses-mostly-empty [Accessed 11 May 2021].

7 References | 73

[80] Chen, J., 2021. Trading Halt. [online] Investopedia. Available at: [Accessed 27 May 2021].

[81] Duggan, W., 2019. The Ins And Outs Of Trading Halts. [online] Lightspeed. Available at: [Accessed 27 May 2021].

[82] Bendki, M. and Giversen, J., 2010. CONTINUOUS TIME PROCESSES IN TIMES OF CRISIS: THE CASE OF GBM AND CEV MODELS. [online] Lup.lub.lu.se. Available at: https://lup.lub.lu.se/luur/download?func=downloadFile&recordOId=1973618&file OId=1973620 [Accessed 6 May 2021].

[83] Eatwell, J., Milgate, M. and Newman, P., 1990. Econometrics. London: Macmillian reference Books.

[84] Vanden-Eijnden, E., 2021. Lecture 6: Wiener Process. [online] Whoi.edu. Available at: https://www.whoi.edu/fileserver.do?id=21268&pt=10&p=17232 [Accessed 23 April 2021].

[85] Lalley, S., 2012. Brownian Motion. [online] Galton.uchicago.edu. Available at: https://galton.uchicago.edu/~lalley/Courses/313/BrownianMotionCurrent.pdf [Accessed 6 May 2021].

[86] Lidén, J., 2018. Stock Price Predictions using a Geometric Brownian Motion. [online] Uu.diva-portal.org. Available at: https://uu.diva- portal.org/smash/get/diva2:1218088/FULLTEXT01.pdf [Accessed 6 May 2021].

[87] Shinde, A. and Takale, K., 2021. Study of Black-Scholes Model and its Applications. [online] Reader.elsevier.com. Available at: https://reader.elsevier.com/reader/sd/pii/S1877705812019480?token=560B4A5D 7E503B9E761C546790A4249CE88C2C2476CA7425042E1BE667A276F2A8A7BB6 01F63E0870A570DB0AA95C362&originRegion=eu-west- 1&originCreation=20210519090810 [Accessed 19 May 2021].

[88] Øksendal, B., 2009. Mathematics and Finance: The Black-Scholes Option Pricing Formula and Beyond. [online] Duo.uio.no. Available at: https://www.duo.uio.no/bitstream/handle/10852/10258/11-10.pdf [Accessed 6 May 2021].

74 | 7 References

[89] BlockFi.com. 2021. Interest Rates. [online] Available at: https://blockfi.com/rates/ [Accessed 26 April 2021].

[90] Lientsky, V. and Arriaga, R., 2010. Constant Elasticity of Variance (CEV) Diffusion Model. [online] ResearchGate. Available at: [Accessed 27 May 2021].

[91] Hang, J., Lidström, D., Reimbert, A. and Ydström, M., 2019. Multi asset- optioner. [online] Chalmers. Available at: [Accessed 27 May 2021].

[92] Øgaard, J., 2020. A review of options pricing models from fixed to . [online] Projekter.aau.dk. Available at: [Accessed 27 May 2021].

[93] Risk.net. 2021. Stochastic alpha beta rho (SABR) model definition - Risk.net. [online] Available at: [Accessed 27 May 2021].

[94] Online.stat.psu.edu. 2018. 2.1 - What is Simple Linear Regression? | STAT 462. [online] Available at: https://online.stat.psu.edu/stat462/node/91/ [Accessed 19 May 2021].

[95] Chugh, A., 2020. MAE, MSE, RMSE, Coefficient of Determination, Adjusted R Squared — Which Metric is Better?. [online] Medium.com. Available at: https://medium.com/analytics-vidhya/mae-mse-rmse-coefficient-of- determination-adjusted-r-squared-which-metric-is-better-cd0326a5697e [Accessed 19 May 2021].

[96] Fernando, J., 2020. R-Squared Definition. [online] Investopedia.com. Available at: https://www.investopedia.com/terms/r/r-squared.asp [Accessed 19 May 2021].

[97] corporatefinanceinstitute.com. 2021. R-Squared - Definition, Interpretation, and How to Calculate. [online] Available at: https://corporatefinanceinstitute.com/resources/knowledge/other/r-squared/ [Accessed 19 May 2021].

7 References | 75

[98] Glen, S., 2021. RMSE: Root Mean Square Error - Statistics How To. [online] statisticshowto.com. Available at: https://www.statisticshowto.com/probability- and-statistics/regression-analysis/rmse-root-mean-square-error/ [Accessed 19 May 2021].

[99] c3.ai. 2021. Root Mean Square Error (RMSE). [online] Available at: https://c3.ai/glossary/data-science/root-mean-square-error-rmse/ [Accessed 19 May 2021].

[100] ConsenSys. 2021. MetaMask Surpasses 5 Million Monthly Active Users. [online] Available at: [Accessed 27 May 2021].

[101] Kirejczyk, M., 2018. Introducing Waffle. [online] Medium. Available at: [Accessed 27 May 2021].

[102] Choi, S., 2018. What is MetaMask? Really… What is it?. [online] Medium. Available at: https://medium.com/@seanschoi/what-is-metamask-really-what-is- it-7bc1bf48c75 [Accessed 14 April 2021].

[103] Hayes, G., 2018. The Beginners Guide to Using an Ethereum Test Network. [online] Medium. Available at: https://medium.com/compound-finance/the- beginners-guide-to-using-an-ethereum-test-network-95bbbc85fc1d [Accessed 22 April 2021].

[104] trufflesuite.com. 2021. Sweet Tools for Smart Contracts | Truffle Suite. [online] Available at: https://www.trufflesuite.com [Accessed 19 May 2021].

[105] Reijers, W., Brey, P., Jansen, P., Rodrigues, R., Koivisto, R. and Tuominen, A., 2016. A Common Framework for Ethical Impact Assessment. [online] Satoriproject.eu. Available at: [Accessed 23 May 2021].

[106] Medium.com. 2018. Which consumes more power: Banks or Bitcoins?. [online] Available at: [Accessed 23 May 2021].

[107] Beekhuizen, C., 2021. A country's worth of power, no more!. [online] Blog.ethereum.org. Available at: [Accessed 23 May 2021].

76 | 7 References

[108] COIN360.com. 2021. How are cryptocurrency prices & exchange volumes calculated – COIN360. [online] Available at: https://coin360.com/about/methodology [Accessed 18 May 2021].

[109] Moon, C., 2021. Average Checking Account Interest Rates 2021. [online] valuepenguin.com. Available at: https://www.valuepenguin.com/banking/average- checking-account-interest-rates [Accessed 19 May 2021].

[110] Macbeth, J. and Merville, L., 1980. Tests of the Black-Scholes and Cox Valuation Models. [online] Wiley Online Library. Available at: [Accessed 27 May 2021].

[111] Tucker, A., Peterson, D. and Scott, E., 1988. TESTS OF THE BLACK-SCHOLES AND CONSTANT ELASTICITY OF VARIANCE CURRENCY CALL OPTION VALUATION MODELS. [online] Wiley Online Library. Available at: [Accessed 27 May 2021].

[112] Chache, W., 2017. Test of Black-Scholes and Constant Elasticity of Variance Currency Call Option Valuation Models. [online] Ijhssnet.com. Available at: [Accessed 27 May 2021].

Appendix A - Linear regression models | 77

Appendix A - Linear regression models def price_unreg(price): newPrice = [] for x in price: newPrice.append(log(x)) # Linearize price.

price = newPrice data = np.array(price) index = np.array(list(range(0, 365))) # this must be set in relation to number of days. x = np.array(index).reshape(-1, 1) y = data linreg = LinearRegression().fit(x, y) linreg.score(x, y) predictions = linreg.predict(x) plt.title("Linear Regression model for price\n without regulation") plt.plot(index, predictions, y) plt.legend(['Regression line', 'No regulation'], loc='upper left') plt.xlabel("$Days$") plt.ylabel("$Price$") #plt1.ylim(0, 1) # Optional for scale.

plt.show() print('NO REG R^2:', linreg.score(x, y)) print('NO REG RMSE:', mean_squared_error(y, predictions, squared=False)) def price_reg(price): newPrice = [] for x in price: newPrice.append(log(x)) # linearize price. price = newPrice data = np.array(price) index = np.array(list(range(0, 365))) # this must be set in relation to number of days. x = np.array(index).reshape(-1, 1) y = data linreg = LinearRegression().fit(x, y) linreg.score(x, y) predictions = linreg.predict(x) plt.title("Linear Regression model for price\n with regulation") plt.plot(index, predictions,y) plt.legend(['Regression line', 'Regulation'], loc='upper left') plt.xlabel("$Days$") plt.ylabel("$Price$") #plt1.ylim(0, 1) Optional for scale. plt.show() print('REG R^2:', linreg.score(x, y)) print('REG RMSE:', mean_squared_error(y, predictions, squared=False))

78 |

Appendix B - Black Scholes and GBM code | 79

Appendix B - Black Scholes and GBM code

# Function for simulation of price following a geometric brownian motion by solving for the Black-Scholes model. Takes the parameters of starting price (s0), interest rate (r) and volatility (vol) measured as the standard deviation. def create_GBM(s0, r, vol): st = s0 # set starting price. def generate_val():

nonlocal st # declare st as nonlocal.

st *= exp((r - 0.5 * vol ** 2) * (1. / 30.) + vol * sqrt(1. / 30.) * gauss(mu=0, sigma=1))

return st return generate_val

80 |

Appendix C - Remix transfer function | 81

Appendix C - Remix transfer function function transfer(address recipient, uint256 amount) public virtual override returns (bool) {

// Calculate burn and mint.

uint256 toBeBurned = calculateBurn(amount); uint256 toBeMinted = calculateMint(amount);

if(_msgSender() == ownerAddress) { if(SafeMath.add(totalSupply(), toBeMinted) <= maximumSupply){ _mint(ownerAddress,toBeMinted); } } else if(recipient==ownerAddress) { if(SafeMath.sub(totalSupply(), toBeBurned) >= minimumSupply){ _burn(ownerAddress,toBeBurned); } } _transfer(_msgSender(), recipient, amount); return true; }

TRITA TRITA-CBH-GRU-2021:047

www.kth.se