What is DeFi? The Ultimate DeFi 101 Guide to Ethereum, Layer 2s, Yield Farming, and More
This updated primer on DeFi explains Ethereum, layer 1s and Layer 2, top projects, and governance.
By: Mason Marcobello •DeFi 101
Throughout history, money is often moulded to benefit autocratic regimes. But in light of recurrent issues like debasement and rising inflation – alternatives such as decentralized finance, or DeFi, have emerged as an effort to re-establish sovereignty and power to the everyday person.
In short: DeFi is a global, open alternative to the current financial system. It differs through products and services built on open-source technology that anyone can use to borrow, save, invest, trade with and more.
One of the core components of DeFi is known as algocratic or algorithmic governance. In contrast to bureaucracies that rely on established social hierarchies to regulate and enforce law, autocratic governance is when rules and regulations are written into the software (code). In essence, its structure ensures that smart contracts function as intermediaries so that buyers, sellers, lenders, and borrowers may interact peer to peer without the need for centralized entities or institutions to mediate these very transactions.
Although decentralized finance is still in its nascent stages, the total value locked (TVL) in DeFi contracts is more than $200 billion as of November 2021. Ethereum commands more than 60% of the TVL , according to data from DeFi Llama. Although this data may appear significant, it is still notional as many DeFi tokens lack sufficient adoption, liquidity, and volume to trade in the web3 marketplace.
What Are the Components of DeFi?
Coupled with the more definitive aspects of DeFi such as it being non-custodial, open, transparent, and decentralized, here’s a list of some of the more technical layers that make up the standard DeFi stack, as proposed by Fabian Schär of the Federal Reserve Bank of St. Louis:
- Settlement Layer: Considered the most essential DeFi component, the settlement layer serves as a foundation for the following three components by integrating a public blockchain with a native currency. Similar to the dynamics of Ether (ETH) with Ethereum, the currency or token is often a complementary feature of most decentralized apps (dApps) to help users earn passive income or interest through activities like staking (elaborated on below). It can also be used for governance (voting rights), or exchanged in other centralized or decentralized marketplaces.
- Protocol Layer: Network protocols are rules designed to regulate actions like sending, receiving, and formatting data. An array of DeFi protocols help contain the rules or guidelines that users have to follow (as per industry standards) and provide a level of cohesion that allows different entities or developers to collaborate, scale, and improve services for the end-users. In a DeFi ecosystem, the protocol layer is essential for achieving sufficient and scalable liquidity.
- Application Layer: Considered as another vital component of DeFi whereby user-facing programs are stored, the application layer helps provide essential services via dApps (decentralized apps) that reflect the structures of the underlying protocols. The application layer is often home to the most well-known web3 apps, including loan services (Aave) and decentralized exchanges (DEXes such as Uniswap and PancakeSwap).
- Aggregation Layer: As the final layer, aggregators integrate a diverse combination of apps and resources from the prior layers to help further strengthen utility for end-users and streamline transactions between different financial instruments.
Image Source: Fabian Schär, “Decentralized Finance: On Blockchain- and Smart Contract-Based Financial Markets,” Federal Reserve Bank of St. Louis Review, Second Quarter 2021, pp. 153-74. https://doi.org/10.20955/r.103.153-74
The History of DeFi
The concept and very term “DeFi” was birthed in an August 2018 Telegram chat between Ethereum developers and entrepreneurs, including Inje Yeo of Set Protocol, Blake Henderson of 0x and Brendan Forster of Dharma.
However, before this, Bitcoin was (and still is) considered to be the first DeFi application. With the genesis block created on January 3, 2009, Bitcoin established itself as the first peer-to-peer digital money that solved prevalent issues like double-spending and centralization that prevented prior efforts like DigiCash by David Chaum or Wei Dai’s b-money from being successful.
Building on the aforementioned structures of algorithmic governance, Bitcoin’s rules, like scarcity and openness, are written into its very technology. Unlike traditional finance, where governments can print money that devalues savings and companies can shut down markets, Bitcoin lets its users own and control value and send it anywhere around the world at increasingly competitive speeds.
What is DeFi: Ethereum and DeFi
Although Bitcoin helped pave the foundations for an open and meritocratic financial system, the limitations of its programming language, Script, prevented a range of solutions that most central financial services and products are capable of offering to their clients such as lending, borrowing, and derivatives.
These limitations, however, helped provide an incentive for Ethereum, which launched in 2015. With a Turing-complete programming language known as Solidity and a flexible ERC-20 contract standard that allows for compatible tokens and applications, Ethereum provides developers with the freedom and flexibility to build on its protocol. In doing so, it functions as one of the first truly programmable versions of money.
Ethereum is often considered an organic and harmonious foundation for DeFi for several reasons:
- Non-custodial: no singular entity or person owns Ethereum or its tapestry of smart contracts. This aspect helps give everyone an equal opportunity to use DeFi services on its protocol. It also means no singular person or entity can change the rules – least of all without the consent of other core contributors or users on the Ethereum network.
- A singular language: As many DeFi products are built on the Ethereum network, all sharing a range of interoperability with the ERC20 token or similar token contracts, a seamless environment has been created to enable these products to work together. As an example, users can lend tokens on one platform and exchange the interest-bearing token in a different market on an entirely different application. This process is likened or similar to cashing loyalty points in at your bank. As tokens and cryptocurrency are built into Ethereum, a shared ledger – keeping track of transactions and ownership is a given feature.
- Autonomous and open: As Ethereum is open-source and based on a decentralized, autonomous system, it allows users to have complete financial freedom – most products will never take custody of your funds, leaving you (the end user) in control.
Ethereum Layer 1 vs Layer 2
At the risk of oversimplifying, Layer 1 is often considered as the base layer (or the main network) on which a distributed and decentralized platforms like Ethereum and Bitcoin function.
What will ETH 2.0 do?
Although the Ethereum Mainnet (layer 1) has helped provide strong security and decentralization, other aspects like scalability (specifically with transaction speed and fees) have lagged relative to alternative blockchains. A confluence of factors like periods of high network activity contribute to data congestion, making transaction fees increasingly expensive and slowing the performance of some dApps on Ethereum.
The above reasons (and more) give rise to Layer 2. As a general term for solutions designed to help scale applications by handling transactions off the mainnet while still retaining the advantages like the decentralized security model of Mainnet, Layer 2 is an added network that works above the mainnet. Ethereum 2.0 is an upgrade to the Ethereum blockchain that addresses the current bottlenecks like speed, efficiency, and scalability.
A detailed explainer about Layer 2 and Ethereum 2.0 can be found on the Ethereum website:
Building on the work of Satoshi and Ethereum’s collective legacy of autonomous and programmable money, there was another formidable dent in the DeFi sector with MakerDAO.
Conceptualized in 2014 and later launched in 2017, MakerDAO is considered one of the oldest DeFi projects on Ethereum. It functions as a protocol that allows users to issue a decentralized Stablecoin – DAI – pegged at 1-to-1 to the value of the U.S. dollar by using digital assets as collateral. By giving its users the ability to borrow the Dai Stablecoins against Ethereum’s native cryptocurrency (Ether), MakerDAO created a method for anyone to take out a loan without relying on centralized entities. It also made a dollar-pegged digital asset, which didn’t rely on holding dollars in a bank, like USDC, USDT and other stablecoins.
Through its lending protocol and Dai Stablecoin, MakerDAO helped create the first building block for a new, open, permissionless financial system. From there, other financial protocols were launched, creating an increasingly vibrant and interconnected ecosystem. Compound Finance, released in September 2018, created a market for borrowers taking out collateralized loans and lenders to rake in interest rates paid by those borrowers. Uniswap, launched in November 2018, allowed users to seamlessly swap any token on Ethereum.
To gain an even deeper insight into the history of DeFi, we have included a timeline infographic from MakerDAO that readers can view on their blog here
Why is DeFi Important?
Outlined below are several key points to further demonstrate the necessity of DeFi relative to the problems in traditional systems:
- Not everyone is granted access to bank accounts or deemed eligible to use financial products and services in their respective nations.
- Lacking access to these services can prevent people from job opportunities.
- A bank or intermediary like PayPal can prevent its users from receiving or sending funds.
- Most financial institutions leverage and exploit the data of their clients.
- Governments can close or impose heavy restrictions on markets at their behest.
- Trading hours are often limited and out of sync with global time zones.
- Some international transfers can take several days to complete due to manual human input.
- Most financial services often require a premium due to the intermediary institutions needing their commission and fees.
- Allows for complete autonomy and independence — users control where and how to spend their money.
- Fund transfers happen almost instantaneously — at the most within several minutes, pending on the nature of the network.
- Transactions can be pseudonymous or anonymous.
- The network and infrastructure are open to anyone.
- Markets don’t close.
- Created on a system of transparency where anyone with enough technical knowledge can audit or inspect a product’s data and how the system works.
Although the landscape of decentralized finance is growing on an exponential basis, we’ve elaborated on several of the more well known, credible platforms below:
What is DeFi? Top DeFi Projects
Founded on November 2, 2018, Uniswap is a decentralized finance protocol and exchange (DEX) created by Hayden Adams, a mechanical engineer from New York. The protocol facilitates automated transactions between cryptocurrency tokens on the Ethereum blockchain through the use of smart contracts. At this writing, Uniswap enables approximately $2 billion or more in daily crypto trading. Its governance tokens, UNI, have a market value of about $13 billion, according to CoinMarketCap.
Like Uniswap, Curve is a decentralised exchange with a key difference being the type of assets traded. On Uniswap, users can trade any ERC-20 token that has enough liquidity. Curve, however, is specifically focused on trading Ethereum compatible Stablecoins.
Some of the core advantages of Curve that have helped it gain critical acclaim as a popular automated market maker platform (AMM) include low slippage and fees. Curve allows users to provide liquidity via stablecoins to the Curve pool, from which they can earn income from transaction fees. Curve also helps to give a stronger sense of cohesion in the broader DeFi ecosystem by supplying pool tokens to the Compound protocol and Yearn.
Founded by law student Stani Kulechov in 2017 (originally called ETHLend), Aave is a platform that lets users lend and borrow crypto tokens; users have injected roughly $14 billion worth of collateral for loans on the network, according to Defi Pulse.
Conceptualized in 2014 and later launched in 2017, MakerDAO is a lending and borrowing platform that uses Dai, a stablecoin linked to the US dollar. MakerDao has since become one of the largest decentralized applications on the Ethereum blockchain and the first DeFi application to gain widespread adoption. Over 400 apps and services have integrated the Stablecoins Dai, including wallets, DeFi platforms, games and more. It is currently one of the most extensive DeFi protocols with $9.5 billion of system collateral, according to DeFi Pulse.
How to use DeFi:
As mentioned above, in the world of DeFi, smart contracts replace the role of brokerages or financial institutions that mediate between two or more parties. A smart contract is a type of Ethereum account, or program, that is designed to automatically execute, control, or document actions like holding, sending or refunding funds based on the conditions of the code and context in which it is written. As soon as a smart contract is launched or live on the network, no singular person or entity can alter its conditions – and it is often public for anyone to inspect and audit.
In the context of DeFi, a contract can be designed to send a stipulated amount of money from Account A to Account B at periodic intervals. It will also only ever do this so long as Account A has enough funds. As an example of its stronger security, the contract cannot be changed or altered to have alternative accounts, i.e. Account C added as a recipient to steal the funds. As the system is still far from perfect, more technically proficient members of the Ethereum community and various DeFi centric protocols (who can read and understand Solidity) are still needed to help keep developers in check until easier ways are developed to implement and audit smart contracts.
What is DeFi Staking?
Commonly used as a way to generate passive income, DeFi staking refers to locking tokens or digital assets (like NFTs) through a smart contract for a set period of time. In doing so, the end-user can become a validator (someone who is responsible for verifying transactions) in their chosen DeFi protocol. The more validators a network has, the more it helps improve the security and functionality of the platform. As with traditional banking, each DeFi platform and network varies in the amount of interest it can provide relative to the duration and total amount of assets locked-up. To provide an example, a popular DeFi platform called Fantom has created a calculator that estimates the returns for potential stakers here: https://fantom.foundation/ftm-staking/
What is DeFi? Proof of Stake 101
Aligned with the process of staking crypto assets is a consensus mechanism called Proof-of-Stake. Created as an alternative to Bitcoin’s energy and resource-intensive Proof-of-Work that requires large amounts of computational power, the Proof-of-Stake (PoS) concept operates based on selecting validators in proportion to their quantity of holdings in the associated cryptocurrency. As a core feature in the overarching Ethereum upgrade, the PoS system has been designed to increase speed and efficiency while also reducing the cost of fees on the network.
To briefly summarise some of the underlying components of Proof-of-Stake:
- Staking is similar to mining, whereby a network participant is selected to add the most recent batch of transactions to the blockchain and earn rewards (commonly more of the same tokens or cryptocurrency) for doing so.
- While the process varies according to each project, stakers lock-up their assets for a chance to add a new block of data to the blockchain and receive a reward. Staked tokens help to guarantee the legitimacy of any new transaction added to the network.
- The network chooses validators based on the size of their staked assets and the lock-up period. As an example, Ethereum users will need to stake 32 ETH to become a validator. This system (in theory) helps create a deeper level of commitment to the network as the most invested participants are rewarded. If transactions in a new block are found to be invalid, users can be penalised by having a certain amount of staked assets burned (destroyed).
What are the advantages of staking?
While viewed as a way to help contribute to a blockchain’s security and efficiency, many long-term investors view staking as a way to make their assets generate additional income rather than passively storing it in their wallets. Through staking, users can help make the chosen blockchain more resistant to attacks and create a more robust ecosystem to process transactions. Alongside providing additional tokens as a reward, some projects also distribute “governance tokens” to participants that have staked their assets. This gives stakers in the community a say in deciding the upgrades or future changes to the network.
What are some staking risks?
As staking often requires a specific lock-up or “vesting” period, users can’t withdraw or transfer their assets even if market conditions (which are inherently volatile) change.
What is DeFi? Yield Farming
Yield farming, also known as yield or liquidity harvesting, involves lending or staking cryptocurrency in exchange for interest, fees, and other rewards. Yield farmers measure their returns in terms of annual percentage yields (APY).
Yield Farming is when a user can lend or stake their assets in exchange for interest or other rewards. Yield farmers typically measure their returns through annual percentage yields (APY).
What are the risks of yield farming?
Some risks of yield farming include:
- Impermanent Loss: if a user provides liquidity to a liquidity pool and the price of their deposited assets changes compared to when it was first deposited. The larger the change, the bigger the loss.
- Vulnerabilities or bugs in the Smart Contracts which can be a target for hackers or scammers to exploit.
- Liquidation risk: if the collateral drops below the price of the loan then it is liquidated which means the user bears a loss. For example, on a platform like Aave, a user can deposit Ethereum (ETH) as collateral to take out a loan for another asset, like Bitcoin (BTC). If, however, there is a significant increase in the price of Bitcoin during this time, it will create a liquidation risk as the value of the ETH token provided as collateral will now be less than the value of the borrowed Bitcoin. The same could happen if the price of Ethereum drops while the price of Bitcoin stays the same. To help mitigate against market volatility, it’s generally recommended to use Stablecoins like USDC as both collateral and for the loan.
DeFi 2021 and Beyond
As the technology and ecosystem continues to mature, so too is there an increasing amount of decentralized solutions for most financial services.
Following on from this introduction we will continue to explore a range of applications, explainers, and how-to guides inclusive but not limited to:
- Lending and staking assets to earn interest and rewards
- Borrowing funds with collateral
- DeFi Wallets
- Borrowing without collateral
- Fundraising and loans
- Buying insurance
- Portfolio Management