Decentralized Finance (DeFi) is a broad term for peer-to-peer financial services on public blockchains. DeFi protocols allow individuals to lend, borrow or trade cryptocurrencies without going through financial intermediaries. Traditional finance is centralized finance (CeFi). DeFi is expanding beyond payments to other types of financial services typically provided by a bank. The idea behind DeFi is to harness the power of blockchain across the entire financial system.
Bitcoin decentralized money. Now people are asking whether other financial services can be decentralized. Bitcoin is a form of peer-to-peer electronic cash (the title of the Bitcoin white paper). Can other forms of finance be done in this way? Peer-to-peer finance is a fascinating ideal to consider. Direct transactions with no-one in the middle. Total disintermediation.
DeFi is the current frontier of the blockchain revolution. DeFi rapidly accelerated in 2020 and some refer to summer 2020 as “DeFi Summer.”
DeFi is a form of decentralized application (dapp). Almost all DeFi protocols were originally built on Ethereum, but most DeFi applications like Aave are now multichain. You can think of DeFi as financial software built on the blockchain. Some have referred to this as building with “Money Legos.”
As a form of dapp, DeFi is built on smart contracts. Smart contracts are self-executing programs that automate a process, including financial services like lending and borrowing. . For more information on this, check out my page on smart contracts.
One of the benefits of DeFi is that the transactions are recorded on the blockchain, which provides transparency and security.
categories of defi
DefiLlama groups DeFi protocols into the following five categories: lending, decentralized exchanges (DEXes), derivatives, payments, and assets. DeFi Pulse ranks DeFi protocols based on Total Value Locked (TVL) into the smart contracts of the protocols. The largest category by TVL is lending and the second largest is DEXes. The three largest DeFi protocols in the lending category are Aave, Maker, and Compound. The three largest DeFi protocols in the decentralized exchange category are Curve Finance, Uniswap, and SushiSwap. The largest DeFi protocol in the assets category is yearn.finance.
Locking is sending cryptocurrency to the protocol.
Dai (a stablecoin) and MakerDAO (the DAO that manages Dai) are considered important early examples of decentralized finance to receive significant adoption.
With DeFi, it is very easy to move money from one place to another. Users can search for yield and optimize their investments. In some ways, it feels like a game. Some have argued that this lends itself to gamification in the DeFi space.
Decentralized Lending and Borrowing
Aave and Compound are DeFi protocols that allow users to borrow and lend cryptocurrency. Locking cryptocurrency in Aave or Compound is like putting money in a savings account, except that the account is on the Ethereum blockchain. Rather than depositing money in a bank, the depositor is sending cryptocurrency to an Aave or Compound account. Just like a savings account, the depositor immediately begins to accrue interest. Aave and Compound pool the deposits from thousands of people around the world.
Aave describes itself as a “non-custodial liquidity protocol.” Users are either providing liquidity (depositing) or using liquidity (borrowing). Non-custodial means that it is decentralized. Aave is also open-source, so anyone can view the code that runs the Aave protocol.
There are two transactions when depositing tokens. Both transactions can be viewed on the Etherscan Explorer.
- The “Approve” Function. You will receive a message like the following “Allow Https://app.aave.com to spend your USDC?” and “By granting this permission, you’re allowing Https://app.aave.com to withdraw your USDC and automate transactions for you.” There is a small transaction fee in ETH associated with this approval message. The receiving account (“To:” on Etherscan) for the approve function is shown as “To: Contract 0x… (USD Coin)” and the “Transaction Action:” is something like “Approved USDC For Trade On Aave: Lending Pool V2”
- The “Deposit” Function. This is the actual deposit of the tokens in Aave. This transaction will have a more significant transaction fee.
The receiving accounts for both transactions are smart contracts.
Compound describes itself as a “money market protocol.” Once cryptocurrency is locked in Compound, a user can borrow against this cryptocurrency. This is a form of overcollateralized loan. Therefore, there is no need to do a credit check. As in other asset classes, the collateral haircut depends on the quality of the asset. Users will be able to borrow more against higher quality cryptocurrencies. Just like at a bank, a borrower will pay interest on a loan.
When a user locks cryptocurrency in Compound, the user receives Compound tokens (cTokens) in exchange. These tokens represent the user’s cryptocurrency balance on Compound. For example, a user who deposits DAI to Compound will receive cDAI, which automatically earns interest in additional cDAI. At any time, cTokens can be redeemed at Compound in exchange for the equivalent amount of the original cryptocurrency.
The Compound protocol sets interest rates using a smart contract calculation based on supply and demand. When supply is high (i.e., liquidity), interest rates will be low. In other words, interest rates are a function of the available cryptocurrency in each market (e.g., the USDC market) and the demand for that token. As such, the interest rates fluctuate in real-time based on current supply and demand. Compound’s interest rates are quoted as annual interest rates and accrue each time an Ethereum block is mined, which is every 15 seconds. In other words, the amount of the depositor’s cTokens will increase every 15 seconds by the quoted annual interest rate at that time.
Decentralized Exchanges
Decentralized exchanges are a form of decentralized finance. Decentralized exchanges are platforms for trading cryptocurrencies that do not require an active role of a financial institution or market maker. The exchange is simply an algorithm for swapping one cryptocurrency for another. Two examples of decentralized exchanges are Uniswap and SushiSwap. Uniswap is a decentralized exchange that can be used to trade cryptocurrencies. It is a fully decentralized protocol for automated liquidity provision on Ethereum. This is one potential future for exchanges.
Another form of decentralized finance is the idea of a DeFi bank.
Decentralized finance uses Ethereum-based tokens. A number of the DeFi protocols have governance tokens associated with them: Compound (COMP), Aave (AAVE), Uniswap (UNI), and Yearn Finance (YFI).
Increased transaction volume through DeFi protocols correlates with higher prices of the associated DeFi tokens. This makes valuation of DeFi tokens more like the valuation of a traditional business model.
Lightning Network is a DeFi protocol in the payments category that is built on the Bitcoin blockchain. The “Bitcoin Lightning Network” white paper states “A decentralized system is proposed whereby transactions are sent over a network of micropayment channels (a.k.a. payment channels or transaction channels) whose transfer of value occurs off-blockchain.” Note that the use of off-chain transactions is the feature that allows for speed and scalability.
Resources
DefiLlama is a source for DeFi market information and news, including the latest analytics and rankings of DeFi protocols.
DEX.AG provides instant comparison of prices across decentralized exchanges. Note that prices are quoted in the stable coin USDC, not USD.
DeFi Pulse Data provides Ethereum and DeFi data and API services.