DeFi and the Future of Finance by Campbell R.

DeFi and the Future of Finance by Campbell R.

INTRODUCTION

We have come full circle. The earliest form of market exchange was peer to peer, also known as barter.1 Barter was highly inefficient because supply and demand had to be exactly matched between peers. To solve the matching problem, money was introduced as a medium of exchange and store of value. Initial types of money were not centralized. Agents accepted any number of items such as stones or shells in exchange for goods. Eventually, specie money emerged, a form in which the currency had tangible value. Today, we have non-collateralized (fiat) currency controlled by central banks. The form of money has changed over time, but the basic infrastructure of financial institutions has not.

However, the scaffolding is emerging for a historic disruption of our current financial infrastructure. DeFi, or decentralized finance, seeks to build and combine open-source financial building blocks into sophisticated products with minimized friction and maximized value to users utilizing blockchain technology. Given it costs no more to provide services to a customer with $100 or $100 million in assets, we believe that DeFi will replace all meaningful centralized financial infrastructure in the future. This is a technology of inclusion whereby anyone can pay the flat fee to use and benefit from the innovations of DeFi.

DeFi is fundamentally a competitive marketplace of decentralized financial applications that function as various financial “primitives” such as exchange, save, lend, and tokenize. These applications benefit from the network effects of combining and recombining DeFi products and attracting increasingly more market share from the traditional financial ecosystem.

Our book details the problems that DeFi solves: centralized control, limited access, inefficiency, lack of interoperability, and opacity. We then describe the current and rapidly growing DeFi landscape and present a vision of the future opportunities that DeFi unlocks. Let's begin with the problems.

FIVE KEY PROBLEMS OF CENTRALIZED FINANCIAL SYSTEMS

For centuries, we have lived in a world of centralized finance. Central banks control the money supply. Financial trading is largely done via intermediaries. Borrowing and lending are conducted through traditional banking institutions. In the last few years, however, considerable progress has been made on a much different model: decentralized finance. In this framework, peers interact with peers via a common ledger not controlled by any centralized organization. DeFi offers considerable potential for solving the following five key problems associated with centralized finance: centralized control, limited access, inefficiency, lack of inoperability, and opacity

  • Centralized Control. Centralization has many layers. Most consumers and businesses deal with a single, localized bank, which controls rates and fees

  • Limited Access. Today, 1.7 billion people are unbanked, making it very challenging for them to obtain loans and to operate in the world of internet commerce

  • Inefficiency, In the current banking system, deposit interest rates remain very low and loan rates high because banks need to cover their brick-and-mortar costs. The insurance industry provides another example.

  • Lack of Interoperability. Consumers and businesses deal with financial institutions in an environment that locks interconnectivity. It is well-known that the U.S. financial system is siloed and designed to sustain high switching costs

  • Opacity. The current financial system is not transparent. Bank customers have very little information on the financial health of their bank and instead must place their faith in the limited government protection of FDIC insurance on their deposits

IMPLICATIONS

The implications of these five problems are twofold.

  • First, many of these costs lead to lower economic growth

  • Second, these problems perpetuate or exacerbate inequality

These implications are far-reaching, and, by any calculations, this is a long list of serious problems endemic to our current system of centralized finance. Our financial infrastructure has failed to fully adapt to the digital era in which we are living. Decentralized finance offers new opportunities

First, we identify the weaknesses in the current system, including discussion of some early initiatives that challenged the business models of centralized finance. Next, we explore the origins of decentralized finance. We then discuss a critical component of DeFi: blockchain technology. Next, we detail the solutions DeFi offers and couple this with a deep dive on some leading ideas in this emerging space. We then analyze the major risk factors and conclude by looking to the future and attempt to identify the winners and losers.

THE ORIGINS OF MODERN DECENTRALIZED FINANCE

A BRIEF HISTORY OF FINANCE

Even as today's financial system is plagued with inefficiencies, it is far better than those of the past, where market exchanges were peer to peer and bartering required two parties' needs to match exactly

Modern coinage came much later, first emerging in Lydia around 600 BCE and providing what we think of as today's functions of money: unit of account, medium of exchange, and store of value. Important characteristics of money included durability, portability, divisibility, uniformity, limited supply, acceptability, and stability. Bank notes, originating in China, made their way to Europe in the thirteenth century

Nonphysical transfer of money originated in 1871 with Western Union

The last 75 years has seen many firsts in the financial world: credit card in 1950 (Diners Club); automated teller machine (ATM) in 1967 (Barclays Bank); telephone banking in 1983 (Bank of Scotland); Internet banking in 1994 (Stanford Federal Credit Union); radio-frequency identification (RFID) payments in 1997 (Mobil Speedpass); chip-and-pin credit cards in 2005 (Mastercard); and Apple Pay with a mobile device in 2014 (Apple).

Importantly, all these innovations were built on the backbone of centralized finance. While there have been some technological advances, the structure of today’s banking system has not changed much in the past 150 years. That is, digitization still supported a legacy structure. The high costs associated with this legacy system has spurred further advances known as fintech

FINTECH

When costs are high, innovation will arise to capitalize on inefficiencies. Sometimes, however, a powerful layer of middle people can slow this process. An early example of decentralized finance emerged in the foreign currency (forex) market 20 years ago. At the time, large corporations used their investment banks to manage their forex needs

The excessive costs of transacting has ushered in many fintech innovations. PayPal,3 founded more than 20 years ago, is a forerunner in the payments space; in 2017, seven of the largest U.S. banks added their own payment system called Zelle.4 An important commonality of these cost-reducing fintech advances is that they rely on the centralized backbone of the current financial infrastructure

BITCOIN AND CRYPTOCURRENCY

The dozens of digital currency initiatives beginning in the early 1980s all failed.5 The landscape shifted, however, with the publication of the famous Satoshi Nakamoto Bitcoin white paper6 in 2008, which presents a peer-to-peer system that is decentralized and uses the concept of blockchain. Invented in 1991 by Haber and Stornetta,7 blockchain was initially primarily envisioned to be a time-stamping system to keep track of different versions of a document. The key innovation of Bitcoin was to combine the idea of blockchain (time stamping) with a consensus mechanism called proof of work (introduced by Back8 in 2002). The technology produced an immutable ledger that eliminated a key problem with any digital asset: you can make perfect copies and spend them multiple times. Blockchains allow for the important features desirable in a store of value, which were never before simultaneously present in a single asset. Blockchains allow for cryptographic scarcity (Bitcoin has a fixed supply cap of 21 million), censorship resistance and user sovereignty (no entity other than the user can determine how to use funds), and portability (can send any quantity anywhere for a low flat fee). These features combined in a single technology make cryptocurrency a powerful innovation

The value proposition of Bitcoin is important and can be best understood juxtaposed with that of other financial assets

The original cryptocurrencies offered an alternative to a financial system that had been dominated by governments and centralized institutions such as central banks. They arose largely from a desire to replace inefficient, siloed financial systems with immutable, borderless, open-source algorithms. These new currencies can adjust their parameters such as inflation and mechanism for consensus via their underlying blockchain to create different value propositions

ETHEREUM AND DeFi

Ethereum (ETH) is currently the second largest cryptocurrency by market cap ($260b). Vitalik Buterin introduced the idea in 2014, and Ethereum mined its first block in 2015

Ethereum is in some sense a logical extension of the applications of Bitcoin because it allows for smart contracts – which are code that lives on a blockchain, can control assets and data, and define interactions between the assets, data, and network participants. The capacity for smart contracts defines Ethereum as a smart contract platform.

Ethereum and other smart contract platforms specifically gave rise to the decentralized application, or dApp. The backend components of these applications are built with interoperable, transparent smart contracts that continue to exist if the chain they live on exists. dApps allow peers to interact directly and remove the need for a company to act as a central clearing house for app interactions. It quickly became apparent that the first killer dApps would be financial ones

The drive toward financial dApps became the DeFi movement, which seeks to build and combine open-source financial building blocks into sophisticated products with minimized friction and maximized value to users

DeFi is fundamentally a competitive marketplace of financial dApps that function as various financial “primitives” such as exchange, lend, and tokenize. They benefit from the network effects of combining and recombining DeFi products and attracting increasingly more market share from the traditional financial ecosystem. Our goal in this book is to give an overview of the problems that DeFi solves, describe the current and rapidly growing DeFi landscape, and present a vision of the future opportunities that DeFi unlocks.

DeFi INFRASTRUCTURE

BLOCKCHAIN

The key to all DeFi is the decentralizing backbone: a blockchain. Fundamentally, blockchains are software protocols that allow multiple parties to operate under shared assumptions and data without trusting each other. These data can be anything, such as location and destination information of items in a supply chain or account balances of a token. Updates are packaged into “blocks” and are “chained” together cryptographically to allow an audit of the prior history – hence the name.

Blockchains are possible because of consensus protocols – sets of rules that determine what kinds of blocks can become part of the chain and thus the “truth.” These consensus protocols are designed to resist malicious tampering up to a certain security bound. The blockchains we focus on currently use the proof of work (PoW) consensus protocol, which relies on a computationally and energy intensive lottery to determine which block to add. The participants agree that the longest chain of blocks is the truth. If attackers want to make a longer chain that contains malicious transactions, they must outpace all the computational work of the entire rest of the network. In theory, they would need most of the network power (“hash rate”) to accomplish this – hence, the famous 51 percent attack being the boundary of PoW security

The focus here is on proof of work, but many alternative consensus mechanisms exist, the most important of which is proof of stake (PoS). Validators in PoS commit some capital (the stake) to attest that the block is valid and make themselves available by staking their cryptocurrency. Then, they may be selected to propose a block, which needs to be attested by many of the other validators. Validators profit by both proposing a block and attesting to the validity of others’ proposed blocks. PoS is much less computationally intensive and requires vastly less energy

The most popular application of blockchain technology is cryptocurrency, a token (usually scarce) that is cryptographically secured and transferred. The scarcity is what assures the possibility of value and is itself an innovation of blockchain

No one can post a false transaction without ownership of the corresponding account due to the asymmetric key cryptography protecting the accounts. You have one “public” key representing an address to receive tokens and a “private” key used to unlock and spend tokens over which you have custody. This same type of cryptography is used to protect your credit card information and data when using the Internet. A single account cannot “double spend” its tokens because the ledger keeps an audit of the balance at any given time and the faulty transaction would not clear. The ability to prevent a double spend without a central authority illustrates the primary advantage of using a blockchain to maintain the underlying ledger

THE SMART CONTRACT PLATFORM

A crucial ingredient of DeFi is a smart contract platform, which goes beyond a simple payments network such as Bitcoin and enhances the chain's capabilities. Ethereum is the primary example. A smart contract is code that can create and transform arbitrary data or tokens on top of the blockchain to which it belongs. Powerfully, it allows the user to trustlessly encode rules for any type of transaction and even create scarce assets with specialized functionality. Many of the clauses of traditional business agreements could be shifted to a smart contract, which not only would enumerate but also algorithmically enforce those clauses. Smart contracts go beyond finance to include gaming, data stewardship, and supply chain

Ethereum charges a gas fee for every transaction – similar to how driving a car takes a certain amount of gas, which costs money

However, gas is a primary mechanism for preventing system attacks that generate an infinite loop of code

On a smart contract platform, the possibilities rapidly expand beyond what developers desiring to integrate various applications can easily handle. This leads to the adoption of standard interfaces for different types of functionality. On Ethereum, these standards are called Ethereum Request for Comments (ERC). The best known of these define different types of tokens that have similar behavior

ORACLES

An interesting problem with blockchain protocols is that they are isolated from the world outside of their ledger. That is, the Ethereum blockchain authoritatively knows what is happening only on the Ethereum blockchain and not, for example, the level of the S&P 500 or which team won the Super Bowl. This limitation constrains applications to Ethereum native contracts and tokens, thus reducing the utility of the smart contract platform; it is generally known as the oracle problem. In the context of smart contract platforms, an oracle is any data source for reporting information external to the blockchain. How can we create an oracle that can authoritatively speak about off-chain information in a trust-minimized way? Many applications require an oracle, and the implementations exhibit varying degrees of centralization

There are several implementations of oracles in various DeFi applications. A common approach is for an application to host its own oracle or hook into an existing oracle from a well-trusted platform

STABLECOINS

A crucial shortcoming of many cryptocurrencies is excessive volatility. This adds friction to users who wish to take advantage of DeFi applications but don't have the risk-tolerance for a volatile asset like ETH. To solve this, an entire class of cryptocurrencies called stablecoins has emerged. Intended to maintain price parity with some target asset, USD, or gold, for instance, stablecoins provide the necessary consistency that investors seek to participate in many DeFi applications and allow a cryptocurrency native solution to exit positions in more volatile cryptoassets

By far the largest class of stablecoins are fiat collateralized. These are backed by an off-chain reserve of the target asset

The second largest class of stablecoins are crypto-collateralized, meaning they are backed by an overcollateralized amount of another cryptocurrency. Their value can be hard or soft pegged to the underlying asset depending on the mechanism

The last and perhaps most interesting class of stablecoins are non-collateralized. Not backed by any underlying asset and using algorithmic expansion and supply contraction to shift the price to the peg, they often employ a seigniorage model where the token holders in the platform receive the increase in supply when demand increases

DECENTRALIZED APPLICATIONS

As mentioned earlier, dApps are a critical DeFi ingredient. dApps are like traditional software applications except they live on a decentralized smart contract platform. The primary benefit of these applications is their permissionlessness and censorship resistance. Anyone can use them, and no single body controls them

DeFi PRIMITIVES

Now that the DeFi infrastructure has been discussed in detail, this chapter describes the primitive financial actions that developers can use and combine to create complex dApps and the advantages each action may have over its centralized counterparts.

TRANSACTIONS

Ethereum transactions are the atoms of DeFi (and Ethereum as a whole). Transactions involve sending data or ETH (or other tokens) from one address to another. All Ethereum interactions, including each of the primitives discussed in this section, begin with a transaction. Therefore, how transactions work is an integral part of understanding Ethereum in particular and DeFi in general

In Ethereum, there are two types of addresses: the externally owned account (EOA) and an address of a contract account. Transactions sent to an EOA can only transfer ETH.1 In Bitcoin, all addresses are EOA

Clauses in a smart contract can cause a transaction to fail and thereby revert all previous steps of the transaction; as a result, transactions are atomic. Atomicity is a critical feature of transactions because funds can move between many contracts (i.e., exchange hands) with the knowledge and security that if one of the conditions is not met, the contract terms reset as if the money never left the starting point

Remember that transactions have a gas fee, which varies based on the complexity of the transaction

The gas price is determined by the market and effectively creates an auction for inclusion in the next Ethereum block

A technical aside about transactions is that they are posted to a memory pool, or mempool, before they are added to a block

Any actor can see transactions in the mempool by running or communicating with mining nodes

FUNGIBLE TOKENS

Fungible tokens are a cornerstone of the value proposition of Ethereum and DeFi. Any Ethereum developer can create a token divisible to a certain decimal granularity and with units that are all identical and interchangeable. By way of example, USD is a fungible asset because one $100 bill is equivalent to a hundred $1 bills. As we mentioned in Chapter 3, the Ethereum blockchain token interface is ERC-20.2 An interface from an application developer's perspective is the minimum required set of functionalities

There are three main ERC-20 token main categories, but tokens can be in more than one at the same time.

Equity Token

An equity token – not to be confused with equities or stocks in the traditional finance sense – represents ownership of an underlying asset or pool of assets. The units must be fungible so that each corresponds to an identical share in the pool

Utility Tokens

Utility tokens are in many ways a catchall bucket, although they do have a clear definition: fungible tokens required to use some functionality of a smart contract system or with an intrinsic value proposition defined by their respective smart contract system

Governance Tokens

Governance and equity tokens both represent percentage ownership: equity refers to the share of assets and governance to voting rights. We start by motivating the types of changes on which owners can vote.

NON-FUNGIBLE TOKENS

As the name suggests, the units of an non-fungible token (NFT) are not equal to those of other tokens.

NFT Standard

On Ethereum, the ERC-7213 standard defines non-fungibility. It is like ERC-20, except that rather than all IDs being stored as a single balance, each unit has its own unique ID that can be linked to additional metadata, which differentiate it from other tokens stemming from the same contract

Multitoken Standard

ERC-20 and ERC-721 tokens require an individual contract and address deployed to the blockchain, which can be cumbersome for systems with many closely related tokens – possibly even a mix of fungible and non-fungible. The ERC-11554 standard resolves this complexity by defining a multi-token model in which the contract holds balances for a variable number, including fungible and non-fungible

CUSTODY

A critical DeFi primitive is the ability to escrow or custody funds directly in a smart contract. This is distinct from the situation in ERC-20 when operators are approved to transfer a user's balance. In that case, the user still retains custody of their funds and could transfer the balance anytime or revoke the contract's approval. When a smart contract has full custody over funds, it presents the possibility for new capabilities (and additional primitives), including:

  • Retaining fees and disbursing incentives

  • Facilitation of token swaps

  • Market making of a bonding curve

  • Collateralized loans

  • Auctions

  • Insurance funds

To effectively custody tokens, a contract must be programmed to handle the interface of the corresponding type, which would be ERC-20 for fungible and ERC-721 for non-fungible

SUPPLY ADJUSTMENT

Supply adjustment applies specifically to fungible tokens and the ability to create (mint) and reduce (burn) supply via a smart contract. We will now explore these basic primitives along with a more complex system known as a bonding curve

Burn: Reduce Supply

Burning a token means removing it from circulation and can be done in two ways: (1) manually send it to an unowned Ethereum address; or (2) even more efficiently, create a contract that is incapable of spending it

Mint: Increase Supply

The flip side of burning is minting, which increases the number of tokens in circulation. Contrary to burning, there is no mechanism for accidentally or manually minting tokens. Any mint mechanics have to be directly encoded into the smart contract mechanism. There are many use cases for minting as it can incentivize a wider range of user behavior

Bonding Curve: Pricing Supply

Adjusting supply up and down contractually defines a bonding curve: the price relationship between the token supply and a corresponding asset used to purchase the tokens

The mechanics of a bonding curve are relatively straightforward. The curve can be represented as a single smart contract with options for purchasing and selling the underlying token. The token to be sold can have either an uncapped supply with the bonding curve as an authorized minter or a predetermined maximum supply that is escrowed in the bonding curve contract

The growth rate of the bonding curve is important in determining users' performance. A linear growth rate would generously reward early users if the token grows to a sufficiently large supply

A bonding curve can have a different price curve for buyers and for sellers The selling curve could have a lower growth rate or intercept than the buying curve

INCENTIVES

Incentives within cryptoeconomic systems including DeFi are extremely important in encouraging desired (positive incentive) and discouraging undesired (negative incentive) user behaviors. The term incentive is quite broad, but we narrow our discussion to direct token payments or fees. We will look at two different categories of incentives: (1) staked incentives, which apply to a balance of tokens custodied in a smart contract; and (2) direct incentives, which apply to users within the system who do not have a custodied balance.

Staking Rewards

A staking reward is a positive incentive by which users receive a bonus in their token balance based on the amount of capital they have contributed to the system

Slashing (Staking Penalties)

Slashing is the removal of a portion of a user's staked balance, thereby creating a negative staked incentive, and occurs as the result of an undesirable event

Direct Rewards and Keepers

Direct rewards are positive incentives that include payments or fees associated with user actions. As we mentioned already, all Ethereum interactions begin with a transaction, and all transactions begin with an externally owned account. An EOA, whether controlled by a human user or an off-chain bot, is (importantly) off chain, and thus autonomous response to market conditions is either expensive (costs gas) or technically infeasible. As a result, no transaction happens automatically on Ethereum without being purposely set in motion.

A side effect of direct rewards for keepers is that gas prices can inflate due to the competition for these rewards. That is, more keeper activity generates additional demand for transactions, which in turn increases the price of gas

Fees

Fees are typically a funding mechanism for the features of the system or platform. They can be flat or percentage based, depending on the desired incentive. Fees can be imposed as a direct negative incentive or can be accrued on staked balances

SWAP

A swap is simply the exchange of one type of token for another

Order-Book Matching

Order-book matching is a system in which all parties must agree on the swap exchange rate

Automated Market Makers

An AMM is a smart contract that holds assets on both sides of a trading pair and continuously quotes a price for buying and for selling

No alt text provided for this image

COLLATERALIZED LOANS

Debt and lending are perhaps the most important financial mechanisms that exist in DeFi and, more generally, in traditional finance. On one hand, these mechanisms are a powerful tool for efficiently allocating capital, increasing return-bearing risk exposure, and expanding economic growth. On the other hand, excess debt in the system can cause instability, potentially leading to large economic and market contractions. These benefits and risks are amplified in DeFi because the counterparties share an adversarial and integrated environment. Platforms are increasingly interdependent, and a debt-fueled collapse in one part of the system can quickly contaminate all connected protocols – and expand outward

FLASH (UNCOLLATERALIZED) LOANS

A financial primitive that uniquely exists in DeFi and dramatically broadens certain types of financial access is a flash loan. In traditional finance, a loan is an instrument designed to efficiently allocate excess capital from a person or entity who wishes to employ it (lender) to a person or entity who needs capital to fund a project or to consume (borrower). A lender is compensated for providing the capital and bearing the risk of default by the interest amount charged over the life of the loan. The interest rate is typically higher the longer the duration of the loan because the longer time to repay exposes the lender to greater risk that the borrower may default

PROBLEMS DeFi SOLVES

INEFFICIENCY

The first of the five flaws of traditional finance is inefficiency. DeFi can handle financial transactions with high volumes of assets and low friction that would generally be a large organizational burden for traditional finance. It does this by creating dApps: reusable smart contracts designed to execute a specific financial operation and available to any user who seeks that type of service, for example, to execute a put option, regardless of the size of the transaction. A user can largely self-serve within the parameters of the smart contract and of the blockchain the application lives on

Keepers

Introduced in Chapter 4, keepers are external participants directly incentivized to provide a service to DeFi protocols, such as monitoring positions to safeguard that they are sufficiently collateralized or triggering state updates for various functions

Forking

Another concept that also incentivizes efficiency is a fork. In the context of open-source code, this occurs when the code is copied and reused with upgrades or enhancements layered on top. A common fork in blockchain protocols is formed when they are referenced in two parallel currencies and chains. Doing so creates competition at the protocol level and creates the best possible smart contract platform

LIMITED ACCESS

As smart contract platforms move to more scalable implementations, user friction falls, enabling a wide range of users and thus mitigating the second flaw of traditional finance: limited access. DeFi gives large, underserved groups like the global unbanked population and small businesses that employ substantial portions of the workforce (e.g., nearly 50 percent in the United States) direct access to financial services. The resulting impact on the entire global economy should be strongly positive

Yield Farming

Yield farming provides access to many who need financial services but whom traditional finance leaves behind. It provides users with inflationary or contract-funded rewards for staking capital or using a protocol, which are then payable in the same underlying asset the user holds or in a distinct asset such as a governance token

Initial DeFi Offering

An interesting consequence of yield farming is that a user can create an initial DeFi offering (IDO) by market making their own Uniswap (discussed in the next chapter) trading pair. They can set the initial exchange rate by becoming the first liquidity provider on the pair

OPACITY

The third drawback of traditional finance is opacity. DeFi elegantly solves this problem through the open and contractual nature of agreements

Smart Contracts

Smart contracts provide an immediate benefit in terms of transparency. All parties are aware of the capitalization of their counterparties and, to the extent required, can see how funds will be deployed

CENTRALIZED CONTROL

The fourth flaw of traditional finance is the strong control exerted by governments and large institutions that hold a virtual monopoly over elements such as the money supply, rate of inflation, and access to the best investment opportunities. DeFi upends this centralized control by relinquishing control to open protocols with transparent and immutable properties

Decentralized Autonomous Organization

In a decentralized autonomous organization (DAO), the rules of operation are encoded in smart contracts that determine who can execute what behavior or upgrade

LACK OF INTEROPERABILITY

The possibilities for DeFi are substantial, and new innovations continue to grow exponentially, fueled by how easy it is to compose DeFi products. Once a base infrastructure has been established – for example, to create a synthetic asset – any new protocols allowing for borrowing and lending can be applied. A higher layer would allow for attainment of leverage on top of borrowed assets. Such composability can continue in an increasing number of directions as new platforms arise

Tokenization

Tokenization is a critical way DeFi platforms integrate

DeFi has the potential to unlock liquidity in traditionally illiquid assets through tokenization

The token can be traded on a decentralized exchange to liquidate the position.

Compared with digital assets, tokenizing hard assets, such as real estate or precious metals, is more difficult because the practical considerations such as maintenance and storage cannot be enforced by code. Legal restrictions across jurisdictions are also a challenge for tokenization; nevertheless, the utility of secure, contractual tokenization for most use cases should not be underestimated

Networked Liquidity

In DeFi, as a subcomponent of the contract, any exchange application can leverage the liquidity and rates of any other exchange on the same blockchain. This capability allows for networked liquidity and leads to very competitive rates for users within the same application

DeFi DEEP DIVE

DeFi can be loosely broken into sectors based on the functionality type of the dApp. Many dApps could fit into multiple categories, so we attempt to place them into the most relevant category. We examine DeFi platforms in the taxonomy of lending/credit facilities, DEXes, derivatives, and tokenization.1 We mainly focus on the Ethereum network due to its popularity, but DeFi innovations are occurring on many blockchains including Stellar and EOS.2 Polkadot3 is another platform that employs a type of proof-of-stake consensus.

CREDIT/LENDING

MakerDAO

MakerDAO4 (DAO is a decentralized autonomous organization) is often considered an exemplar of DeFi. For a series of applications to build on each other, there must necessarily be a foundation. The primary value-add of MakerDAO is the creation of a cryptocollateralized stablecoin, pegged to USD. This means the system can run completely from within the Ethereum blockchain without relying on outside centralized institutions to back, vault, and audit the stablecoin. MakerDAO is a two-token model where a governance token MKR yields voting rights on the platform and participates in value capture. The second token is a stablecoin called DAI – a staple token in the DeFi ecosystem with which many protocols integrate

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Compound

Compound is a lending market that offers several different ERC-20 assets for borrowing and lending. All the tokens in a single market are pooled together so every lender earns the same variable rate, and every borrower pays the same variable rate

The collateralization ratio is calculated via a collateral factor. Each ERC-20 asset on the platform has its own collateral factor ranging from 0 to 90 percent

The collateralization ratio is similar to a reserve multiplier in traditional banking, constraining the amount of “borrowed” dollars that can be in the system relative to the “real” supply

The supply and borrow interest rates are compounded every block (approximately 15 seconds on Ethereum producing near continuous compounding) and are determined by the utilization percentage in the market

The Compound protocol must escrow tokens as a depositor to maintain that liquidity for the platform itself and to keep track of each person's ownership stake in each market

The many different parameters of Compound's functionality – such as the collateral factor, reserve factor, base rate, slope, and kink – can all be tuned. The entity capable of tuning these parameters is Compound Governance, which has the power to change parameters, add new markets, freeze the ability to initiate new deposits or borrows in a market, and even upgrade some of the contract code itself. Importantly, Compound Governance cannot steal funds or prevent users from withdrawing

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Aave

Aave11 (launched in 2017) is a lending market protocol similar to Compound and offers several enhanced features. Aave offers many additional tokens to supply and borrow beyond what Compound offers. At the time of writing, Compound offers nine distinct tokens (different ERC-20 Ethereum-based assets), and Aave offers these nine plus an additional 13 not offered on Compound. Importantly, the Aave lending and variable borrowing rates are more predictable because, unlike the volatile COMP token in Compound, no subsidy is involved.

The Aave protocol supports the ability to create entirely new markets. Each market consists of its own group of token pools with their corresponding supply and borrow interest rates. The benefit of creating a separate market is that the market's supported tokens act as collateral solely in that market and cannot affect other markets, thus mitigating any potential contagion

No alt text provided for this image

Aave offers several innovations beyond the lending products offered by Compound and other competitors. Aave's flash loans, although not unique among competitors, provide additional yield to investors, making them a compelling mechanism to provide liquidity. These utilities also attract to the platform arbitrageurs and other applications that require flash liquidity for their use cases. Stable borrow rates are a key innovation, and Aave is the only platform currently with this offering. This feature could be important for larger players who cannot operate under the potential volatility of variable borrow rates

No alt text provided for this image

DECENTRALIZED EXCHANGE

Uniswap

The primary example of an AMM on Ethereum is Uniswap.12 We will focus our discussion on Uniswap v2. Recently, the third iteration of Uniswap was released and the v3 will be discussed later. Uniswap v2 uses a constant product rule to determine the trading price, using the formula k = x*y, where x is the balance of asset A, and y the balance of asset B. The product k is the invariant and is required to remain fixed at a given level of liquidity. To purchase (withdraw) some x, some y must be sold (deposited). The implied price is x/y and is the risk-neutral price because the contract is equally willing to buy or sell at this rate as long as invariant k is constant.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

DERIVATIVES

Yield Protocol

Yield Protocol25 proposes a derivative model for secured, zero-coupon bonds. Essentially, the protocol defines a yToken to be an ERC-20 (fungible) token that settles in some fixed quantity of a target asset at a specified date. The contract will specify that the tokens – which have the same expiry, target asset, collateral asset, and collateralization ratio – are fungible

The mechanism for yToken settlement is still undecided, but one proposed solution is “cash” settlement, which means paying an equivalent amount of the collateral asset worth the specified amount of the target asset yTokens can settle in any Ethereum target asset and even settle synthetically into a floating-rate lending protocol to preserve returns.

Opacity: Risk and uncertainty of counterparty in traditional agreements.

Clear collateralization publicly known on Ethereum blockchain backing”

No alt text provided for this image
No alt text provided for this image

dYdX

dYdX26 specializes in derivatives and margin trading, which currently supports a variety of cryptocurrencies in addition to ETH and BTC. The company has a spot DEX that allows investors to exchange these assets against the current bid–ask on the order book and uses a hybrid on–off chain approach. Essentially, dYdX stores signed, or preapproved, orders without submitting to Ethereum; they use cryptography to guarantee they are used only to exchange funds for the desired asset at the desired price dYdX provides market makers and traders the open-source software and a user interface required to interact with the DEX

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Synthetix

Imagine creating a derivative cryptoasset, whose value is based on an underlying asset that is neither owned nor escrowed. Synthetix is one group whose primary focus is creating a wide variety of liquid synthetic derivatives. Its model is, at a high level, straightforward and novel. The company issues Synths, tokens whose prices are pegged to an underlying price feed and are backed by collateral. MakerDAO's DAI is also a synthetic asset

No alt text provided for this image
No alt text provided for this image

TOKENIZATION

Tokenization refers to the process of taking some asset or bundle of assets, either on or off chain, and

  • representing that asset on chain with possible fractional ownership; or

  • creating a composite token that holds some number of underlying tokens

A token can conform to different specifications based on the type of properties a user wants the token to have. As mentioned earlier, the most popular token standard is ERC-20, the fungible token standard. This interface defines abstractly how a token, which has units that are non-unique and interchangeable (such as USD), should behave. An alternative is the ERC-721 standard, which defines non-fungible tokens (NFTs). These tokens are unique, such as a token representing ownership of a piece of fine art or a specific digital asset from a game. DeFi applications can take advantage of these and other standards to support any token using the standard simply by coding for the single standard.

Set Protocol

Set Protocol34 offers the “composite token” approach to tokenization. Instead of tokenizing assets non-native to Ethereum, Set Protocol combines Ethereum tokens into composite tokens that function more like traditional exchange traded funds (ETFs). Set Protocol combines cryptoassets into Sets, which are ERC-20 tokens and fully collateralized by the components escrowed in a smart contract. A Set token is always redeemable for its components

Set Protocol also has a Social Trading feature in which a user can purchase a Set whose portfolio is restricted to certain assets with reallocations controlled by a single trader. Because these portfolios are actively managed, they function much more like active mutual funds or hedge funds

No alt text provided for this image

Wrapped Bitcoin

The wrapped bitcoin (wBTC)35 application takes the representing off-chain assets on chain approach to tokenization, specifically for BTC. Abstractly, wBTC allows BTC to be included as collateral or liquidity on all of the Ethereum-native DeFi platforms. Given that BTC has comparatively low volatility36 and is the most well-adopted cryptocurrency by market cap, this characteristic unlocks a large potential capital pool for DeFi dApps

RISKS

As we have emphasized in previous sections, DeFi allows developers to create new types of financial products and services, expanding the possibilities of financial technology. While DeFi can eliminate counterparty risk – cutting out intermediators and allowing financial assets to be exchanged in a trustless way – all innovative technologies introduce a new set of risks. To provide users and institutions with a robust and fault-tolerant system capable of handling new financial applications at scale, we must confront and properly mitigate these risks; otherwise, DeFi will remain an exploratory technology, restricting its use, adoption, and appeal.

The principal risks DeFi faces today are smart contract,governance, oracle, scaling, DEX custodial, environmental,and regulatory.

SMART CONTRACT RISK

As discussed previously, public blockchains are open systems. After the code is deployed, anyone can view and interact with it on a blockchain. Because it is often responsible for storing and transferring blockchain native financial assets, it introduces a new, unique risk. This new attack vector is termed smart contract risk.

Smart contract risk can take the form of a logic error in the code or an economic exploit in which an attacker can withdraw funds from the platform beyond the intended functionality. The former could be any typical software bug in the code

An economic exploit would be subtler. There would be no explicit failure in the logic of the code but rather an opportunity for an economically equipped adversary to influence market conditions to profit inappropriately at the contract's expense

Economic exploits become even trickier when considering that flash loans allow any Ethereum user to become financially equipped for a single transaction. Special care must be used when designing protocols such that they cannot be manipulated by massive market volatility within a single transaction

Smart contract programming still has a long way to go before best practices are developed and complex smart contracts have the resilience necessary to handle high-value transactions. As long as smart contract risk threatens the DeFi landscape, application adoption and trust will suffer as users hesitate to trust the contracts they interact with and that custody their funds

GOVERNANCE RISK

Programming risks are nothing new. In fact, they have been around since the dawn of modern computing more than half a century ago. They are the sole threat to some protocols like Uniswap because the application is autonomous and controlled by smart contracts

Protocol governance refers to the representative or liquid democratic mechanisms that enable changes in the protocol

ORACLE RISK

Oracles are one of the last unsolved problems in DeFi and are required by most DeFi protocols to function correctly. Fundamentally, oracles aim to answer the simple question: How can off-chain data be securely reported on chain? Without oracles, blockchains are completely self-encapsulated and have no knowledge of the outside world other than the transactions added to the native blockchain

Oracles represent significant risks to the systems they help support. If an oracle's cost of corruption is ever less than an attacker's potential profit from corruption, the oracle is extremely vulnerable to attack

Oracles, as they exist today, represent the highest risk to DeFi protocols that rely on them. All on-chain oracles are vulnerable to front-running, and millions of dollars have been lost due to arbitrageurs

SCALING RISK

As we have discussed, Ethereum and other proof-of-work (the consensus mechanism) blockchains have a fixed block size. For a block to become part of the chain, every Ethereum miner must execute all the included transactions on their machine. To expect each miner to process all the financial transactions for a global financial market is unrealistic

The current version of Ethereum is currently limited to a maximum of 30 transactions per second (TPS), yet almost all of DeFi today resides on this blockchain. Compared with Visa, which can handle upward of 65,000 TPS, Ethereum is capable of handling less than 0.1 percent of the throughput. Ethereum's lack of scalability places DeFi at risk of being unable to meet requisite demand. Much effort is focused on increasing Ethereum's scalability or replacing Ethereum with an alternative blockchain that can more readily handle higher transaction volumes

Vertical and horizontal scaling are two additional general approaches to increasing blockchain throughput,

DEX RISK

The most popular DeFi products today mirror those we observe in traditional finance. The main uses for DeFi are gaining leverage, trading, and acquiring exposure to synthetic assets. Trading, as might be expected, accounts for the highest on-chain activity, while the introduction of new assets (e.g., ERC-20 tokens, Synthetics) has led to a Cambrian explosion in DEXs. These decentralized exchanges vary considerably in design and architecture, but all are attempts to solve the same problem: how to create the best decentralized venue to exchange assets”

“Several decentralized exchanges use an entirely off-chain order book, retaining the benefits of a non-custodial DEX while circumventing the market making and scaling problems posed by on-chain order-book DEXs

CUSTODIAL RISK

There are three types of custody: self, partial, and third party. With self-custody, users develop their own solution, which might be a flash drive not connected to the Internet, a hard copy, or a vaulting device. Partial custody combines self-custody and external solution (e.g., Bitgo). Here, a hack on the external provider provides insufficient information to recreate the private key. However, if users lose their private key, the user combined with the external solution can recreate the key. The final option is third-party custody. Many companies that have traditionally focused on custody in centralized finance are now offering solutions in decentralized

ENVIRONMENTAL RISK

The proof of work consensus mechanisms used by both Bitcoin and Ethereum require a large amount of electricity for its computing power. This is both a strength and a weakness. The computing power provides unprecedented security for their networks. It is currently infeasible for an adversary to acquire enough hashing power to corrupt these blockchains. However, it is also a weakness given that most of the energy used is generated by fossil fuels

REGULATORY RISK

As the DeFi market increases in size and influence, it will face greater regulatory scrutiny. Major centralized spot and derivatives exchanges, previously ignored by the Commodity Futures Trading Commission (CFTC), have recently been forced to comply with KYC/AML compliance orders,24 and DEXs appear to be next. Already, several decentralized derivatives exchanges, such as dYdX, must geoblock U.S. customers from accessing certain exchange functionalities. Whereas the non-custodial and decentralized nature of DEXs presents a legal gray area with an uncertain regulatory future, little doubt exists that regulation will arrive once the market expands.

CONCLUSIONS: LOSERS AND WINNERS

Decentralized finance provides compelling advantages over traditional finance along the verticals of decentralization, access, efficiency, interoperability, and transparency. Decentralization allows financial products to be owned collectively by the community without top-down control – something that could be hazardous to the average user. Access to these new products for all individuals is of critical importance in preventing widening wealth gaps.

Traditional finance exhibits layers of fat and inefficiency that ultimately remove value from the average consumer. The contractual efficiency of DeFi brings all this value back. As a result of its shared infrastructure and interfaces, DeFi allows for radical interoperability beyond what could ever be achieved in the traditional-finance world. Finally, the public nature of DeFi fosters trust and security in strong contrast to the opacity of today’s centralized systems

DeFi can even directly distribute value to users to incentivize its growth, as demonstrated by Compound (via COMP) and Uniswap (via UNI). Yield farming is the practice of seeking rewards by depositing into platforms that incentivize liquidity provisioning. Token distributions and yield farming have attracted large amounts of capital to DeFi over very short time windows. Platforms can engineer their token economics to both reward their innovation and foster a long-term sustainable protocol and community that continues to provide value.

Each DeFi use case embodies some of these benefits more than others and has notable drawbacks and risks. For example, a DeFi platform, which heavily relies on an oracle that is more centralized, can never be as decentralized as a platform that needs no external input to operate, such as Uniswap. Additionally, a platform such as dYdX with some off-chain infrastructure in its exchange cannot have the same levels of transparency and interoperability as a platform without off-chain components

Certain risks like scaling and smart contract vulnerabilities plague all DeFi, and overcoming them is crucial to DeFi's achieving mainstream adoption. The benefits of DeFi will be limited to only the wealthiest parties if the underlying technology cannot scale to serve the population at large. Inevitably, the solutions to the scaling problem will come at the price of some of the benefits of a “pure” DeFi approach, such as decreased interoperability on a “sharded” blockchain. Similar to the Internet and other transformational technologies, the benefits and scale will improve over time. Smart contract risk will never be eliminated, but wisdom gained from experience will inform best practices and industry trends going forward.

As a caution to dApps that blindly integrate and stack on top of each other without proper due diligence, the weakest link in the chain will bring down the entire house. The severity of smart contract risk grows directly in proportion to the natural tendency to innovate and integrate with new technologies. For this reason, it is inevitable that high-profile vulnerabilities will continue to jeopardize user funds as they have in the past. If DeFi cannot surmount these risks, among others, its utility will remain a shadow of its potential.

The true potential of DeFi is transformational. Assuming DeFi realizes its potential, the companies that refuse to adapt may be lost and forgotten. All traditional financial firms can and should begin to integrate their services with crypto and DeFi as the regulatory environment gains clarity and the risks are better understood over time. This adoption can be viewed as a “DeFi front end,” which strips away the details to provide more simplicity for the end user.

Startups like Dharma1 are leading the new wave of consumer access to DeFi. This approach will still suffer from some layers of inefficiency, but the companies that best integrate the technology and support local regulation will emerge as victors while the others fade away. The DeFi protocols that establish strong liquidity moats and offer the best utility will thrive as the key backend to mainstream adoption.

We see the scaffolding of a shining new city. This is not a renovation of existing structures; it is a complete rebuild from the bottom up. Finance becomes accessible to all. Quality ideas are funded no matter who you are. A $10 transaction is treated identically to a $100 million transaction. Savings rates increase and borrowing costs decrease as the wasteful middle layers are excised. Ultimately, we see DeFi as the greatest opportunity of the coming decade and look forward to the reinvention of finance as we know it.

iBooks Store

YouTube with the author

Free Course in YouTube

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics