Content thumbnail MELON PROTOCOL



MELON PROTOCOL: A BLOCKCHAIN PROTOCOL FOR DIGITAL ASSET MANAGEMENT DRAFT RETOTRINKLERANDMONAELISA Abstract. The Melon protocol is a blockchain protocol for digital asset management on the Ethereum platform. It enables participants to set up, manage and invest in digital asset management strategies in an open, competitive and decentralised manner. 1. Introduction Digital assets which do not gain their value from collat- Thevalue and importance of a wide range of digital as- eralisation, called un-collateralised assets. Finally, digital 1 assets which are derived from existing digital assets called sets has risen dramatically over the last few years. Hence derivatives. the question naturally arises how to manage this new and fast-growing asset class in the most advantageous way. 2.1. Collateralised Assets. Collateralised Assets, are This could be done by investing in a hedge fund which assets which gain their value from the collateralisation of specializes in digital assets. real-world assets. Examples are Dai from the Dai Credit However, the lack of standardisation can make com- System[13], Dassets[11] from String Technology or t0[12] parison of fund performances difficult and fund auditing from Overstock. An example for a digital asset backed by practices can be very opaque. a commodity is DGX from Digix[4] which binds the value Asecond deterrent, is the time and high cost required of gold to a digital asset. for setting up and running a hedge fund. This limits the 2.2. Un-collateralised Assets. Un-collateralised assets range of possible hedge fund managers to a comparatively are digital assets which gain their value in the scarcity small group of people. It arguably also limits competi- of the token itself. Examples for un-collateralised assets tion between hedge funds creating qualitatively less good are ETH(Ethereum[7]), ETC(EthereumClassic[6]), REP hedge fund performances[14]. (Augur[1]), DGD (Digix[4]) or MKR (Maker[13]). Even- Athird deterrent to investing in a hedge fund is some tually even companies issuing tokens as shares on the of the outdated technological infrastructure, giving room Blockchain will belong to this set. for a lot of inefficiencies. Section 2 through 4 of this paper will discuss the gen- 2.3. Derivatives. The third set of digital assets are eral mechanics of the Melon protocol. Section 5 through derivatives of other digital assets. In the context of this 7 will discuss how the Melon protocol can be used to solve work, a derivative is defined as a digital asset which has above objectives of openness, competitiveness and secu- its value directly derived from another digital asset. An rity. Finally, section 8 will propose a solution for protocol example for this set is a contract for difference (CFD) of development. an existing digital asset. In conclusion, the restriction to digital assets will be with the adoption of Ethereum and the various decen- 2. Assets tralised applications and services built upon it be less and less restrictive. To better understand the general mechanics of the Melonprotocol, lets start by defining the term digital asset 3. Portfolio management strategy. A digital asset management strat- Having seen the selection of digital assets waiting to be egy is, in the context of this paper, regarded as a strategy managed by up-and-coming Portfolio Managers, let’s now on how to manage a portfolio2. Each portfolio can hold a variety of digital assets, where these digital assets repre- discuss the general mechanics of how this can be achieved sent the value a portfolio can hold. technically. As a motivation to the challenge ahead, let’s look at a Each portfolio consists of a core part and a set of mod- few examples of these digital assets currently available, or ules (see figure 1) in development. 3.1. Core. The core part, written in a set of smart- For the sake of ease, and to highlight the differentiation contracts, can be seen as the part which holds everything in underlying value, we categorise digital assets into three together. The modules, also written in a set of smart- sets: Digital assets which gain their value from collateral- contracts, can be seen as the auxiliary functionality to isation of an underlying asset, called collateralised assets. the core part. The core part together with a set of rules E-mail addresses: (Reto Trinkler) [email protected], (Mona El Isa) [email protected]. 1Throughout the present work, a digital asset, is regarded as a digital token of value, run and stored on the Ethereum Blockchain. There is no technical difference assumed between what an asset and what a token is, the terms are interchangeable. However in the context of portfolio management usually the term asset is used. 2Throughout the present work, a portfolio is regarded as a finite set of digital assets. 1

MELON PROTOCOL: A BLOCKCHAIN PROTOCOL FOR DIGITAL ASSET MANAGEMENT DRAFT 2 on how the core interacts with its modules constitute the of the portfolio, these subjective parts can be changed. Melon protocol. For example different Portfolio Managers might want to 3.2. Modules. The modules provide auxiliary function- charge different management fees and apply their own ality to the core part. For example, providing off-chain methods on how to calculate these fees. The modular data, storing of portfolio relevant data or the executing of concept allows the managers to chose the management calculations for the portfolio. fee module of their liking. Thus they can select the fees The modules are the parts of the portfolio which have and calculation methodology by simply linking the corre- subjective functionality. Through the modular concept sponding module to the core. Figure 1. Protocol version links existing portfolios and collects licensing fees Modules can be freely developed by anyone. Develop- andsupplyprofileondifferentexchangesgeneratingdiffer- ers can then define a commission that is paid back to them ent bid/ask prices. While it’s true that arbitrageurs keep every time someone uses their module. the differences small, they remain, for at least as long as The Melon protocol includes the following modules as there is a fee to be paid on the execution of trades. A a foundation: fee might be a commission to the exchange or broker, or Registrar: Links assets to price feeds to trading. a fee in form of another execution cost, such as for exam- Functionality: A way to build assets specific func- ple the gas cost to be paid on the Ethereum network. To tionality. solve the problem of ambiguous prices, the Melon proto- Price Feeds: Provide a price for an asset by taking col will require the Portfolio Manager to choose one price one or several data sources into account. feed module providing one specific price against which the Exchanges: On-chain marketplaces such as assets under management (AUM) are evaluated. EtherEx[8] or Maker-Market[10], where one or The exchange module specifies an on-chain exchange a set of assets can be traded. where assets can be traded. This is required as it poses Trading: Asetofrulesonhowtradingispermitted. a restriction on where the Portfolio Manager can trade Management Fee: Agrossassetvalue(see appen- his/her funds. See also registrar module. dix C) independent payment for the Portfolio Thetrading module restricts trading and links to a pre- Manager. selected exchange on which an asset can be traded. For Performance Fee: A gross asset value (see appen- example, no trade size can be higher than 10% of the dix C) dependent payment for the Portfolio Man- volume traded of this asset. This module is intended to ager. reduce the amount of order book manipulation in favour In the registrar module, the Portfolio Manager selects of the Portfolio Manager. a finite amount of assets as well as a finite amount of ex- APortfolio Manager will be able to receive a manage- changes on which these assets can be traded. All a Port- mentfee as well as a performance fee. These fees are spec- folio Manager can ever do is trade those specific assets ified in the management fee module and the performance on those specific exchanges. The smart contracts do not fee module. The management fee is generally calculated allow funds to be sent in any other way or to any other by reference to the assets under management, i.e. the accounts. gross asset value (see appendix C) of the portfolio. The Thefunctionality module allows a Portfolio Manager to performance fee is generally calculated by reference to the retain actions or rights and avoid penalization from non- increase in the gross asset value. There is usually a high action (eg. Augur’s REP tokens). These interactions be- water mark, which means that if the portfolio performing tween token custodian and corresponding smart-contracts below a defined benchmark since inception, the Portfolio need to be programmed in as it is no longer an individual’s Manager does not get paid a performance fee. Alternative or non-contract account which controls these funds. forms of performance fees are conceivable. For example, Theprice feeds module is needed as asset prices, in gen- the interval by which the performance fee gets paid out eral, tend to be different on different exchanges. This is can be selected by the Portfolio Manager. because of the inherent way prices are set - a price is set Before the deployment of a portfolio, a Portfolio Man- by demand and supply which constitutes of market par- ager decides which modules he/she would like to use. ticipants wanting to buy or sell. In this context, the word Once the portfolio is deployed this then can be seen as market participants also refers to trading algorithms, etc. the offering of a legal contract. The contract terms are un- In general, market participants reflect a different demand ambiguously visible and securely held by the Blockchain.

MELON PROTOCOL: A BLOCKCHAIN PROTOCOL FOR DIGITAL ASSET MANAGEMENT DRAFT 3 Therefore, the smart-contract terms are agreed upon by appendix B): the investor upon investing in the portfolio.  ti   ti  h h +F a1 a1 t t hi   hi  a a  2→ 2  4. Investing and Redeeming  .   .   .   .  . . There are two ways to invest in a portfolio. The first ti ti h h an an wayistobuyshares oftheportfolioonanymarketplaceon t Wherebyconvention h i is the amount of Ether the port- a which they are traded. The second way is to create shares 1 by investing Ether directly into the respective smart con- folio m holds, at time ti. Then the quantity of shares qti created for funds F, at tract of the portfolio. F Similar to investing there are three ways to redeem time ti is calculated. The formula is the following: from a portfolio. The first way is to sell shares of the t F (2) q i = F t portfolio on any marketplace on which they are traded. p i m And the second way is to annihilate shares. This can be ti Note, by definition the share price p is independent of m done by Funds F invested. • redeeming into a separate portfolio or The quantity of shares qti are then allocated to the F • redeeming directly into Ether via a program Investor. For the investment to get incorporated takes at 3 least one block time, i.e. more than 10 to 19 seconds. Dur- trade . ing this time period the share price might change. How- 4.1. Net Asset Value. Shares of a portfolio are designed ever the Investor will be able to invest via a limit order such that they fulfil the following properties: hence they have no risk of getting an unexpected price. • Shares are fungible. 4.3. Annihilation. By redeeming funds F denominated • Shares reflect ownership of the portfolio. in Ether, from a portfolio, shares are annihilated. The in- • The inherent value of the shares is given by the vestor redeems funds F by exchanging shares against the value of the underlying assets of the portfolio. underlying value they represent. • Share price is relatively independent of invest- To request a withdrawal of amount F, one has to with- ments and withdrawals made. draw: Shares will be represented by a smart-contract follow- ti F t ti (3) q = ⇔F=piq F t m F ing the Ethereum token standard[5]. Thus they are fun- p i m gible and tradable on exchanges such as EtherEx[8] or of shares. t Maker-Market[10]. Furthermore, Portfolio Managers can This quantity of shares q i represents a percentage of F hold and manage shares of other portfolios. t t ownership, called o i. The formula for o i is the following: Shares also reflect ownership of the portfolio, where the F F formula of ownership is the following: qti (4) oti = F F Total shares in existence (1) Ownership = Shares holding TheInvestor now redeems this percentage of all the as- Total shares in existence sets a portfolio holds, directly from the smart contract of For example if one holds ten out of a hundred total the portfolio. In doing so he/she sets up a new portfolio. shares then the ownership is 0.1 or 10%. This is dynamic, The new portfolio of the Portfolio Manager is thus: as people invest and redeem the total amount of shares     t t in existence changes and therefore also the percentage of h i h i a a t1 t1 ownership. hi  hi  a a  2 t  2  . →(1−oi) .  Theinherent share price (see appendix G) is defined by  .  F  .  the net asset value per share (see appendix F) and thus . . ti ti h h by the value of the underlying assets. an an Every time an Investor invests Ether in a portfolio, Where the separated part, is the part which belongs to shares are created and every time an Investor redeems the Investor, redeeming funds:  ti  Ether, shares are exchanged against the value of the un- h a1  ti  derlying assets and thereby annihilated. This mechanism h t  a2 of creating and annihilating shares keeps the share price o i  .  F  .  relatively independent of investments respective to with- . t h i a drawals made. n In conclusion, the inherent share price is set, not by de- This separated part can now be seen as the portfolio mand, but by performance. Each investor has the ability of the investor. The investor becomes its own Portfolio to exchange its shares at any time against the value of the Manager. They can now either decide to manage this new underlying assets. portfolio to their liking or liquidate the assets to Ether through a program trade. A program trade is an algo- 4.2. Creation. By investing funds F denominated in rithm that liquidates a portfolio to complete the redeem- Ether, into a portfolio, shares are created. The Investor ing process. sends these funds directly to the smart contract of the Since portfolios separate when redeeming funds, one ti portfolio where they are added to the portfolio h (see cannot directly expect or anticipate any future trades m 3 Aprogram trade is a trade where orders are entered directly into the market and executed automatically.

MELON PROTOCOL: A BLOCKCHAIN PROTOCOL FOR DIGITAL ASSET MANAGEMENT DRAFT 4 made by the redeeming investor. All one can see on the 6. Competitive Blockchain is the separating of the portfolio. This pro- The competitive gains of the Melon protocol are in the cess can be done in a simple and convenient way, where form of lower cost and time barriers to setting up and the investor chooses his/her selling off strategy on an off- running a portfolio. chain server which listens to the Blockchain and trades The costs and complexity to setting up a portfolio us- accordingly. ing the Melon protocol are lower than they are with tradi- 4.4. Open and closed-ended portfolios. Generally tional asset management, seconds and cents versus months one differentiates between two types of portfolios. open- andmillions. Suchbenefitswillfavourallinvestors, butes- ended portfolios and closed-ended portfolios. The differ- pecially large scale money managers for whom the major- ence between the two is that in the former there’s no limit ity of operating costs will be eliminated (well over 50% of a on how much investors can invest while in the latter there typical asset management firm’s costs today are made up is. In a closed-ended portfolio, once the investment limit of of fund administration and operations infrastructure[9]). the portfolio has been reached the process of creation will These cost savings can be passed on to savers. The lower be suspended. At this point, shares can only be bought operating costs will also enable new up-and-coming Port- on exchanges. folio Managers to enter the market by reducing minimum In conclusion, the Investor is always in control of their scale requirements and start up costs. investment and can exchange back shares to get the un- The cost of running a portfolio on the Blockchain is derlying value of the assets without having to ask for per- equal to the core usage fees, modular commissions and the mission from the Portfolio Manager or anybody else. infrastructure costs to be paid on the Ethereum platform (see Figure 2). 5. Open Theusage fees are set by the protocol and the modular As seen in section 4, portfolio share prices are de- fees are set by the module developers. Both of them are fined by the net asset value per share. This is true for expected to be a fraction of a cent or a fraction of the each portfolio deployed, meaning that share price of all trade volume for each usage. Melon protocol portfolios are visible and comparable on The infrastructure costs are equal to the gas used for the Blockchain. The Portfolio Manger’s managing and the execution of the underlying smart contracts. The gas trading track-record is visible and auditable in the same costs are dependent on the gas price set for the transac- way. tions and the amount of gas used in executing these smart In addition, all of the Melon protocols’ smart contracts contracts[15]. 4 In conclusion, by having low set up requirements and are open-source . In conclusion, the Melon protocol is an open-source low costs of running a portfolio one can create a never- blockchain protocol. Portfolio track-records and perfor- seen-before competitive environment for asset manage- mances are visible and auditable by everyone. ment strategies. Figure 2. Variable Costs of a Melon protocol portfolio 7. Decentralised Storing portfolio assets in a decentralised way, reduces AMelonprotocol portfolio can be set up, managed and custody risks. invested in, using a decentralised technological infrastruc- Incidents like the financial crisis of 2008 and the 2013 ture relying on the Ethereum Blockchain. bank deposit levy in Cyprus have taken a heavy toll on In this context, one can differentiate between decen- the trust of centralised custodians. Legislation of bail-ins tralised storage and decentralised execution. in many developed countries doesn’t help either[2][3]. 7.1. Decentralised Storage. All of the Melon proto- 7.2. Decentralised Execution. Executionofthesmart- col’s smart-contracts, portfolio track records and assets contracts is done in a decentralised manner using the are stored on a decentralised Blockchain. Ethereum virtual machine (EVM) which is distributed Storing smart-contracts and portfolio track records in a onto all nodes connected to the Ethereum network. The decentralised way mitigates the risks around single points result is generally more efficiency, security and predictabil- of failure and provides open and reliable storage of infor- ity. Most notably, counterparty and settlement risks of mation. trades are reduced significantly. 4 They are published under

MELON PROTOCOL: A BLOCKCHAIN PROTOCOL FOR DIGITAL ASSET MANAGEMENT DRAFT 5 In conclusion, by having decentralised storage and ex- Aspecial thanks to Garrett Cassidy, Andr´e Wolke, Ro- ecution one can mitigate some of the potential security man Bischoff, Jorge Mielgo, Sandro Lera, Dylan Grice vulnerabilities and market inefficiencies, such as reducing and Andrey Ternovsky for their support, feedback and single points of failure, custody-, counterparty-, and set- improvements to this paper. tlement risks. 8. Protocol Development References To build the Melon protocol and strengthen the net- [1] Augur - decentralized prediction market. workeffect, there will be a digital token issued. This token Accessed: 2016-08-26. is called the Melon token (MLN) and will be distributed [2] Beteiligung der gl¨aubiger an der bankenrettung. through a contribution period. These Melon token can then be used to use the core, und-effektenhaendler/aufsichtsinstrumente/stabilisierungs- as all usage fees are collected in Melon token. Since mod- und-abwicklungsplanung/kapitalmassnahmen/. ule developers invest time and effort into building these Accessed: 2016-08-26. modules and since many of them will have an active cost [3] Deal reached on bank “bail-in directive”. of running, such as for example server costs of running a price feed, there needs to be a way to incentive them. room/20131212IPR30702/Deal-reached-on-bank- Melon solves this by incentivizing module developers in %E2%80%9Cbail-in-directive%E2%80%9D. Ac- the same way as almost every blockchain incentivizes its cessed: 2016-08-26. miners. By giving them the transaction fees - or usage [4] Digix platform. Accessed: 2016- fees in the case of the Melon protocol - and by creating 08-26. an amount for them created through inflation. The Melon [5] Ethereum - token standard. protocol will do the same thing and thus effectively future proofing development Accessed: 2016-08-26. [6] Ethereumclassic. 9. Future Directions Accessed: 2016-08-26. 5 [7] Ethereum platform. Ac- To drive adoption, there will be portals . These are cessed: 2016-08-26. user-friendly web applications to access the Melon proto- [8] Etherex - decentralized exchange. col. This will allow users to interact with the protocol Accessed: 2016-08-26. easily. [9] Hedge fund cost survey. Thevalueoftheprotocol is directly correlated with the value of these portals. The better and easier the portals, %20Fund%20Survey Sept2008.pdf. Accessed: the more usage fees will be collected and the higher the 2016-08-26. rewards for module developers. [10] Makermarket. 10. Conclusion market. Accessed: 2016-08-29. [11] String technology. Ac- TheMelonprotocol proposed a blockchain protocol for cessed: 2016-08-26. digital asset management on the Ethereum platform. It [12] t0. Accessed: 2016-08-26. enables participants to set up, manage and invest in dig- [13] N. M. et al. The Dai Credit System. ital asset management strategies in an open, competitive and decentralised manner. [14] P. Wei, Y. Altshuler, and A. Pentland. Decoding 11. Acknowledgements Social Influence and the Wisdom of the Crowd in Fi- nancial Trading Network. MIT Media Lab. We would like to use this opportunity to express our [15] D. G. Wood. Ethereum: A Secure De- gratitude to everyone who supported us throughout the centralised Generalised Transaction Ledger. course of writing this paper. Appendix A. Terminology Token: By the term token is meant, a digital token of value adhering to the Ethereum token standard [5]. Portfolio: A collection of smart-contracts, divided into a core smart-contract(s) and into auxiliary smart-contracts called modules. Portfolio Manager: Portfolios are managed by one person or a group of persons, referred to as a Portfolio Manager. Module: Amoduleisonorasetofsmart-contractswhichhasanauxiliaryfunctionality to the core smart-contract of the portfolio. Time Step: The term time step means, the time interval between blocks on the Ethereum Blockchain. Where time is taken from the block timestamp issued by the miner. For example (ti,ti+1] is the time between after block with timestamp ti and the following block with timestamp ti+1. 5One example for a portal is the Melon portal:

MELON PROTOCOL: A BLOCKCHAIN PROTOCOL FOR DIGITAL ASSET MANAGEMENT DRAFT 6 Appendix B. Portfolio Formally we expand the portfolio as follows. Assuming there are n ∈ N digital assets available. This constitutes the following vector set a of assets: a1 .  (5) a =  .  . an where ak is the k-th available asset, for k ∈ N. By convention the first asset a1 represents Ether. ti Then the portfolio h , is defined as the vector set of asset holdings of a portfolio m at time ti. m   ti h a1 t  .  n (6) h i =  .  ∈ R≥0 m . hti a n ti where h is the amount, in token units of a , a portfolio m holds at time t , for k ∈ N. ak k i Appendix C. Gross Asset Value t t Let p i be the vector set of asset prices, at time ti. Then p i is:  ti  p a1 ti  .  n (7) p = . ∈R≥0 . t p i a n ti where p is the price per token unit of asset ak in Ether, at time ti, for k ∈ N. ak ti Note, since by convention a1 represents Ether, and the prices are given in Ether the first price p is always equal to a1 one. ti ti The Gross Asset Value or GAV vˆ in Ether of portfolio h at time ti is: hm m n ti t t Xt t (8) vˆ =hpi,h ii = p i h i h m a a m k k k=1 with the standard scalar product on Rn. The GAV can be seen as the gross value of the portfolio. Appendix D. Net Asset Value ti ti The Net Asset Value or NAV v in Ether of portfolio h at time ti is: h m m t t t t (9) v i =vˆ i −Management Fees i −Performance Fees i h h m m ti ti Management Fees resp. Performance Fees is the management resp. performance fees given to the Portfolio Man- ager for timestep ti. Appendix E. Delta TodefinetheDelta ∆ of a portfolio m, within the time (t ,t ], where t < t , we first define the Delta of ∆ , (t ,t ] i j i j (t ,t ] i j i i+1 i.e. the Delta of a single time step. Let be: t0 = time of contract creation tl = time of first investment = min {vtk 6= 0} t ∈[t ,t ] hm k 0 i t I i = Sumof all investments within (ti−1,ti] t Wi = Sumofall withdrawals within (ti−1,ti] t t Where both I i and W i is a value in Ether. Then the Delta of a single time step is: t v i+1 −Iti+1 +Wti+1 (10) ∆ = hm (ti,ti+1] vti h m By design, the Delta of a portfolio, is independent of funds invested or withdrawn within the time (ti,ti+1]. By factoring together these Deltas of single time steps we get the general definition of the Delta ∆ of a portfolio m as: (t ,t ] i j   1 if tj ≤ t  l   j−1 Q  tk  ∆ if t

MELON PROTOCOL: A BLOCKCHAIN PROTOCOL FOR DIGITAL ASSET MANAGEMENT DRAFT 7 Note, the case where t < t < t and vtk = 0, for a k ∈ {l,l +1,...,j −1} is when the first investment has been made i l j h m but the funds have been withdrawn completely at some point within time (tl,tj−1]. The GAV in this case can not be calculated by factoring together Deltas of single time steps, as this would mean a division through zero. The Delta in this case is set to 0 for all times, even if the portfolio receives investments in the future. The same is true for the second similar case where t ≤ t and vtk = 0, for a k ∈ {i,i+1,...,j −1}. l i h m By induction, we can see that the Delta ∆(t ,t ] remains independent of funds invested or withdrawn within the time i j (ti,tj]. Appendix F. Net Asset Value per Share Expressed mathematically the NAV per share pti of portfolio m, at time t is: m i ti (12) p =∆(t ,t ] m 0 i ti where t0 is the time of contract creation. The price p is denominated in Ether. m Appendix G. Share Price The share price is defined by the Net Asset Value per Share (see appendix F) and is denominated in Ether.