• decrypting defi
  • blockchain&beyond
  • articles
  • 02 Sep 24

What Is Decentralized Finance (DeFi) and How Does It Work?

DeFi empowers individuals, disintermediates financial transactions, and makes services cost-efficient, secure, and accessible. But what is DeFi, and why do we need it?

  • 4070
  • 2
  • 3
pallavi.suri0310opdj
  • rating +6
  • subscribers 1

Introduction

The Bitcoin network was the first decentralized finance project the world encountered in 2009. However, Ethereum’s launch in 2015, along with the birth of smart contracts, laid the foundation of what we know today as the DeFi ecosystem.

Today, the DeFi ecosystem has a TVL of $90 billion and is no longer restricted to Ethereum alone. Multiple blockchain ecosystems, such as Solana, Tron, Polkadot, Avalanche, Cardano, and even Bitcoin, offer users innovative financial services, including lending and borrowing, staking, and yield farming.

Become a part of the community

Subscribe to our newsletter to be in-loop with all news from the crypto world

__________________

Fun Fact: Bitcoin, which was initially unprogrammable, given the limitations of its coding language Script, has recently started finding its footing in DeFi.

Runes and Ordinals are Bitcoin’s own non-fungible (Ordinals) and fungible (Runes) token standards, which Bitcoiners are using to find new use cases for Bitcoin and reciprocally leverage the security and resilience of the Bitcoin network in DeFi.

__________________

DeFi, or decentralized finance (pronounced as Dee-fy), is an emerging alternative to centralized finance that is growing in popularity and adoption.

It is peer-to-peer, open, and inclusive, meaning no third party is required to act as a link or overlook the transactions between parties. The transactions are executed in a code-driven, trustless environment over a blockchain.

DeFi empowers individuals, disintermediates financial transactions, and makes services cost-efficient, secure, and accessible. But what is DeFi, and Why do we need it? How does it present a better alternative to banks and financial institutions? Let’s discuss.

What is Decentralized Finance (DeFi)?

Decentralized Finance, or DeFi, is an umbrella term for all decentralized applications or dApps that lie at the intersection of blockchain technology, digital assets, and financial services. DeFi applications operate without the need for an intermediary or central authority in a peer-to-peer, permissionless, and open-source fashion.

________________________

Fun Fact: Do you know the history behind the name DeFi? The name DeFi was born in a Telegram chat between Ethereum developers in August 2018. The conversation happened between Inje Yeo of Set Protocol, Blake Henderson of 0x, and Brendan Forster of Dharma.

Names like Decentralized Finance Developers (DFD), DeFi, Open Horizon, and Lattice Network were in the race. But DeFi was the favorite. It was a perfect choice because, in Blake Henderson's words, it comes out as ‘DEFY.’ Cool!

_______________________

Since 2015, Ethereum has been the alma mater of all things DeFi and controls over 70% of the DeFi ecosystem’s TVL in 2024. While Bitcoin is the true decentralized money, Ethereum became the first programmable money, given its Turing-complete programming language, Solidity, and smart contracts.

For years, developers could build compatible DeFi applications and tokens on Ethereum. Soon, DeFi trickled into other ecosystems. Today, DeFi services expand across payments, lending, borrowing, insurance, investments, and asset management.

Decentralized Finance (DeFi) employs the interconnected and peer-to-peer nature of financial transactions on blockchain networks.
Decentralized Finance (DeFi) employs the interconnected and peer-to-peer nature of financial transactions on blockchain networks.

Key Characteristics of DeFi

Let’s jot down a few essential characteristics easily identifiable with DeFi applications:

Decentralized Nature

DeFi is based on blockchain technology, which is essentially a distributed database over a network of computers (called nodes) worldwide. Like cryptocurrencies, transactions on a blockchain are executed via node consensus and majority.

The validated transaction becomes a part of a block, which, in turn, gets added to the blockchain. There’s no central authority, such as a banking or financial institution, overlooking or controlling the transactions.

Peer-to-Peer Transactions

Transactions in a DeFi protocol, such as Aave, Lido, or UniSwap, happen peer-to-peer. No intermediary is involved in the transaction. When code-driven transactions take the place of those facilitated by banks and financial institutions, the smart contract code acts as the intermediary and facilitates transactions directly between users.

Permissionless and Trustless

This process of consensus, validation, and storage in a blockchain happens without any trusted party or intermediary. This creates a trustless environment where users are not required to build trust among themselves. The blockchain code acts as the trusted party for both.

Algorithmic Governance

When computer codes control the governance of an organization rather than an entity or individual, it is called algorithmic governance. Traditional finance institutions rely on autocratic governance, where only a single entity controls the decision-making. In the case of DeFi, the rules are written in software, and token holders enjoy voting rights.

Self-Custody

Users interact with DeFi applications via self-custodial wallets. Self-custody implies that the user retains the ownership of the funds, and no other entity can control it. Since DeFi applications are smart contract-driven, there’s no bias or singular entity rule. Everyone can equally participate in the protocol and benefit from it.

Comparison with Traditional Finance

Traditionally, banking and financial services and access to capital happen via banks.

If you want to send money to someone, you need to direct it through a bank or other financial institution. The bank facilitates the transaction between you and the receiving party and sends money on your behalf to the user.

In DeFi, this transaction happens directly between parties in a peer-to-peer fashion without the involvement of a third party. Code governance ensures all the conditions are met before the transaction is executed to ensure transparency and fairness.

Traditional finance is slow, expensive, and limited in offerings. DeFi is innovative, efficient, and economical, as it automates processes and saves on operational costs.

In traditional finance, users remain secondary to the central authority, such as a bank or financial application. The authority to approve transactions lies with the central entity. DeFi returns control and empowers individuals. There’s no central figure making decisions. Once validated, transactions get approved over a blockchain.

Banks and financial institutions also charge customers various fees for using their services. DeFi removes the need for intermediaries and makes financial services more affordable and inclusive.

DeFi is often called the bank of the unbanked. Almost half of the world's population still doesn't have or use a bank account, and the majority of this share resides in third-world countries.

According to the Chainlysis report, developing countries such as Nigeria, Brazil, Vietnam, etc., see the largest number of P2P transactions each year. Anyone with a mobile phone with an internet connection can join the DeFi ecosystem.

DeFi gives back sovereignty of money and power to the users, which was previously a territory of the banks and institutions to the user. DeFi doesn’t require any banks or institutions to intervene between the transactions as they happen in a peer-to-peer fashion.

The DeFi Tech Stack

The standard DeFi tech stack is made up of different layers:

Settlement Layer: It is the most important layer, serving as the foundation for other layers in the DeFi tech stack. It integrates the protocol's blockchain with the native currency.

Protocol Layer: These layers are the protocol rules laid down to regulate DeFi activities such as lending, borrowing, trading, and others. The layer helps developers and other stakeholders collaborate and build services for end users.

Application Layer: This layer stores the user-facing programs such as Aave (lending and borrowing protocol) and DEXs (UniSwap).

Aggregation Layer: This layer is necessary to bring together distinct apps from previous layers and help users streamline and derive maximum utility from the protocols.

The DeFi Tech Stack | Source: Decentralized Finance: On Blockchain- and Smart Contract-Based Financial Markets By Fabian Schä
The DeFi Tech Stack | Source: Decentralized Finance: On Blockchain- and Smart Contract-Based Financial Markets By Fabian Schä

Key Components of DeFi

Decentralized Exchanges (DEXs)

A decentralized exchange (DEX) operates as a peer-to-peer marketplace where transactions happen without the involvement of a bank, broker, or exchange itself (in the case of a centralized crypto exchange or CEX).

Traders can buy and sell cryptocurrencies directly to each other. There are no order books involved, as a DEX is essentially a set of smart contracts.

UniSwap is the largest and most popular DEX which uses automated market makers to match trades and liquidity pools to provide instant liquidity for efficient price discovery and trades. UniSwap is one of the many DEXs on the Ethereum blockchain. Some other popular DEXs include SushiSwap, PancakeSwap, Balancer, and 1Inch, among others.

DEXs are more convenient than CEXs since traders have access to a larger number of cryptocurrencies and can transact at relatively lower trading fees. Also, the traders need to connect their wallets to begin trading on a DEX. In the case of a CEX, your funds aren’t in self-custody and lie with the CEX. Binance is the largest CEX in terms of volume.

DEXs only allow crypto-to-crypto transactions and, unlike CEXs, do not allow advanced trading services like margin trading and leverage. However, traders can contribute to the liquidity pool and earn passive income on their funds.

Smart Contracts

Smart contracts are the building blocks of the DeFi services and ecosystem. They are simply lines of code on a blockchain that execute an agreement every time a specific set of conditions are met. Whenever a smart contract executes an agreement, a transaction is completed, which then gets recorded on a blockchain immutably.

Understand it like this: A gives B an apple whenever B gives him two bananas in return. If B gives one banana, the smart contract won’t execute the agreement. If B gives three, the smart contract remains dormant. Only when B gives two bananas does the smart contract activate, and A has to give one apple to B in return. This is a very simplified example of how a smart contract works. In reality, smart contracts are very sophisticated and complex.

Smart contracts are crucial for DeFi as they automate transactions on a DeFi platform and remove the need for any intermediary. Therefore, smart contracts reduce costs, build efficiency, enhance security and trust, promote financial inclusion, and give users control over their assets.

Smart contracts are capable of performing any computation given enough resources. They execute automatically whenever predefined conditions are met. Once deployed, smart contracts cannot be altered. These characteristics ensure the integrity and transparency of the DeFi platforms and protocols.

DeFi Protocols

DeFi protocols are smart contract-driven, open-source, autonomous programs built to provide financial services to end users without the need for intermediaries. The DeFi protocols are a set of rules and codes that govern DeFi applications.

Users can transact directly with each other and lend, borrow, trade, and do yield farming, unlike traditional applications that route transactions through a bank or financial institutions.

For instance, you want to borrow money. You go to a fintech app and raise a request. The app, in turn, contacts your bank for financial information and checks if your CIBIL score is eligible for a loan. Once it gets clarity, it transfers the money to your bank account, from where you can withdraw the loan amount. This entire process can take weeks or even months.

DeFi protocols like Aave, on the other hand, are essentially smart contracts on a blockchain. As soon as you make a request for a loan, the protocol checks if your collateral is enough and grants you the loan. In the backend, a user contributing to the crowdfund receives a fraction of the interest you pay. This procedure is automated over a blockchain and happens in a matter of minutes.

DeFi protocols eliminate inefficiencies and red tapism and automate transactions. The information on these protocols is tamper-proof and stored immutably on blockchains.

Major DeFi Applications and Services

We can recognize five kinds of typical DeFi service protocols active in the Web3 space:

  • Stablecoins such as Tether (USDT), Circle (USDC), Ethena (USDe), etc.
  • Decentralized Exchanges (DEXs) such as UniSwap (UNI), dYdX, Balancer (BAL), 1inch (1INCH), etc.
  • Lending and Borrowing protocols such as Aave (AAVE), MakerDAO (MKR), etc.
  • Yield Farming protocols such as UniSwap (UNI), PancakeSwap (CAKE), Curve Finance (CRV), Aave (AAVE), etc.
  • Yield Optimizers or Aggregators such as Yearn Finance (YEARN), Convex (CVX), Kamino Finance (KMNO), etc.

*We already discussed DEXs in detail in the previous section.

Lending and Borrowing Protocols

Credit protocols or lending and borrowing protocols offer an open and transparent way for users to borrow and lend money and earn interest on the same. These protocols work similarly to traditional finance, except that the borrowing and lending happen in a P2P fashion.

Understand P2P lending and borrowing like this: A has a surplus of funds in their wallet and decides to contribute his funds to a liquidity pool on a DeFi protocol. B, on the other hand, is interested in borrowing funds and requesting them using the same protocol. The protocol uses various mechanisms to allocate funds to the borrower from the pool to which A contributed. A earns interest on their lent funds, while B has to pay interest on the funds borrowed.

Lending and borrowing protocols have a combined market cap of over $10 billion and approx. $20 billion in TVL (Total Value Locked) is locked in these protocols. Some of the top lending and borrowing protocols include Internet Computer (ICP), Maker (MKR), Aave (AAVE), Frax (FRAX), etc.

Yield Farming protocols

The concept of yield farming started with the lending protocol Compound (COMP) and its governance token COMP. Yield farming involves investors moving their funds to yield-generating smart contracts (or liquidity pools).

The investor becomes the liquidity provider (LP) here and earns rewards for providing liquidity services to protocols such as Compound. All the trades and credit activities in DeFi protocols are governed by smart contracts rather than buyer/seller markets.

DeFi protocols like DEXs and liquidity farming protocols use Automated Market Makers (AMMs) to automate trading, lending, and borrowing via liquidity pools.

How Does Yield Farming Work? | Source: Cointelegraph
How Does Yield Farming Work? | Source: Cointelegraph

Investors engaged in yield farming earn interest and fees for providing liquidity and governance tokens for the platform. Governance tokens allow participants to vote on the protocol's governance.

Yield Optimizers

Yield optimizers or aggregators are also called auto-compounders. These protocols act as a link between the yield farming protocols and investors. They help investors invest in multiple yield farming protocols to maximize their profits from the investment portfolio.

Yield optimizers are also set of smart contracts that pool investor assets and invest in yield-bearing products and services using preprogrammed strategies. Yield optimizers function just like fund managers to find you the best earning opportunities across DeFi protocols.

Yield optimizers combine investments from multiple investors and invest them using different strategies to help investors earn auto-compounded yields or passive income on their idle funds. The investments can move across platforms without manual intervention, and the investor earns optimum yields on their investments as annual percentage yields (APY).

Yield aggregators provide liquidity via liquidity pools to DEXs and credit protocols. The yield aggregation process is complex and can be understood in detail as a separate blog.

Stablecoins

Stablecoins are cryptocurrencies that have their value pegged to another currency, commodity, or precious metal. Stablecoins are relatively less volatile than other cryptocurrencies. They do this by maintaining reserve assets or through algorithmic formulas.

Some of the popular stablecoins include:

Tether (USDT) or Circle (USDC) pegged to the US dollar

DAI pegged to cryptos like Ethereum

XAUt backed by gold reserves

________________

Fun Fact: TerraUST was a popular stablecoin backed by algorithmic formulas. Excessive selling pressure on the sister token Luna caused its price to slump by 80% overnight, resulting in TerraUST's de-pegging from the US dollar. TerraUST's downfall had a domino effect, leading to the longest bear market in the crypto sector in 2022.

________________

Stablecoins have a market cap of 177 billion and facilitate more than 60-80% of the total transaction count in the crypto market. They are used to facilitate trades, bridge fiat and crypto, and make international payments. Many DeFi platforms allow stablecoin holders to earn interest on their holdings.

Check out the complete list of DeFI protocols by Alchemy.

How DeFi Works

Let’s break down how a DeFi protocol works:

Role of Blockchain Technology

Blockchains are global networks in which anyone from anywhere can participate and use without the need for trust-building exercises. In a blockchain, transactions are executed and recorded when the majority of the nodes verify them.

DeFi applications communicate with a blockchain via smart contracts to allow users to make purchases, take loans, or earn yields on their assets. These applications work similarly to regular applications on your computer or smartphone and interact with other layers in the DeFi tech stack built over a blockchain (as discussed previously).

Users interact with DeFi applications via wallets. These applications send and carry back financial information to the blockchain network. Wallets store the private keys to your cryptocurrency assets. Private keys are like your email password, which you require to access your emails and funds in the case of wallets. Transactions happen wallet to wallet in a secure and automated fashion.

That means when A transfers 5 ETH to B, it happens directly without the involvement of a central party like a bank or a middleman like a broker. Anyone can become part of a DeFi system and even lend, borrow, invest, and do more with it.

Explanation of Smart Contract Logic

Smart contracts mediate between two or more parties to replace the role of brokerages and financial institutions. The smart contract logic automatically executes, controls, and documents every action taking place within a protocol like Aave or a platform like the Ethereum blockchain.

These actions happen in sync with the code and context in which the protocol is written. The rules and logic are contained in the smart contract and cannot be altered as soon as it goes live on the network. Smart contracts are also open to public scrutiny since most protocols are open-source.

Interaction with Digital Assets and Cryptocurrencies

Smart contracts serve as the guiding principles for protocols' interaction with digital assets and cryptocurrencies. DeFi protocols also have a native token, which is needed to pay transaction fees. Token holders can also participate in governance and vote on decisions impacting the protocol.

All financial interactions, such as lending, borrowing, yield farming, trading, etc., concern these digital assets and cryptocurrencies. For instance, Lido Finance, a leading liquid staking solution on Ethereum, allows users to earn staking rewards while paying fees in Lido and enjoying governance rights.

MakerDAO is one of the highest revenue-generating protocols, using its MKR token to issue DAI stablecoins and control their prices. Popular market maker protocol Curve Finance uses its token CRV to incentivize users.

Advantages of DeFi

DeFi enjoys several advantages over traditional financial services. Let’s jot down a few:

Complete Autonomy: Since there’s no interference from a third party, users have complete control and freedom of where and how they want to put their assets to use.

Instant Fund transfers: Users aren’t required to wait for days and weeks for fund transfers. An Automatic Clearing House (ACH) transaction can take up to three days, and a loan approval may take weeks. In DeFi, these transactions can, at the most, take minutes to get approved.

Encryption and Pseudonymity: Blockchain transactions are pseudonymous, i.e., your identity remains hidden. However, the transactions can be tracked to your wallet address. Since blockchains afford decentralization and encryption, overall security is enhanced, and single-point-of-failure risks are minimized.

User Empowerment: Since blockchain is a global network, you can give or receive financial services to and from anywhere across the globe. This is another advantage of blockchain technology. DeFi blurs the role between providers and consumers. If you are a DeFi user, you can crowdfund another user’s loan or use your assets to take a fresh loan.

Transparency and Accessibility: DeFI protocols are open-source and subject to scrutiny by anyone. Anyone can audit or inspect how the system works and track transactions. DeFi protocols disintermediate financial services and require only a smartphone with an internet connection. Anyone participating in a DeFi protocol can benefit from global liquidity and accessibility to the ‘n’ number of protocols of their choice, 24* 7.

Low fees and high interest rates: DeFi ensures high interest rates and low costs as transactions happen directly via DeFi networks. Financial institutions are tokenizing legacy investments, such as treasury bills, to take advantage of the efficiencies DeFi offers.

Risks and Challenges in DeFi

The DeFi ecosystem is still in its early stages and faces challenges such as smart contract vulnerabilities, a lack of testing, security risks, and a lack of regulatory clarity.

Financial risks include impermanent loss from changes in the price of the deposited assets and liquidation risks when the price of the asset drops below the loan price, and the users bear the loss.

Smart contract vulnerabilities are the biggest risks DeFi protocols face. Hackers often exploit a bug or vulnerability in a smart contract to steal massive amounts of funds. In 2023, hackers stole $1.1 billion worth of cryptocurrencies from DeFI protocols.

DeFi still falls in the category of unregulated markets and has very little protection if an investor falls prey to a scam or hack. DeFi lacks enough liquidity flow, given that it still comprises less than 1% of the world's investments despite being a $90 billion sector.

However, the sector is maturing and giving way to self-regulated protocols that have made investor protection a top priority, NFT.EU, a leading source of information on all things DeFi and NFT, offers beginner-friendly and advanced user guides for investors to make informed decisions in the DeFi space.

A Comparative Overview of Popular DeFi Platforms

Source: Defillama, DAppRadar, and Coinmarketcap

Ethereum

Market Cap: $293.8B

  • Total Value Locked (TVL): $48.247B
  • Number of DeFi Protocols: 1153
  • Number of Users (Addresses): 380,106
  • Average Network Fees: $0.55
  • Popular Protocols: UniSwap, Aave, MakerDAO
  • Cross-Chain Bridge: Elephant Money
  • NFT Marketplaces: 1xBit, Magic Eden
  • Staking Options: Aave V3

Binance Smart Chain

  • Market Cap: $77.32B
  • TVL: $4.37B
  • Number of DeFi Protocols: 789
  • Number of Users (Addresses): 968,264
  • Average Network Fees: $0.11
  • Popular Protocols: 1inch, 0x Protocol, ApeX Protocol
  • Cross-Chain Bridge: NFTb
  • NFT Marketplaces: Bitgert Swap
  • Staking Options: Trader Joe

Solana

  • Market Cap: $68.38B
  • TVL: $5.32B
  • Number of DeFi Protocols: 159
  • Number of Users (Addresses): 1.99M
  • Average Network Fees: $0.03
  • Popular Protocols: Drift Protocol, Jupiter Exchange, Raydium
  • Cross-Chain Bridge: Crystl.Finance
  • NFT Marketplaces: 1xBit, Magic Eden
  • Staking Options: GMX

Tron

  • Market Cap: $13.67B
  • TVL: $8.57B
  • Number of DeFi Protocols: 34
  • Number of Users (Addresses): 2.29M
  • Average Network Fees: $0.18
  • Popular Protocols: JustLend DAO, SunSwap V2, PayNet
  • Cross-Chain Bridge: TronNRG
  • NFT Marketplaces: 1xBit, Magic Eden
  • Staking Options: WOOFi

Avalanche

  • Market Cap: $9.63B
  • TVL: $942.83M
  • Number of DeFi Protocols: 399
  • Number of Users (Addresses): 33,262
  • Average Network Fees: $0.014
  • Popular Protocols: Stargate Finance
  • Cross-Chain Bridge: Trader Joe
  • NFT Marketplaces: 1xBit, Magic Eden
  • Staking Options: Aave V3

Conclusion

DeFi is still in its infancy but is fast gaining ground as the blockchain ecosystem and technology continue to grow. More and more DeFi protocols with unique use cases are emerging and gaining a robust user base.

With the launch of the Bitcoin and Ethereum ETFs, DeFi saw a boost in interest worldwide. As crypto adoption grows further, users are bound to be touched by the utilities DeFi offers above and beyond traditional financial services.

While risks and challenges remain, the DeFi sector is growing and expanding in scope and kind. The decentralized revolution has just begun!

Interested to learn more about DeFi and NFTs? Head over to NFT.EU and access the most comprehensive library of articles and guides!

Discover. Learn. Profit

Subscribe to our newsletter to be in-loop with all news from the crypto world

FAQs

  1. What is a DeFi in Crypto?

DeFi in crypto implies the protocols and applications based on smart contracts that function without the need for an intermediary or central authority. DEXs, liquidity protocols, yield farming protocols, lending protocols, etc., are some examples of DeFi applications in crypto.

  1. Is DeFi a good investment?

DeFi is a billion-dollar industry today, with multiple opportunities for users to earn income actively and passively by participating in dApps and protocols.

For instance, when users deposit their Ethereum and USDT tokens in an Aave liquidity pool, they earn rewards as liquidity providers. But when users stake their tokens within Aave or staking-specific protocols such as Lido or Eigen Layer, they earn passive income for contributing to the network's security.

  1. Is DeFi safe?

DeFi is based on blockchains and smart contract logic. While blockchain offers users a secure and transparent environment, a DeFi protocol may be vulnerable to hacks and smart contract risks. Other kinds of financial risks include impermanent loss, liquidations, market fluctuations, etc.

  1. Is there money in DeFi?

Users can earn well by rationally investing in hundreds of DeFi protocols active across blockchain ecosystems in the Web3 space. There are multiple ways to earn money by investing in DeFi, such as lending, borrowing, yield farming, staking, trading, etc.

  1. How is DeFi different from Bitcoin?

Bitcoin is the first decentralized money serving as a digital mode of payment and store of value. DeFi adds programmability to digital money by bringing innovative use cases via smart contract logic.

An interesting application of DeFi is Eigen Layer, where users can retake their staked Ethereum to enhance the security of L2s and Ethereum.

  1. What are the top 5 DeFi coins?

As per Coinmarketcap, the top five contenders for DeFi as of August 20 are Avalanche (AVAX), Chainlink (LINK), DAI (DAI), UniSwap (UNI), and Stacks (STX).

  • 4070
  • 2
  • 3