A beginner's guide to DeFi
An introduction to decentralized finance. Covers stablecoins, composability, decentralized lending, dexes, and identity.
• 11 min read
Decentralized finance, also referred to as “DeFi” or open finance, aims to recreate traditional financial systems (such as lending, borrowing, derivatives, and exchange) with automation in place of middlemen. Once fully automated, the financial building blocks of DeFi can be composed to produce more complex capabilities. Today, the primary venue for decentralized finance is Ethereum, but in principle these ideas can be implemented on any smart contract platform.
In this beginner’s guide to decentralized finance (“DeFi”) we review the following:
Let’s go through these concepts one by one.
If we try recreating traditional financial products on a blockchain, we are faced with an immediate problem: price volatility. Specifically, the native cryptocurrency of the Ethereum blockchain (namely ETH) experiences large intraday swings in the USD/ETH exchange rate, sometimes moving 10% or more in a single day.
An instrument with this degree of price volatility is less than ideal for a number of traditional financial products. For example, if you take out a loan, you don’t want loan payments to oscillate by 10% right before a payment. That degree of volatility would make it hard to plan for the future.
Stablecoins are one solution to this problem. These are cryptocurrencies specially engineered to remain “stable” at an exchange rate of approximately 1.00 units of fiat per coin. The Stablecoin Index and Stablecoin Stats provide a good list of the top stablecoins.
There are three general categories of stablecoins: centralized fiat-collateralized, decentralized crypto-collateralized, and decentralized algorithmic.
In general, the first two types of stablecoins have proven most popular. Whether it is fiat or crypto providing the collateral, people appear to want certainty around price stability. With that said, there are ongoing experiments around the third class of stablecoin, with people looking to combine both the crypto-collateralization and algorithmic elements.
Given functional stablecoins like USDC and DAI, we can start rebuilding pieces of the traditional financial system as automated smart contracts. One of the most fundamental is the concept of borrowing and lending.
There are a number of DeFi platforms which enable borrowing and lending of Ethereum tokens directly through smart contracts, like Compound, dYdX, and Dharma. An impressive feature of these smart contracts is that a borrower need not find a lender or vice versa. Instead, the smart contract replaces the role of the middleman, and interest rates are calculated algorithmically according to supply and demand.
Before we explain how this works, it’s worth reviewing how some centralized crypto exchanges implement borrowing and lending. Here’s a visual of the Bitfinex funding book:
To understand what is being shown in this snapshot, start with the left hand side. The first row represents a borrower in the market who is willing to take out a 30-day loan for $4,421.58 at a 0.0265% daily rate. Right below them is another borrower willing to take out a 30-day loan for $34,292.38 at a slightly lower 0.0263% interest rate.
On the right hand side are the lenders. The first row represents a lender willing to lend out up to $8,199.32 for 2 days at a 0.027418% daily rate. The next row is someone willing to lend $255.68 for two days at the slightly higher rate of 0.027436% per day.
And so on and so forth. This is how a centralized order book for loans works. In the above example, the highest rate a borrower is willing to accept is 0.0265% daily interest, while the lowest rate a lender is willing to give is 0.027418% daily interest. One of these two parties will give in and either raise or lower their price of money, and then a deal will be made. Bitfinex provides the service to set up the order book and match users, and then takes a cut off the top of each loan for their trouble.
Some decentralized services for lending and borrowing take this to the next level. Rather than building an order book and facilitating matches, they allow users to directly lend or borrow from the smart contract itself, which dynamically raises or lowers interest rates to match. For example, if a large amount of crypto is borrowed from the smart contract, a higher interest rate is charged to borrowers. Moreover, in order to borrow funds, a user needs to provide collateral to the smart contract, providing an amount greater than what was borrowed so the loan is overcollateralized.
But why is decentralized lending even useful? The answer is that it’s a massively scalable application. A crypto service which makes more interest than traditional bank accounts with lower risk could in theory attract billions in deposits. Compound is already at $120M in deposits, and other services are growing fast. The main risks are related to smart contract bugs and crypto volatility, but the interest rates are also substantially higher than typical bank rates of 2% or lower. Here’s a snapshot of interest rates that can be earned for lending out stablecoins on different platforms, from LoanScan:
Decentralized crypto exchanges attempt to put services like Coinbase Pro on the blockchain. That is, they aim to facilitate trades of different cryptocurrencies between two parties.
To understand the use case, start with centralized cryptocurrency exchanges. These exchanges, like Coinbase Pro, act as an intermediary and custodian where two parties deposit their assets and are able to trade with each other. While they have worked at scale to facilitate billions of dollars in trades, centralized exchanges do present a single point of failure that can be hacked, censor transactions, or prevent certain people from trading.
Decentralized exchanges aim to address this by using smart contracts to reduce or eliminate middleman.The dream is fully peer-to-peer exchange of all digital assets.
There are a number of projects pursuing decentralized exchange of Ethereum-based tokens in various forms, like Uniswap, 0x, and Kyber. For example, Uniswap utilizes a so-called automated market maker (AMM) to algorithmically provide liquidity. Buyers and sellers pull liquidity from the smart contract directly and receive a price quote based on the token quantity desired and the liquidity available. Uniswap will always quote a price regardless of the order size by asymptotically increasing the price as the size of the order increases.
Decentralized exchanges can currently handle only a fraction of the volume of centralized exchanges, and as such can’t really convert large amounts of money back and forth. Moreover, many of these projects are limited to trading Ethereum-based tokens on the Ethereum blockchain, which limits their access to large cap coins with their own chains. Still, there are promising technologies like atomic swaps and zk-STARKs that may address these limitations.
One issue with the decentralized lending and borrowing services mentioned thus far is that they require quite a lot of collateral. This overcollateralization requirement can be a highly inefficient use of capital -- and many people do not have the extra funds in the first place to provide as collateral.
However, people are working on decentralized identity and reputation systems that will reduce the collateralization requirements. One of the first applications would be building blockchain analogs of fiat-based credit bureaus like Experian, TransUnion, and Equifax that institutions like banks rely on for credit scores.
Now, to anticipate an objection, it’s certainly true that credit bureaus can put certain groups such as international and young people at a disadvantage. But newer services like Lending Club have addressed the problem of overreliance on FICO scores by offering additional data points like home ownership, income, and length of employment.
Decentralized identity and reputation services could offer something similar by including attributes such as social media reputation, history of repayment of previous loans, vouching from other reputable users, and the like. Making this useful for actual financial decisions will require a lot of trial and error on the specific data points to use and the corresponding collateral requirements, and we are just at the beginning of that process.
Interestingly, in the long run, DeFi with decentralized identity systems could become another option for people locked out of traditional financial systems. For example, there are one billion people without an official ID, and ~50% of women in low income countries lack an ID. However, many of these people do have smartphones. So it’s possible that once decentralized IDs work in the developed world, that they could be rapidly exported to the developing world as a leapfrog technology -- much like smartphones themselves.
We’ve covered decentralized stablecoins, loans, exchanges, and identity. But perhaps the most important aspect of building decentralized finance building blocks on a smart contract platform like Ethereum is the composability. Just like a software library, smart contracts for different financial applications can plug into each other like lego pieces.
For example, if you want to add the ability to trade tokenized assets on your platform, you can easily make the assets tradable by integrating a decentralized exchange protocol. And these smart contract lego pieces can even create completely new concepts that haven’t been explored in the traditional world.
One example is the project called 2100 that brings together DeFi and social media by allowing participants to use their Twitter accounts to “mint” new tokens for themselves, essentially generating digital dollars from their social capital. Popular accounts can put out premium content that is only accessible to a specific group of token holders, which allows them to monetize their following. One can then do interesting things like bet on certain Twitter accounts becoming more popular.
Another example is the project called PoolTogether, which combines DeFi and lotteries to create a “no-loss” lottery. Users purchase lottery tickets on-chain, and all funds from ticket purchases earn interest on Compound. At the end of the lottery, everyone gets their funds back -- but one person gets all of the interest earned on the pooled money. It’s essentially a way to use lottery mechanics to incentive savings and wealth creation!
As DeFi matures, we should expect the libraries to start getting used outside the crypto community. Eventually you’ll be able to add one line of code to add a full decentralized marketplace to a video game, or another line of code to allow merchants in your e-commerce store to earn interest on their balance.
While DeFi is fascinating, it is important to acknowledge the risks that come with it. Let’s enumerate some classes of risk:
Decentralized insurance like Nexus Mutual and Convexity are an area within DeFi that provides the ability to hedge some of these risks. Prediction markets like Augur also address the hedging use case by allowing users to bet on the probability that there will be a smart contract issue with one of the protocols they are using.
With that said, these hedging methods themselves are in their infancy, and add smart contract risk of their own. We do think they will mature, however. And if the DeFi space gets large enough, then traditional insurance companies might offer products too.
The DeFi space is large and growing larger. Hundreds of millions of dollars worth of cryptocurrency has already been deployed and the space’s future potential is massive. This article only covered a handful of use cases, but we’ve provided some further reading below to understand DeFi further and keep up with the developments.
Keeping up with DeFi
Thank you to Balaji Srinivasan, Will Warren, and Jordan Clifford for reviewing this post!
Disclaimer: Linda Xie is a Managing Director of Scalar Capital Management, LLC, an investment manager focused on cryptoassets. This post is not investment advice.
Subscribe to the newsletter and unlock access to member-only content.