<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Simon Cousaert on Medium]]></title>
        <description><![CDATA[Stories by Simon Cousaert on Medium]]></description>
        <link>https://medium.com/@merkle3?source=rss-78d22bdac637------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sGp03eFKAw_z7WmxJ85G2g.png</url>
            <title>Stories by Simon Cousaert on Medium</title>
            <link>https://medium.com/@merkle3?source=rss-78d22bdac637------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:40:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@merkle3/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Insurance: Token-based solutions on blockchain — A summary]]></title>
            <link>https://medium.com/uclcbt/insurance-token-based-solutions-on-blockchain-a-summary-e7b5a6805197?source=rss-78d22bdac637------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7b5a6805197</guid>
            <category><![CDATA[insurance]]></category>
            <category><![CDATA[token-economy]]></category>
            <category><![CDATA[token]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Simon Cousaert]]></dc:creator>
            <pubDate>Fri, 17 Sep 2021 14:43:06 GMT</pubDate>
            <atom:updated>2021-09-17T14:43:06.739Z</atom:updated>
            <content:encoded><![CDATA[<h3>Insurance: Token-based solutions on blockchain — A summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*S3CCN04uVhQi61nW2U6YXQ.png" /></figure><p><em>This article summarizes the chapter </em><a href="https://arxiv.org/abs/2109.07902"><em>“Token-based Insurance Solutions on Blockchain”</em></a><em>, written by Jiahua Xu, Nikhil Vadgama and myself from </em><a href="http://blockchain.cs.ucl.ac.uk/"><em>UCL CBT</em></a><em>. The chapter is part of a book called “Blockchains and the Token Economy: Theory and Practice”, which will be published later this year.</em></p><p>Managing risk has been crucial for humankind for a very long time. Two thousand years ago, Indian, Chinese and Babylonian traders practiced methods of pooling risk. For example, Chinese seafaring merchants pooled together their goods into a collective fund that would pay out if there was any damage to any of the members’ ships. Today, the insurance industry collects approximately $6 trillion USD of premiums globally.</p><p>But the insurance industry needs to evolve in order to tackle the following major problems:</p><ol><li>The emergence of new risks</li><li>The transformation of existing risks</li><li>Shifts in consumer needs</li><li>Continuous advancement in techniques applied in insurance fraud</li></ol><p>Because of this, flexible solutions that are transparent and easily manageable are in high demand. Let’s take a look at token-based insurance solutions, which bear the nature of programmability, traceability and transparency because of the blockchain infrastructure they are developed on.</p><h3><strong>Concepts in Token-based Insurance Solutions</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cqVCbIGZC-gHeXQCTr_6VQ.png" /><figcaption>Figure 1: Actors and actions in a token-based insurance solution</figcaption></figure><h4>Actors</h4><p><strong><em>Insureds </em></strong>are people who seek protection against a certain risk. They are the true customers of insurance products. Insureds are compensated when the hazard they are insured against occurs.</p><p>The role of the <strong><em>insurer </em></strong>is made easy by smart contracts. They redistribute funds to insureds with approved claims.</p><p><strong><em>Underwriters </em></strong>assess the risk tied to uncertainty. Risk assessments can be performed by external participants or by the protocol itself. The element of risk will prove to be crucial in determining the premium an insurer has to pay.</p><p><strong><em>Reinsurers </em></strong>provide extra protection by increasing an insurance protocol’s solvency. In return for taking part of the risk of the insurer, the reinsurer shares part of the protocol’s profit.</p><p><strong><em>Claim assessors</em></strong> are internal or external parties that either approve or object a claim from the insured. This can happen automatically, through oracles, or manually, through group voting.</p><p><strong><em>Decentralized autonomous organizations (DAOs)</em></strong> govern the protocol and, more specifically, the smart contracts. By holding governance tokens, a user holds decision-making power in a protocol’s governance. When a protocol is fully decentralized, no single entity controls the smart contracts anymore, but the rules of the game, including the mechanics of the processes and the tokenomics, are decided upon by a community of governance token holders.</p><h4><em>Assets and Tokens</em></h4><p>In many protocols, there is a specific token for premium payment, called a “<strong><em>payment token</em></strong>”. With this token, the insureds pay for their cover.</p><p>In return, the insureds could receive an <strong><em>insurance token</em></strong>, which represents a certificate of cover. Insurance tokens can be fungible or non-fungible, depending on the specific cover. It’s important to notice that not every insurance protocol makes use of insurance tokens. Instead, sometimes they rely on hybrid bookkeeping systems with a central database to record the transaction history.</p><p>Finally, a <strong>governance token</strong> ensures distributed sovereignty, by giving the holders voting rights.</p><p>Keep in mind that in some protocols, one token can have multiple use cases. Governance tokens can be used for payments, or the insurance token might also be the governance token. Designing the “token economics” of the protocol is a critical task.</p><h4><em>Processes and Operations</em></h4><p>Insureds pay a premium when they <strong>purchase cover</strong> against risks. This premium is paid with the payment tokens.</p><p>The <strong>price </strong>of buying a cover is either defined by e model that uses historical data, or based on the community’s opinion. It is the task of the underwriter to assess the risk level and signal correct behavior regarding the premium.</p><p>In case insurance has to be<strong> paid out</strong>, insureds have to <strong>file a claim</strong>. The approval or objection of that claim can be handled through automatic data provision, or can be processed manually by human claim assessors. The legitimacy of a claim is often determined by human judgment, as the immaturity of oracle technology still requires a careful approach with sufficient oversight.</p><p>Every protocol has a <strong>capital model</strong> that determines the minimum capital to be held, a metric often set to similar standards as EIOPA’s Solvency II, which ensures a confidence level of 99.5% in solvency over a one-year period. Managing the capital ensures that the protocol’s income is sufficient to protect the company against insolvency in case of mass pay-outs.</p><h4>A comparison</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*wocm0D4Ku-L1lQTSTFOteQ.png" /><figcaption>Comparison between Nexus Mutual, InSure and Etherisc. Data from 31 August 2021.</figcaption></figure><h3>Benefits of token-based solutions</h3><h4><strong><em>Secondary Markets</em></strong></h4><p>By tokenizing most elements in the protocol’s workings, secondary insurance markets can be created. Selling and buying of tokenized covers can happen outside of the protocol’s own ecosystem. This would enhance the customer’s experience, it allows him or her to transfer the bought cover to someone else, and it creates an overall more efficient market through arbitrage.</p><h4><strong><em>Transparency</em></strong></h4><p>Because all actions and steps happen on a blockchain, the entire insurance process is visible end to end. Because of this transparency, participants have the opportunity to research a protocol’s trustworthiness themselves.</p><h4><strong><em>Customization</em></strong></h4><p>Tokens can have multiple functions. Maintaining and overseeing those functions is done by the smart contracts and thus does not rely on a single entity intermediary. Endless opportunities arise in the wider ecosystem when a cover is tokenized. It can be transferred to any wallet, it could be used as collateral for a loan, or it can be used to generate yield. Providing specific use cases to the customer connects the insureds with the insurer faster.</p><h3><em>Challenges</em></h3><h4>In Case of Insolvency</h4><p>Today’s protocols often don’t have a plan in place for when insolvency occurs. Although most protocols follow the Minimum Capital Requirements (MCR) standards from EIOPA’s Solvency II to a certain extent, it is hard to do extensive modelling as there is not enough data available.</p><h4><strong><em>Low Competition and Participation</em></strong></h4><p>This currently immature market is primarily dominated by one player, Nexus Mutual. Other projects seem to have little participation. A lack of sufficient service providers is not attractive for customers, who want multiple options to assess their product choice.</p><h4><strong><em>Fragile Incentive and Penalty Mechanism</em></strong></h4><p>Just like traditional insurance companies, a DAO has the incentive to keep funds to its own whenever possible, at least in the short run. This results in reluctance to approve claim requests from customers, as this would result in a money outflow for the protocol. Of course, in the long run, if the DAO keeps acting like this, customers will lose interest in the protocol, which will lead to a depreciation of protocol tokens. This is bad for all stakeholders, also for the DAO. It is clear that the tokenomics should include an explicit way of incentivizing good behavior for all parties.</p><h4><strong><em>Centralization</em></strong></h4><p>Most protocol teams are pre-screening claims or they have the final say in deciding upon the legitimacy of claims. This leads to concentration of power, and a single point of potential failure, which defeats the purpose of decentralizing the process.</p><h3><strong>Conclusion</strong></h3><p>This article is a short summary of token-based insurance solutions. We discussed the actors, tokens and processes involved in a typical decentralized protocol. A number of benefits, as well as disadvantages arise from tokenizing the industry, which is still at a very early stage.</p><p>Secure protocol design and strong tokenomics are absolutely critical in growing the token-based insurance industry. Most attention up until now has primarily gone to one protocol, Nexus Mutual, which had over 1billion USD in cover at its peak in 2021. Other protocols seem to struggle with their design, but interest in the insurance industry is increasing, as the whole DeFi sector is expanding.</p><p>Nevertheless, token-based solutions are able to challenge the traditional insurance market, and with further exploration of blockchain infrastructure in the traditional insurance industry, the use of tokens may be an inflection point in this challenge.</p><p><strong>UCL Centre for Blockchain Technologies</strong><br>Official Website: <a href="http://blockchain.cs.ucl.ac.uk/">http://blockchain.cs.ucl.ac.uk/</a><br>Paper: <a href="https://arxiv.org/abs/2109.07902">https://arxiv.org/abs/2109.07902</a><br>Twitter: <a href="https://twitter.com/simon_defi">Simon DeFi</a> , <a href="https://twitter.com/uclcbt?lang=en">UCL CBT</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7b5a6805197" width="1" height="1" alt=""><hr><p><a href="https://medium.com/uclcbt/insurance-token-based-solutions-on-blockchain-a-summary-e7b5a6805197">Insurance: Token-based solutions on blockchain — A summary</a> was originally published in <a href="https://medium.com/uclcbt">UCL CBT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vesper lending strategies — VSP & vVSP]]></title>
            <link>https://merkle3.medium.com/vesper-lending-strategies-vsp-vvsp-29cddb32f539?source=rss-78d22bdac637------2</link>
            <guid isPermaLink="false">https://medium.com/p/29cddb32f539</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[decentralized-finance]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[yield-farming]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Simon Cousaert]]></dc:creator>
            <pubDate>Thu, 15 Jul 2021 15:59:33 GMT</pubDate>
            <atom:updated>2023-07-20T11:36:38.444Z</atom:updated>
            <content:encoded><![CDATA[<h3>Vesper lending strategies — VSP &amp; vVSP</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*0Tuvbhrn6MM1m3DxDguCFA.png" /></figure><p><em>[Note: The following is not financial advice. I currently work with the Vesper Finance DAO as a researcher and consultant, and I hold VSP. Of course, this is my research and not yours so, as always, DYOR.]</em></p><p>Adventurous Vespernauts holding $VSP and $vVSP received excellent news this week. Recently, <a href="https://twitter.com/CREAM_listing/status/1413538452444958722?s=20">the collateral factors for both VSP and vVSP has increased to 25%</a> on <a href="https://app.cream.finance/">CREAM</a>, and an <a href="https://vote.rari.capital/#/rari/proposal/QmbQf82ukLQkEjxTBYo5MFRX6ak9fSWRrTZaoxX5SrHUbQ">on-chain vote</a> from <a href="https://www.rari.capital/">Rari Capital</a> to give users access to borrowing and lending of $VSP and $vVSP via a new FUSE pool passed unanimously. Let’s take a look at the role of VSP and vVSP within the Vesper ecosystem, at the protocols that are opening up more use-cases for these tokens and how these developments can be translated into interesting strategies.</p><h3>What is Vesper?</h3><p>Vesper is a DeFi protocol launched in February 2021 that provides users with a platform for easy-to-use DeFi products. Today, the Vesper product suite includes a variety of interest-yielding Grow Pools: smart contracts that enable users to passively increase their crypto holdings. As such, Vesper Grow Pools are a so-called ‘yield aggregating’ service. (For more information on yield aggregators, you can read a <a href="https://medium.com/uclcbt/yield-aggregators-in-defi-2fd483412322">summarizing article of one of my most recent papers</a>.) On top of the continuous development effort of the Grow Pools, other products are being developed and will be developed over time. One of those will be <a href="https://twitter.com/jgarzik/status/1407359609384407041">Vesper Earn</a>, a “Deposit-X, Earn-Y” mechanism, launching very soon.</p><p>Apart from these products, a core pillar of the Vesper ecosystem are VSP and vVSP, the latter representing a user’s stake in the <a href="https://app.vesper.finance/eth/0xbA4cFE5741b357FA371b506e5db0774aBFeCf8Fc">vVSP vault</a>. VSP tokens give users access to the <a href="https://docs.vesper.finance/vsp-economics/revenue-model">Vesper revenue model</a>, a process where part of the collected fees by Vesper flow to the treasury box to buy back VSP on the open market, whereafter that VSP gets distributed to vVSP holders. VSP stakers (= vVSP holders) are thus effectively sharing in the revenue created by the Vesper ecosystem. Furthermore, vVSP tokens are eligible to participate in governance votes and are crucial in the <a href="https://docs.vesper.finance/community-participation-and-governance/governance">decentralization plan of Vesper</a>. In short, VSP and vVSP are pivotal parts in the Vesper ecosystem.</p><h3>What are C.R.E.A.M. and Rari Capital?</h3><p>C.R.E.A.M. is a decentralized peer-to-peer lending platform, and is essentially a fork of Compound Finance. Other than Compound, C.R.E.A.M. focuses on longtail assets, with the goal of increasing capital efficiency for all assets in crypto markets. On April 25, an <a href="https://vote.cream.finance/#/cream-finance.eth/proposal/QmTLyBgHkW5RPZMhHrNitf8FUaXgxZb77QiExHqMpcYsuw">on-chain vote passed</a> to have VSP and vVSP listed on the platform. Until now, users were only able to borrow VSP or vVSP with other collateral assets, as Vesper tokens were not allowed to be used as collateral. That changed on July 9, when the <a href="https://twitter.com/CREAM_listing/status/1413538452444958722?s=20">C.R.E.A.M. committee augmented the collateral factor of both VSP and vVSP to 25%</a>.</p><p>Rari Capital is a yield-aggregator with a multitude of products, of which one is called ‘Fuse’. The Fuse platform enables anyone to instantly create their own lending and borrowing pool. As a result, users can use a Fuse pool to lend and borrow the assets of that specific pool freely against each other. On July 12, <a href="https://vote.rari.capital/#/rari/proposal/QmbQf82ukLQkEjxTBYo5MFRX6ak9fSWRrTZaoxX5SrHUbQ">an on-chain vote passed</a> that a new Fuse pool will be created with the following assets: ETH, WBTC, USDC, DAI, VUSD, VSP, vVSP and MET.</p><h3>Lending strategies</h3><p>Because of the above developments regarding lending and borrowing of VSP and vVSP, a multitude of strategies will pop up. The following is a non-exhaustive list of possibilities that Vespernauts are now exposed to. All of the below strategies are using leverage, borrowed assets are being used as a funding source to increase the potential return of an investment. As such, every strategy comes with a certain risk attached, and even though combining multiple strategies with each other is possible, the user should be very aware of the potential risks that are attached to increasing leverage.</p><h4>Deposit vVSP, borrow VSP, stake VSP (and repeat)</h4><p><em>The theory</em>: One of the most straightforward strategies would be to deposit vVSP as collateral to earn a small APY of x%. Next, use your vVSP to borrow VSP at a cost of y%. Finally, stake your VSP in the vVSP vault to earn z% APY. This strategy can be used in a spiral, where this cycle is repeated multiple times.</p><p><em>The risks</em>: There is a small financial risk wherein the cost of borrowing VSP (y%) is getting too expensive for the strategy to be profitable. Especially when the cycle is repeated multiple times, that cost becomes increasingly important because of higher leverage. In an efficient market, liquidation risks are relatively small as the value of VSP will increase or decrease similarly to the value of vVSP due to arbitrage opportunities.</p><h4>Deposit vVSP, borrow risk asset, deploy risk asset</h4><p><em>The theory</em>: You could take the first strategy outside the Vesper ecosystem, by depositing vVSP as collateral for x% APY, to borrow a risk asset like ETH or BTC for a cost of y%. This risk asset can then be deployed in any strategy you want outside of Vesper for a return of z%, and you will keep your exposure to the Vesper revenue model with the deposited vVSP. This strategy thus allows you to keep accruing VSP with vVSP, and use your borrowed capital simultaneously to participate in other yield activities elsewhere.</p><p><em>The risks</em>: There is a small financial risk wherein the cost of borrowing the risk asset (y%) is getting too expensive for the strategy to be profitable. Secondly, if the price of the risk asset increases more compared to vVSP, chances of liquidation increase, as the collateral in vVSP will prove to be of insufficient value to cover the borrowed risk asset. The user should keep an eye on the price relationship between vVSP and the risk asset to avoid liquidation.</p><h4>Deposit stablecoin, borrow VSP, stake VSP</h4><p><em>The theory</em>: Deposit USDC, DAI, VUSD or any other listed USD-pegged stablecoin as collateral on C.R.E.A.M. or the Fuse pool to earn x% APY. With these stablecoins as collateral, borrow VSP against a cost of y%. Deposit the borrowed VSP into the vVSP vault and earn z% APY. With the VSP that you have earned in the vVSP vault after a while, you can pay back the VSP loan that you took. Over time, you should end up with the vVSP that you got, in addition to your initial stablecoin deposit. Your final APY should be something along the lines of x-y+z%, not taking into account gas costs.</p><p><em>The risks</em>: First, there is a small financial risk that the cost of borrowing VSP (y%) becomes too high to be profitable. This will happen for example if the borrowing demand for VSP skyrockets relative to the supply. Secondly, as the price of VSP increases, chances of liquidation increase, as the collateral in stablecoins will prove to be of insufficient value to cover the borrowed VSP.</p><h4>Deposit risk asset, borrow vVSP</h4><p><em>The theory</em>: If you are holding a risk asset (ETH or WBTC for example) and you want to simultaneously continue holding that asset and earning a high yield on it, you can put your risk asset as collateral to earn x%. Let’s assume that you value vVSP in your risk asset (that is, instead of saying your vVSP is worth 15 USD, it is worth 0.0045 ETH). If you think that vVSP will increase in value soon, you can borrow vVSP for a cost of y%. In case the vVSP vault has a return of z% APY, you are basically earning x-y+z% on your risk asset. You still have to add a percentage if vVSP increases in value, or subtract a percentage in case vVSP decreases in value.</p><p><em>The risks</em>: The risks in this strategy are slightly bigger compared to the second strategy. If the price of vVSP denominated in ETH goes up for example, your chances of liquidation go up. If the price of vVSP denominated in ETH goes down, it eats away profitability of the strategy as you’ll need more vVSP denominated in ETH to pay back your loan. Because your collateral is a risk asset, you should think deeply about how you value your assets (for example, denominated in USD or in ETH or BTC).</p><h3>Conclusion</h3><p>It should be clear that there is immense potential value when users can deploy their vVSP in these strategies. Instead of selling VSP returns from the vVSP pool, investors are now able to use their vVSP as collateral to borrow other assets which they can then deploy however they want. This leveraged strategy allows Vespernauts to keep accruing VSP from the Vesper revenue model, whilst also deploying this capital somewhere else, being it in the Vesper ecosystem or outside of it. This opens up many new ways of using VSP and vVSP in different yield strategies, and even though it is important to keep in mind that some strategies can become increasingly risky and that complex mechanisms can amplify both profits as losses, the utility of both VSP and vVSP will be enhanced greatly with the introduction of C.R.E.A.M and Rari Fuse pool.</p><p>Twitter: <a href="https://twitter.com/Merkle3_">Simon Cousaert</a><br>Follow Vesper on <a href="https://twitter.com/vesperfi">Twitter</a>, <a href="https://t.me/vesperfinance">Telegram</a>, <a href="https://youtube.com/c/vesperfinance/">YouTube</a>, and <a href="https://reddit.com/r/vesperfinance/">Reddit</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29cddb32f539" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yield Aggregators in DeFi]]></title>
            <link>https://medium.com/uclcbt/yield-aggregators-in-defi-2fd483412322?source=rss-78d22bdac637------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fd483412322</guid>
            <category><![CDATA[aggregator]]></category>
            <category><![CDATA[yearn-finance]]></category>
            <category><![CDATA[yield-farming]]></category>
            <category><![CDATA[portfolio-management]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Simon Cousaert]]></dc:creator>
            <pubDate>Tue, 01 Jun 2021 09:32:39 GMT</pubDate>
            <atom:updated>2021-06-03T17:35:36.495Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e3WvWa9dlIymDPVcrSICwQ.png" /></figure><p><em>This article summarizes the paper ‘</em><a href="https://arxiv.org/abs/2105.13891"><em>SoK: Yield Aggregators in DeFi</em></a><em>’, a joint work between </em><a href="http://blockchain.cs.ucl.ac.uk/"><em>UCL CBT</em></a><em> and </em><a href="https://www.imperial.ac.uk/computing"><em>Imperial College London</em></a><em>.</em></p><p>Yield farming has been an immensely popular activity for cryptocurrency holders since the explosion of Decentralized Finance (DeFi) in the summer of 2020. Asset managing protocols had well over <a href="https://defipulse.com/">3 billion USD locked in May 2021 and hold 2 billion USD at the moment</a>, at the time of writing.</p><p>While there is a plague of (scam) projects promising huge yields in a short time, yield aggregators such as <a href="https://idle.finance/#/">Idle Finance</a>, <a href="https://pickle.finance/">Pickle Finance</a>, <a href="https://harvest.finance/">Harvest Finance</a> and <a href="https://yearn.finance/">Yearn Finance</a> are trying to build a sustainable source of yield for the DeFi community. This made me wonder:</p><ul><li>Where does that yield come from?</li><li>What are the money legos that yield aggregators make use of?</li><li>What is the general mechanism behind all these aggregators (if there is one)?</li><li>What are the benefits and risks of putting your money in a yield aggregator?</li></ul><p>My paper on <a href="https://arxiv.org/abs/2105.13891">Yield Aggregators in DeFi</a> — a joint work with Jiahua Xu (<a href="http://blockchain.cs.ucl.ac.uk/">UCL Centre for Blockchain Technologies</a>), and Toshiko Matsui (<a href="https://www.imperial.ac.uk/computing">Imperial College London</a>), aims to answer all those questions. We present a generalized framework of yield aggregators. Let’s take a deep-dive into the most “degen” part of DeFi, yield farming.</p><p><strong>To read more technical and in-depth explanations of the framework, please read </strong><a href="https://arxiv.org/abs/2105.13891"><strong>the paper</strong></a><strong>. Any feedback is welcome and much appreciated.</strong></p><h3>A short introduction</h3><p>As you may have read in my <a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-2963d07ebac7">previous posts about AMMs</a>, DeFi has had an explosive growth since the summer of 2020. One of the applications in DeFi that got serious attention is yield farming. The concept was <a href="https://sips.synthetix.io/sips/sip-8">first introduced by Synthetix</a>, but gained traction since the launch and <a href="https://medium.com/compound-finance/expanding-compound-governance-ce13fcd4fe36">distribution of COMP</a>, the governance token of Compound. Since then, Compound participants get rewarded with newly-minted COMP tokens through BOTH lending and borrowing activities, a process later called “liquidity mining”. This process was and still is being copied until this day, which encouraged developers to find a way to combine rewards from different protocols. The premise of yield farming was born. Against this backdrop, aggregating protocols built on top of DeFi primitives are trying to offer a one-stop-shop solution for people wanting to collect the yield.</p><h3>Where does yield come from?</h3><p><a href="https://en.wikipedia.org/wiki/There_ain%27t_no_such_thing_as_a_free_lunch">There ain’t no such thing as a free lunch</a>, so where does the yield that aggregators are collecting come from? There seem to be three main sources.</p><h4>Demand for borrowing</h4><p>As demand for loans in crypto-assets grows, the borrowing interest rate increases, leading to higher yields for lenders. Particularly in a bullish market, speculators are willing to borrow funds despite a high interest rate, because for example, they expect an appreciation in the assets of their leveraged long position. APYs for stablecoins in Aave and Compound reached <a href="https://app.defiscore.io/assets/usdc">10% in April 2021</a>, when market sentiment was extremely bullish.</p><h4>Liquidity mining programs</h4><p>Early participants often receive governance tokens representing protocol ownership. This incentivizes people to put funds into the protocol, as the rewarded tokens often have a governance functionality attached to them. That function is frequently deemed valuable, as the token holders would have a say in the future strategic direction of the project. Essentially, early users are getting rewarded for helping the project grow and for bearing the early-stage entailed by possibly vulnerable smart contracts. Examples are <a href="https://medium.com/sushiswap-org/the-sushiswap-project-8716c429cee1">Sushiswap</a> and <a href="https://medium.com/iearn/yfi-df84573db81">Yearn Finance</a>.</p><h4>Revenue sharing</h4><p>Some tokens entitle users to part of the revenue that is going through the protocol. One example is LP (liquidity provider) tokens in AMMs (about which you can read more <a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-2963d07ebac7">here</a>). The more people trade, the higher the reward is for liquidity providers. Another kind of revenue-sharing token is xSUSHI. Stakers of the SUSHI token, get xSUSHI in return, which entitles them to <a href="https://help.sushidocs.com/products/sushiswap-staking-sushibar-xsushi">receive 0.05% of the Sushiswap protocol trading revenue</a>. Vesper Finance’s governance token, VSP, can be staked into the <a href="https://app.vesper.finance/vvsp">vVSP pool</a> which captures about <a href="https://docs.vesper.finance/vsp-economics/revenue-model">95% of the fees</a> generated by Vesper.</p><h3>The mechanism behind the strategies</h3><p>Now we know where yield comes from, how does a user collect that yield through a yield aggregator? Let&#39;s take an imaginary yield aggregator, called “SimpleYield” as an example to explain the chart below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*SowtJx4G4uY1mhR_2wMRFA.png" /><figcaption>YIeld aggregator mechanism</figcaption></figure><p>In <strong>Phase 0</strong>, funds are pooled in a smart contract. Typically, a pool contains only one asset, although newer protocols allow for multi-asset pools. Users deposit an asset into a pool and in return, they receive tokens that represent their share of the pool&#39;s value. Example: deposit # ETH into the SimpleYiel dETH pool and receive # syETH tokens back, representing x% of the pool’s value.</p><p>In <strong>Phase 1</strong>, the pooled funds are used as collateral to borrow another asset through a lending platform such as Compound, Aave or Maker. This phase is not always necessary and can be skipped. The primary use of this step is to allow the execution of a yield farming strategy with another asset than the originally pooled asset. Example: the ETH collected in the SimpleYield ETH pool can be put into Maker, to borrow the stablecoin DAI.</p><p><strong>Phase 2</strong> contains the yield-generating strategy and can range widely in complexity. The figure below shows that the input of this phase is either non-yield generating assets (red coins) or yield-bearing assets (green coins). As time passes, green coins generate yield and multiply. Example: the SimpleYield ETH Pool used ETH to borrow DAI and now puts that DAI to work into Compound, where the aggregator earns yield with cDAI tokens and COMP tokens as part of the <a href="https://www.delta.exchange/blog/what-is-compound-liquidity-mining#So,_How_Does_Compound_Liquidity_Mining_Work?">Compound liquidity mining program</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*KKZ4OqSFItbcadzxE4Yg6A.png" /><figcaption>Execution process of a single strategy. SC = smart contract</figcaption></figure><p>In the final phase, <strong>Phase 3</strong>, the yield generated in Phase 2 is sold in the open market for the original pool asset and flows back to Phase 0 where it can be re-deployed via Phase 1 and 2. The pool value has now increased without minting new shares, increasing the value of existing shares. Example: The COMP tokens generated in Phase 2 are sold for ETH on Uniswap, and flow back to Phase 0. Your originally minted # syETH tokens are now worth more because the pool value has just increased without minting other syETH tokens.</p><h3>Example strategies</h3><p>Now that we have seen how a yield aggregator typically works, the gist of the protocol is mostly in Phase 2, where yield is actually generated. Let’s look at some examples of yield farming strategies. Note that the examples described here are relatively simple and that these strategies can be a lot more complex in reality.</p><p>The evolution of the pool value has been simulated under controlled market circumstances. The results of that simulation can be found in <a href="https://arxiv.org/abs/2105.13891">the paper</a>.</p><h4>Simple Lending</h4><p>The example used in the previous section is a simple lending strategy. Funds are deposited into a <a href="https://arxiv.org/abs/2006.13922">protocol for loanable funds (PLF)</a> to gain interest and governance tokens as a part of a liquidity mining program.</p><h4>Spiral lending</h4><p>This strategy aims to maximize the amount of governance tokens earned through the liquidity mining program, by spiral lending/borrowing. The aggregator can deposit DAI into a PLF, use that deposit to borrow more DAI and supply that DAI again into the PLF. This cycle can be repeated multiple times, but depending on the supply and interest rate, simulation shows that this strategy becomes very risky when spiraling too many times.</p><h4>Liquidity mining with AMM LP tokens</h4><p><a href="https://arxiv.org/abs/2103.12732">Automated market making (AMM) LP tokens</a> are yield-bearing, as trading fees are retained in the AMM pool. When that AMM also has a liquidity mining program running, users are rewarded with governance tokens besides the yield they get from trading fees. This strategy is also considered relatively risky, as impermanent loss potentially eats a lot of the returns when prices of the underlying assets start to change.</p><h3>The battle-tested yield aggregators: a comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*sYwpkQ4f2LHUmVvy8LOA2A.png" /><figcaption>Major existing and early stage yield aggregators — data from 1 May</figcaption></figure><h4>Idle Finance</h4><p>One of the first yield aggregating protocols is <a href="https://idle.finance/#/">Idle Finance</a>, launched in August 2019. Idle currently only makes use of the simple lending strategy and allocates pool funds over PLFs (Compound, Aave, Fulcrum, dYdX and Maker). There is a “Best-Yield” strategy and a “Risk-Adjusted” strategy. That first one seeks the best interest rate across the mentioned platforms, while the risk-adjusted strategy takes into account a risk factor, to optimize a risk-return score.</p><h4>Pickle Finance</h4><p>Launched in September 2020, <a href="https://pickle.finance/">Pickle</a> offers yield through two products: Pickle Jars (pJars) and Pickle Farms. Jars are yield farming robots, earning returns on users’ funds, while farms are liquidity mining pools where users can earn PICKLE governance tokens by staking different kinds of assets. pJars use the “Liquidity mining with AMM LP tokens”-strategy. Farmers deposit Curve LP tokens or Uniswap/Sushiswap LP tokens which are used to generate governance tokens through liquidity mining programs.</p><h4>Harvest Finance</h4><p><a href="https://harvest.finance/">Harvest</a> launched in August 2020 and offers yield with compounding interest through their own FARM liquidity mining program. The protocol has two main kinds of strategies: Single asset strategies (includes “simple lending”-strategy) and LP token strategies (includes “Liquidity mining with AMM LP tokens”-strategy). 30% of the generated yield is used to buy FARM back in the open market, and flows to FARM stakers instead of the original pool.</p><h4>Yearn Finance</h4><p>The biggest yield aggregator, <a href="https://yearn.finance/">Yearn</a>, was launched in July 2020. Yearn offers a multitude of products, of which Earn and Vaults are considered for this article. Earn pools employ the “simple lending”-strategy and deposit assets into the PLF with the highest interest rate. Vaults allow for more <a href="https://medium.com/yearn-state-of-the-vaults/the-vaults-at-yearn-9237905ffed3">complex strategies</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAe2ZLX-oNVFidJcxU2I2Q.png" /><figcaption>Total value locked, data from <a href="https://defillama.com/home">https://defillama.com/home</a></figcaption></figure><h3>Benefits and risks of yield aggregators</h3><h4>Benefits</h4><ul><li>Yield farmers don’t have to actively compose their own strategy, but they can make use of the workflows invented by other users, turning their <em>investment strategy from active to a more passive approach</em>.</li><li>Because cross-protocol transactions are happening through a smart contract, <em>capital shifts are done automatically</em>, removing the need for the user to transfer funds manually between protocols.</li><li>Funds are pooled in a strategy contract so the <em>gas costs are socialized</em>, resulting in fewer and thus lower interaction costs.</li></ul><h4>Risks</h4><ul><li>Lending and borrowing risks are ever-present when yield farming strategies put assets as collateral to borrow other assets and even when they only supply assets into a PLF. In the case of high utilization (high borrowed funds/supplied funds ratio), when many lenders withdraw at the same time, a certain amount of them might have to wait until some of the borrowers have paid back their outstanding loans. This is called “<em>liquidity risk”</em>. When borrowing funds, there is a “<em>liquidation risk” </em>when the value of the collateral falls below a pre-determined liquidation threshold<em>.</em></li><li>Because yield farming strategies are often built upon a series of DeFi money legos, there is a <a href="https://blog.chain.link/defis-permissionless-composability-is-supercharging-innovation/#:~:text=risks%20of%20composability"><em>composability risk</em></a>. Both technical and economic weaknesses give rise to attractive exploit opportunities for malicious hackers.</li><li>The returns of a strategy are often determined by a lot of factors, and for some strategies, this creates an <em>unstable APY</em>. Fluctuating APYs, caused by divergence loss, low trading activities in AMMs or price changes in governance tokens can be considered unattractive to a lot of potential investors.</li></ul><h3>A Final Word</h3><p>In the past year, a multitude of yield aggregator protocols have sprung up and while the general framework behind them is similar, they all have their own flavor. Idle Finance started in 2019 with a first version of their product, which deposited funds into the PLF that gives the best rate at a given time. Inspired by the liquidity mining program of Compound, Yearn Finance extended this model in July 2020 by inventing more complex strategies, called Vaults, next to their Earn product. As more forms of liquidity mining programs emerged, Harvest Finance and Pickle finance specialized in yield farming with LP tokens later that summer.</p><p>Yield aggregators have been and still are an attractive way to collect yield in DeFi. But how sustainable is this yield? Yield comes from three main sources as we have seen. While research on the sustainability of yield deserves a separate paper on its own, it could be argued that yield coming from native token distribution is relatively short-lived. Once emission schedules are finished, this kind of yield is depleted. Even though new protocols can blossom with their newly started emission schedules, it seems unlikely that this source of yield is sustainable. The demand for borrowing could be more sustainable in that regard, but it is highly dependent on market sentiment, especially for non-stablecoins. Yield from revenue sharing tokens seems to be the most durable, especially if DeFi is able to hold on to recent growth rates.</p><p><strong>UCL Centre for Blockchain Technologies</strong><br>Official Website: <a href="http://blockchain.cs.ucl.ac.uk/">http://blockchain.cs.ucl.ac.uk/</a><br>Paper on ArXiv: <a href="https://arxiv.org/abs/2105.13891">https://arxiv.org/abs/2105.13891</a><br>Github: <a href="https://github.com/SimonCousaert/yieldAggregators">https://github.com/SimonCousaert/yieldAggregators</a><br>Twitter: <a href="https://twitter.com/simon_defi">Simon DeFi</a> , <a href="https://twitter.com/uclcbt?lang=en">UCL CBT</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fd483412322" width="1" height="1" alt=""><hr><p><a href="https://medium.com/uclcbt/yield-aggregators-in-defi-2fd483412322">Yield Aggregators in DeFi</a> was originally published in <a href="https://medium.com/uclcbt">UCL CBT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generalizing Knowledge on DEXs with AMMs — Part II]]></title>
            <link>https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-part-ii-e4581bfc9fc1?source=rss-78d22bdac637------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4581bfc9fc1</guid>
            <category><![CDATA[dex]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[amm]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Simon Cousaert]]></dc:creator>
            <pubDate>Tue, 20 Apr 2021 12:36:20 GMT</pubDate>
            <atom:updated>2021-05-31T08:23:38.826Z</atom:updated>
            <content:encoded><![CDATA[<h3>Generalizing Knowledge on DEXs with AMMs — Part II</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6vf66dpecnq7iVbv0qGnBw.png" /></figure><p>In our <a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-2963d07ebac7">previous post</a>, we introduced the basics and mechanisms behind general AMM protocols. We also compared 4 of the major players: Uniswap v2, Balancer, Curve and DODO. Building upon the huge interest in Uniswap v3, we included the following sections in this second part of our research:</p><ul><li>Uniswap v3 formalization</li><li>An overview table of many other AMM protocols</li><li>DeFi protocols with AMM implementations</li><li>Security issues, including AMM-related attacks</li></ul><p>The second version of the <a href="https://arxiv.org/abs/2103.12732">paper</a> extends the information discussed in <a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-2963d07ebac7">Part I</a>. It is a joint work with Jiahua Xu and Nazariy Vavryk <a href="http://blockchain.cs.ucl.ac.uk/">UCL Centre for Blockchain Technologies</a>, and Krzysztof Paruch from the <a href="https://www.wu.ac.at/en/">Vienna University of Economics and Business</a>. Let’s take another deep dive into AMMs and explore their environments.</p><p><strong>To read more technical and in-depth explanations of the added sections, please read </strong><a href="https://arxiv.org/abs/2103.12732"><strong>the paper</strong></a><strong>. Any feedback is welcome and much appreciated.</strong></p><h3>Recap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VGonDJYq5p4-dqrv.png" /><figcaption>Figure 1: State space representation of a typical AMM workflow</figcaption></figure><p>Figure 1 gives a good summary of the basics discussed in the previous post. Different actors in the AMM are able to perform different actions that alter the state of the pool they are interacting with. Certain costs such as slippage impermanent loss are attached to using an AMM protocol</p><p>We have seen that every major AMM has its own flavor in designing its protocol, which leads to advantages in specific use-cases. Everyone can create a standard vanilla Uniswap, Balancer allows for different reserve weights, Curve only pools equal-peg stablecoins and DODO ensures there is no impermanent loss for liquidity providers.</p><h3>Uniswap v3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3U1noG-K8QewR04--5zSeQ.png" /></figure><p><a href="https://uniswap.org/blog/uniswap-v3/">Recently introduced</a>, Uniswap v3 will be the latest version of the highest-volume AMM currently in existence. v3 introduces concentrated liquidity and multiple fee tiers. Liquidity providers are now able to concentrate their deposited liquidity into certain price ranges, leading up to 4000x capital efficiency compared to v2, and allows traders to execute their orders with low slippage.</p><p>Unlike Uniswap v2, the Uniswap v3 conservation function now contains a hyperparameter 𝒜 that determines how concentrated the LP provides the liquidity around the spot price. When 𝒜 → +∞, the covered price range approaches (0,∞), which is equal to Uniswap v2 with no capital efficiency. When 𝒜 → 1, liquidity is provided very close to the exchange rate, and thus very concentrated.</p><h3>Overview of DEXs with AMMs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3PYqG9GZ3L1BVB-s4deq4A.png" /></figure><p>The above table gives an overview of the major DEX protocols implementing AMMs. The majority of protocols use a constant-product based conservation function, few have a constant-sum component. The latest versions of protocols, such as Uniswap v3 and Kyber 3.0 include a capital concentration component to increase capital efficiency. The Flash loan attack has some widely known examples, using one sole DEX as price oracle seems to be an often exploited design flaw. Ethereum is with no doubt home to the most used DEXs.</p><h3>Other AMM implementing products</h3><p>AMMs form the basis of other protocols that implement existing or invent newly designed bonding curves that facilitates the functionalities of these products.</p><h4>Gyroscope protocol</h4><p><a href="https://gyro.finance/">Gyroscope</a> is a stablecoin, backed by a reserve portfolio that diversifies all DeFi risks. Gyro Dollars can be minted for a price near $1 and can be redeemed for an amount worth near $1 in reserve assets, as determined through a new Automated Market Maker (AMM) design that balances risk in the system. Gyroscope includes a Primary-market AMM (P-AMM), through which Gyro Dollars are minted and redeemed, and a Secondary-market AMM (S-AMM) for Gyro Dollar trading.</p><h4>Pods Finance</h4><p><a href="https://www.pods.finance/">Pods</a> is a decentralized non-custodial options protocol that allows users to create calls and or puts and trade them in the Options AMM. Users can participate as sellers and buy puts and calls in a liquidity pool or act as liquidity providers in such a pool. The specific AMM is one-sided and built to facilitate an initially illiquid options market and price option algorithmically using the Black-Scholes pricing model.</p><h4>Balancer LBP</h4><p><a href="https://docs.balancer.finance/guides/smart-pool-templates-gui/liquidity-bootstrapping-pool">Liquidity Bootstrapping Pools (LBPs)</a> are pools where controllers can change the parameters of the pool in controlled ways, unlike immutable pools. The idea of an LBP is to launch a token in a fair manner, by setting up a 2-token pool with a project token and a collateral token. The weights are initially set heavily in favor of the project token, then gradually “flip” to favor the collateral coin by the end of the sale.</p><h4>Yield space</h4><p><a href="https://yield.is/YieldSpace.pdf">The YieldSpace paper</a> introduces an automated liquidity provider for fixed yield tokens. A formula called the “constant power sum invariant” incorporates time to maturity as an input and ensures that the liquidity provider offers a constant interest rate — rather than price — for a given ratio of its reserves. fyTokens are synthetic tokens that are redeemable for a target asset after a fixed maturity date. The price of a fyToken floats freely before maturity, and that price implies a particular interest rate for borrowing or lending that asset until the fyToken’s maturity. Standard AMM protocols are capital-inefficient. By introducing the concept of a constant power sum formula, the writers want to build a liquidity provision formula that works in “yield space” instead of “price space”.</p><p>For more implementing products, we encourage you to read <a href="https://arxiv.org/abs/2103.12732">the paper</a>.</p><h3>AMM-related attacks</h3><p>DEXs with AMMs are often involved in DeFi exploits. The following attack descriptions explain how AMM protocols themselves and the protocols implementing them are vulnerable.</p><h4>Flash loan Oracle attacks</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*AqwxaL77Pj0TQ7YtLXKrhg.png" /></figure><p>At the end of 2020, a series of flash loan-funded price oracle attacks caused exploits in numerous protocols. In this kind of attack, adversaries manipulate protocols that use a DEX as their sole price oracle.</p><p>The attack temporarily distorts the price of token A relative to token B. After the prices are arbitraged back, the attack leaves the loan taken from step 3 undercollateralized, jeopardizing the safety of lenders’ funds on PLF.</p><p>Examples of such attacks are exploits on <a href="https://medium.com/harvest-finance/harvest-flashloan-economic-attack-post-mortem-3cf900d65217">Harvest finance</a>, <a href="https://peckshield.medium.com/value-defi-incident-root-cause-analysis-fbab71faf373">Value DeFi</a> and <a href="https://cointelegraph.com/news/cheese-bank-s-multi-million-dollar-hack-explained-by-security-firm">Cheese bank</a>.</p><h4>Rug pull</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*o6wjq9H9FaNyJ6aOvhQISg.png" /></figure><p>The general idea of a rug pull is to lure people into buying the coin with no value, subsequently swapping this coin for ETH or another cryptocurrency with value. One method is to create a coin with the same name as an existing one. This attracts a lot of attention since everyone wants to pick up the coin at the lowest price possible. The coin is being bought up until, at one point, the original liquidity provider withdraws his liquidity which now exists of much more ETH and less of the valueless fake token.</p><h4>Sandwich attacks</h4><p>Combing front- and back-running, a “sandwich attacker” places his orders immediately before and after the victim’s trade transaction. The attacker uses front-running to cause victim losses, and then uses back-running to pocket benefits.</p><p>One example is a sandwich price attack, in which for example a large buy order is seen by a malicious actor. That actor buys before the initial transaction can go through, thus moving the price up. The original transaction is now executed. Afterwards, the malicious actor back-runs the transaction and sells the previously bought tokens for a higher price, pocketing the price difference.</p><h4>Vampire Attack</h4><p><a href="https://www.coindesk.com/sushiswap-uniswap-migration-defi-amm-wars">In September 2020, Sushiswap performed a “Vampire attack”</a>, effectively sucking liquidity out of Uniswap and depositing it in their own protocol.</p><p>In the first step of a Vampire attack, a new protocol incentives liquidity providers of another platform to stake their LP tokens into the protocol. In the case of Sushiswap, Uniswap LPs were rewarded with SUSHI tokens when they staked their LP tokens into the Sushiswap protocol. In the second stage, a migration of liquidity happens. The migration process was executed by a smart contract that took the Uniswap LP tokens in Sushiswap, converted those to the represented liquidity on Uniswap, transferred the assets to Sushiswap and got Sushiswap LP tokens in return. Effectively, Sushiswap migrated liquidity from Uniswap to Sushiswap, thereby moving $830 million to the newborn AMM, giving access to more volume and thus creating a more attractive proposition to users. Users’ Uniswap LP tokens got automatically replaced with Sushiswap LP tokens, representing the same liquidity.</p><h3>Conclusion</h3><p>In <a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-2963d07ebac7">part I</a>, we laid out the basic mechanics and principles of AMM protocols. The major protocols each add their own flavor to those mechanics.</p><p>In this part, we added one more AMM - Uniswap v3 -, which led us to a big overview table of major DEXs with AMMs. We introduced a number of AMM implementing products, showing that AMMs are of great use under the hood of other DeFi products. Finally, AMMs are often involved in different kinds of attacks and so these vulnerabilities should be accounted for in designing AMMs or protocols that use AMMs.</p><p><strong>UCL Centre for Blockchain Technologies</strong><br>Official Website: <a href="http://blockchain.cs.ucl.ac.uk/">http://blockchain.cs.ucl.ac.uk/</a><br>Paper on ArXiv: <a href="https://arxiv.org/abs/2103.12732">https://arxiv.org/abs/2103.12732</a><br>Github: <a href="https://github.com/xujiahuayz/bondingcurves">https://github.com/xujiahuayz/bondingcurves</a><br>Twitter: <a href="https://twitter.com/simon_defi">Simon DeFi</a> , <a href="https://twitter.com/uclcbt?lang=en">UCL CBT</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4581bfc9fc1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-part-ii-e4581bfc9fc1">Generalizing Knowledge on DEXs with AMMs — Part II</a> was originally published in <a href="https://medium.com/uclcbt">UCL CBT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generalizing knowledge on DEXs with AMMs]]></title>
            <link>https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-2963d07ebac7?source=rss-78d22bdac637------2</link>
            <guid isPermaLink="false">https://medium.com/p/2963d07ebac7</guid>
            <category><![CDATA[amm]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[decentralized-finance]]></category>
            <category><![CDATA[dex]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Simon Cousaert]]></dc:creator>
            <pubDate>Thu, 25 Mar 2021 16:38:01 GMT</pubDate>
            <atom:updated>2021-05-31T08:22:52.254Z</atom:updated>
            <content:encoded><![CDATA[<h3>Generalizing knowledge on DEXs with AMMs — Part I</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F0BKUnCk1bCr7klYpCfAig.png" /></figure><p><em>This is the first part in a two-part series about </em><a href="https://arxiv.org/abs/2103.12732"><em>our paper</em></a><em>. Part II can be found </em><a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-part-ii-e4581bfc9fc1"><em>here</em></a><em>.</em></p><p>With the heated discussion on <a href="https://uniswap.org/blog/uniswap-v3/">Uniswap v3</a>, the interest in Decentralized Exchanges (DEXes) with Automated Market Making (AMM) protocols is again reaching high levels of interest. At the time of writing, AMM-based DEXes have an aggregate value locked <a href="https://defipulse.com/">of over 15 billion USD</a>.</p><p>Those of you who are a bit late in the game might still wonder:</p><ul><li>What is an AMM?</li><li>Who are the key actors of an AMM?</li><li>What are the benefits and costs of participating in an AMM-based exchange?</li><li>What are the major AMM protocols and how do they differ?</li></ul><p>My <a href="https://arxiv.org/abs/2103.12732">paper on DEXes with AMMs</a> — a joint work with Jiahua Xu and Nazariy Vavryk <a href="http://blockchain.cs.ucl.ac.uk/">UCL Centre for Blockchain Technologies</a>, and Krzysztof Paruch from the <a href="https://www.wu.ac.at/en/">Vienna University of Economics and Business</a>, aims to answer all those questions. We present a generalized framework of these AMMs. Let’s have a review of the existing, time-tested protocols in this summary piece.</p><p><strong>To read more technical and in-depth explanations of the framework, please read </strong><a href="https://arxiv.org/abs/2103.12732"><strong>the paper</strong></a><strong>. Any feedback is welcome and much appreciated.</strong></p><h3>The Basics</h3><p>Different from order-book based exchanges where the market price of an asset is determined by the last matched buy and sell orders, each AMM uses a so-called <strong>conservation function</strong> that determines asset price algorithmically, by only allowing the exchange rates to move along predefined trajectories. Liquidity in the market is provided by so-called ‘<strong>liquidity providers</strong>’ who supply funds in a ‘liquidity pool’, a big pile of assets that users can trade against.</p><h4><strong>Core Actors</strong></h4><p>In a typical AMM system, there are 3 core actors:</p><ul><li><em>A liquidity pool creator</em> deploys a new smart contract that acts as a liquidity pool with some initial supply of assets. The process of pool creation and setting the pool hyperparameters (weights, interpolating factor, initial supply…) can be fully decentralized (as is the case for Uniswap) or can be restricted to whitelisted addresses (as is the case for Curve).</li><li><em>Liquidity providers</em> can subsequently increase the reserve of the pool by adding more of the assets that are contained in the pool. In turn, they receive shares proportionate to their liquidity contribution as a fraction of the entire pool. The act of liquidity provision or removal updates the value of the conservation function invariant(s).</li><li><em>Traders </em>submit an exchange order to a liquidity pool by specifying which asset to spend — the input asset — and which to be received — the output asset. A trader can choose to specify the quantity of either the input asset or the output asset, and the smart contract will automatically calculate the exchange rate based on the conservation function, and execute the exchange order accordingly. Exchange users must pay swap fees to liquidity providers for using their pools.</li></ul><h4>Assets</h4><p>Multiple asset types are used in AMM protocols, facilitating the functionality and allowing for governance:</p><ul><li><em>Risk &amp; Base</em> assets are the tokens within a certain liquidity pool . Each pool contains at least one risk asset, which is the main asset type the protocol was designed for: to provide liquidity in these assets, to facilitate exchange between them and to allow liquidity providers to earn rewards in return for their contribution. Base assets are used in some protocol to create a trading pair with a risk asset. For example, in Bancor every risk asset is paired with BNT and in Uniswap v1, ETH was the base asset for every pool.</li><li><em>LP tokens (or ‘LP shares’) </em>represent ownership in the portfolio of assets within a pool, and are distributed to liquidity providers. Shareholders earn fees whenever a trade occurs. Shares can be redeemed in exchange for the liquidity initially provided.</li></ul><h4>Implicit costs</h4><p>Some implicit costs are native to the use of traditional AMM structures:</p><ul><li><em>Slippage </em>is defined as the difference between the spot price and the realized price of a trade and is caused by the price curve design feature of an AMM that dictates asset prices. Instead of matching buy and sell orders, a conservation function determines exchange rates with a continuous curve. Therefore, a trade on an AMM-based DEX will always encounter some degree of slippage, depending on the exact design of the conservation function.</li><li><em>Impermanent loss</em> is the difference between holding assets in an AMM and holding them in your wallet, which occurs when the price of tokens inside an AMM diverge in any direction. As arbitrage opportunities pop up, profit extracted by the arbitrageurs is taken from the pockets of liquidity providers. The loss is ‘impermanent’ because as asset price moves back and forth, the depreciation of the pool value disappears and reappears all the time.</li></ul><h3>Mechanisms</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srgSsfEgsPM7U8IKxwzqJA.png" /><figcaption>Figure 1: State space representation of a typical AMM workflow</figcaption></figure><p>Overall, the functionality of an AMM can be generalized formally by a set of very few mechanisms. An overview is shown in Figure 1. A generalized mathematical framework of the described mechanisms, such as the conservation function, swap amount function, slippage function and divergence loss function can be found <a href="https://arxiv.org/abs/2103.12732">in the paper</a>.</p><h3>Comparison</h3><p>We compare 4 of the most representative AMMs currently available: Uniswap v2, Balancer v1, Curve and Dodo. <a href="https://arxiv.org/abs/2103.12732">Our paper</a> includes general mathematical notations used in the pool mechanism formulations. This ensures that any kind of discussed AMM structures is denoted with the same symbols, creating a general framework.</p><h4>Uniswap v2</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2uk985QZJIlXrYoa3hB4A.png" /><figcaption>Figure 2: The conservation function, slippage function and divergence loss — Uniswap v2</figcaption></figure><p>The Uniswap v2 protocol prescribes that a liquidity pool always consists of two assets and assumes that the reserves of those two assets have equal value. Given this<em> equal value assumption</em> encoded in the pool smart contract, the implied spot price of assets in a liquidity pool can be derived based on the ratio between their reserve quantities. This results of a constant-product invariant function.</p><p>Uniswap represents the most rudimentary form of the AMM protocols, but remains widely popular, with over 50% market share at the time of writing, in terms of 30-day trading volume.</p><h4>Balancer v1</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjc5af6Ug0DyZsndoj_6LA.png" /><figcaption>Figure 3: The conservation function, slippage function and divergence loss. 2 assets with changing weights — Balancer v1</figcaption></figure><p>The Balancer protocol allows each liquidity pool to have more than two assets. Each asset reserve rₖ is assigned with a weight wₖ at pool creation, where ∑wₖ=1. Weights are pool hyperparameters, and do not change with either liquidity provision/removal or asset swap. The weight of an asset reserve represents the value of the reserve as a fraction of the pool value.</p><p>Balancer can be deemed a generalization of Uniswap v2; the latter is a special case of the former with w₁ = w₂ = 1/2.</p><h4>Curve</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uy5qcBkQi7DyuqohB1UNHw.png" /><figcaption>Figure 4: The conservation function, slippage function and divergence loss. 2 assets with changing 𝒜 — Curve</figcaption></figure><p>In Curve, a liquidity pool consists of two or more assets with a common peg, for example {wBTC, renBTC} or {USDC, USDT, DAI}. This ensures that asset price changes relative to the other asset(s) in the pool is minimal, minimizing divergence loss.</p><p>As assets from the same pool are connected to the same peg by design, the ideal exchange rate between them should always equal 1. Theoretically, this could be achieved by a constant-sum invariant. Nevertheless, Curve seeks to allow an exchange rate to deviate from 1, in order to reflect the supply-demand dynamic, while simultaneously keeping the slippage low.</p><p>Curve achieves this by interpolating between two invariants, constant sum and constant product, with hyperparameter 𝒜 as the interpolating factor. When 𝒜 → 0, the conservation function boils down to a constant-product one like Uniswap; when 𝒜 → +∞, the conservation function is essentially a constant-sum one with constant exchange rate equal to 1.</p><h4>Dodo</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sU_Zjiwe0ZNhDwtRzoysJQ.png" /><figcaption>Figure 5: The conservation function, slippage function and divergence loss. 2 assets with changing 𝒜 — Dodo</figcaption></figure><p>While other AMMs derive the exchange rate between two assets in a pool purely from the conservation function, Dodo does it the other way around. Resorting to external market data as a major determinant of the exchange rate, Dodo has its conservation function derived from its exchange rate formula. The exchange rate between the two assets in a Dodo pool is set by the market rate with an adjustment based on the pool composition.</p><p>Labeled as a <a href="https://dodoexhelp.zendesk.com/hc/en-us/articles/900003908066-DODO-A-Revolution-in-On-Chain-Liquidity">Proactive Market Maker (PMM)</a>, Dodo uses a price oracle to guide prices or price discovery by mimicking the behavior of human market makers and efficiently allocating funds near the market price. As market prices changes, the PMM algorithm proactively shifts the price curve in the same direction to ensure that the section in the vicinity of the market price remains flat, allowing better liquidity provision at every price.</p><p>The Dodo protocol also includes a liquidity parameter 𝒜<em> </em>that governs the slope of the invariant function. When 𝒜 → 1 and liquidity provided on both assets are of equal value, the conservation function boils down to a constant-product one, as with Uniswap; when 𝒜 → 0 , the conservation function is essentially a constant-sum one.</p><p>Finally, Dodo eliminates the kind of divergence loss seen in previously discussed protocols by not forcing liquidity providers to deposit tokens in predefined ratios.</p><blockquote>DODO eliminated both impermanent loss and the price risk outlined above at root cause — it does not interfere with LPs’ assets in any way and gives LPs full liberty to deposit any combination of base and quote tokens in a trading pair. Each trading pair is actually two separate pools rather than one big 50/50 pool. This means that LPs can always get out what they put in, assuming no market risk. Solving impermanent loss is thus equivalent to unlocking single-token exposure. ~ <a href="https://medium.com/dodoex/why-there-is-no-impermanent-loss-on-dodo-4d82b2b532bc">DodoEx</a></blockquote><h3>Discussion</h3><p>The comparison above should clarify that some AMM protocols are more fit than others in certain use cases. Uniswap’s simple structure facilitates pool creation for every token issuer that wants to start a liquidity pool for a crypto asset, making it the most popular AMM in existence. The Uniswap v2 factory has produced over 30,000 pools since it’s start in April 2020. Balancer’s feature of weighting assets within the same pool leads to more efficient liquidity providing. The Balancer Liquidity Bootstrapping pools allow for easy price discovery for early and high-demand tokens, by changing the weights of two assets in the Bootstrapping pool gradually over time.</p><p>If one needs to trade similarly priced assets such as stablecoins, then Curve will fit your needs. Curve allows for nearly constant-sum invariant functions, leading to a handy near-1:1 exchange rate which facilitates swaps between assets with the same peg. Finally, Dodo introduces zero-divergence loss liquidity providing by combining the traditional AMM concepts with more complex liquidity provision mechanisms such as single-sided exposure.</p><p>This is the first part in a two-part series. Part II can be found <a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-part-ii-e4581bfc9fc1">here</a>.</p><p><strong>UCL Centre for Blockchain Technologies</strong><br>Official Website: <a href="http://blockchain.cs.ucl.ac.uk/">http://blockchain.cs.ucl.ac.uk/</a><br>Paper on ArXiv: <a href="https://arxiv.org/abs/2103.12732">https://arxiv.org/abs/2103.12732</a><br>Github: <a href="https://github.com/xujiahuayz/bondingcurves">https://github.com/xujiahuayz/bondingcurves</a><br>Twitter: <a href="https://twitter.com/simon_defi">Simon DeFi</a> , <a href="https://twitter.com/uclcbt?lang=en">UCL CBT</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2963d07ebac7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/uclcbt/generalizing-knowledge-on-dexs-with-amms-2963d07ebac7">Generalizing knowledge on DEXs with AMMs</a> was originally published in <a href="https://medium.com/uclcbt">UCL CBT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>