Introduction to Decentralized Finance (DeFi)

A Brief Guide to Understanding how Decentralized Finance Works

What is DeFi?

DeFi is short for decentralized finance. It is a financial system built on a distributed ledger. Unlike the traditional financial system, which relies on a centralized entity like the bank, DeFi operates in a decentralized manner. It relies on cryptocurrencies and blockchain technology to execute financial transactions and services through smart contracts.

Decentralized finance does not require an intermediary because of the self-executing nature of smart contracts; this further enhances accessibility, transparency, and security.

Regardless of geography, demography, and government policies, anyone with access to an internet connection can participate in DeFi.

Features of Decentralized Finance (DeFi)

Over the years, decentralized finance (DeFi) has gained significant traction thanks to its innovative features that set it apart from traditional centralized finance. Here are some of them.

  1. Decentralization

    DeFi relies on blockchain technology and smart contracts, which are self-executing and programmed by code. This eliminates the need for centralized institutions like banks, and thanks to this, the problems associated with centralization, such as censorship and manipulation, are reduced.

    Unlike centralized entities, transactions cannot be blocked or restricted, and you have complete control over your funds, unlike the traditional system where the bank is in charge of your funds.

  2. Accessibility

    DeFi offers financial inclusion. Anyone can participate in DeFi without needing a bank account; even those excluded from accessing their country's traditional banking systems can use DeFi; all that is required is an internet connection. This ensures there’s a low barrier to entry.

  3. Peer-to-peer transfer

    DeFi promotes peer-to-peer transfer, which eliminates the need for an intermediary; this makes it easier to transfer funds regardless of location.

  4. Permissionless

    Thanks to the permissionless nature of DeFi, developers can create and launch applications on DeFi platforms without asking for approval from centralized authorities. This promotes massive innovation and alternative financial services without monopolies; this can be seen with the hundreds and thousands of financial applications on the blockchain.

  5. Transparency

    All transactions on the public blockchain can be viewed by anyone. It is available in the public domain. For example, transactions on the Ethereum blockchain can be viewed on Etherscan. Transactions on the Solana blockchain can be viewed on Solscan. Thanks to this, all transactions on the blockchain are transparent and verifiable.

    Also, most smart contracts are audited before and after launch, which ensures trust and accountability.

  6. Availability

    Unlike traditional financial systems that operate only on weekdays, DeFi applications and services are available 24/7. People can trade cryptocurrencies on weekends, unlike forex trading, which is only available on weekdays.

  7. Interoperability

    DeFi applications can share data, promoting interchain activities. Thanks to interchain activities, users can access multiple DeFi services without being restricted to one platform.

  8. Community Governance

    DeFi fosters community participation in governance and decision-making through decentralized autonomous organizations (DAOs), where token owners (people who own a particular cryptocurrency) can vote on a decision within the network. This promotes ownership and community-driven development.

    However, despite these benefits, DeFi is still a growing industry riddled with regulatory concerns and security issues, but it's still looking stronger and improved with innovation.

Components of DeFi

Certain things make DeFi possible; you can call them the “building blocks” or “components” of DeFi. Let’s briefly discuss them.

Smart Contracts

I prefer to call this the “heart” of DeFi; without it, everything is as good as dead. Just like your heart, without pumping blood to other parts of the body, you’ll be feeling numb.

What makes smart contracts interesting is that they are self-executing contracts already coded to execute automatically on blockchain once certain conditions are met. For example, assuming you placed an order to buy $20 worth of Ethereum from a decentralized exchange such as Uniswap, the smart contract will crawl through the coded program and your wallet to check if you met the condition (that’s if you have up to $20 worth). Once you satisfy these conditions, the order will be successful, and if you don’t, the transaction will fail. In essence, smart contracts eliminate the risk of fraud and manipulation.

Decentralized Exchanges

In financial terms, an exchange is a marketplace where securities, stocks, derivatives, and other financial instruments are traded. Decentralized exchange is a peer-to-peer marketplace where people can buy, sell, and swap cryptocurrencies directly from their wallets without an intermediary. Thanks to smart contracts, these actions are executed automatically.

image of Uniswap exchange

The wallet gives the user non-custodial control over their cryptocurrency, which also forms the ethics of DeFi. Decentralized exchanges include PancakeSwap, 1inch, Uniswap, Dydx, Dodo, Apex Protocol, etc.

Liquidity Pools

The best way to illustrate a liquidity pool is to use fixed deposits. You probably know how that works. So, you save your money with the bank for a particular time and earn a fixed interest from the bank. The bank then lends this money to borrowers or invests some portion of it in financial instruments such as mutual funds, government securities, etc. Your fixed deposit also ensures that the bank has enough money (liquidity) to meet customer demands for withdrawal. The liquidity pool on the DeFi is not too different from this.

So, what is a liquidity pool?

A liquidity pool is a collection of tokens (mostly cryptos) that are locked in a smart contract to provide enough liquidity for decentralized exchanges. In return, users who lock their tokens in the smart contracts will get liquidity provider (LP) tokens. So, by contributing to the pools, they earn a portion of the trading fees generated on decentralized exchanges. This ensures that there are enough funds when users want to buy and sell cryptocurrencies. Just as you receive interest for your fixed deposit, in DeFi you receive incentives by earning a share of the liquidity pool.

There are different ways users can contribute to the liquidity pool. Let's quickly look at the two most important ones.

Yield Farming

Yield farming is a form of investment whereby the users of a DeFi protocol earn "yield" (interest or tokens). They earn this yield by contributing their cryptocurrencies to provide liquidity. People who take part in yield farming are called yield farmers. They leverage the DeFi protocol features by lending, borrowing, or staking to earn interest. Yield farming is also known as liquidity mining.

When a yield farmer contributes to a liquidity pool, they’re also aiding trading on the platform. The earned tokens are liquidity provider (LP) tokens. The reward a yield farmer earns can be the governance tokens or native tokens of the DeFi protocol. These governance tokens let them take part in the decision-making of the protocol.

Yield farmers can increase their chances of getting higher returns by moving their tokens across different liquidity pools. They can also stake their liquidity provider (LP) tokens on other protocols, or take part in the launch of new tokens to increase their profits.

Yield farming is lucrative, it is not without risks; the market can crash like during the bear run when the prices of cryptocurrencies dip. Also, the developer can cart away investors' funds and there are regulatory risks. However, every investor should weigh the pros and cons before participating.

DeFi yield farming platforms include Venus, Curve, Sushi, Synthetix, Yearn, etc.

DeFi staking

DeFi staking involves locking a specific amount of your cryptocurrency in a DeFi protocol to earn rewards and passive income. The cryptocurrency is locked up for a specific period known as a "staking period." By doing so, you’re contributing to the security and functionality of the platform. The staker's reward can be extra tokens, governance tokens, or a share of transaction fees on the platform.

Most of the DeFi protocols use Proof of Stake(POS) consensus mechanisms. In the POS mechanism, validators are selected to create new blocks and validate transactions depending on how much of the native cryptocurrency they hold and are willing to stake as collateral. Becoming a validator often requires holding a huge amount of the native cryptocurrency, which most participants may not be able to afford. These validators then create a staking pool where participants can stake their tokens with small amounts.

DeFi staking has the same risk associated with yield farming.

Yield farming and DeFi staking provide users a chance to earn passive income and have a say in the decision-making process of the platform. However, it is best to weigh the merits and demerits before you proceed.

Oracles

Before diving into what an oracle is, you need to understand two terms: on-chain and off-chain. The first means data that is already stored in the blockchain, while the latter refers to data that is external to the blockchain. Oracle bridges the gap between on-chain and off-chain data through smart contracts. For example, if you place a bet that the Los Angeles Lakers will beat the Phoenix Suns in a basketball game, the blockchain cannot verify which team wins. But by connecting Oracles to the blockchain, it can access the real-live result to know if you won the bet or not.

Oracles also allow blockchains to access weather information, price feeds, and health data. It also provides the blockchain with data on real estate; with this data, users can buy and sell properties through smart contracts.

Examples of blockchain Oracles include Band Protocol, Chainlink, DIA, HAPI, Nest Protocol, etc.

Popular DeFi Protocols and Platforms

DeFi protocols are standards or algorithms that are encoded into smart contracts to govern decentralized financial applications.

DeFi protocols allow users to lend, borrow, trade, and perform other financial services through smart contracts.

Let’s quickly review some of the popular DeFi protocols and platforms.

Uniswap: Decentralized Exchanges

Uniswap is a decentralized exchange (DEX) built on the Ethereum blockchain. It uses an automated market maker (AMM) model to enable users to buy and sell tokens without depending on traditional order books. This is made possible thanks to the peer-to-peer nature of smart contracts. So if you’re buying Eth for USDC, there’s someone on the other end who’s selling their Eth and getting USDC in return. Unlike traditional finance, where there are market makers, the smart contract makes the market. Uniswap rewards users who contribute to the liquidity pools through token pairs. These users earn fees from traders who use that pool. The protocol has a native token called the UNI token, for short. Holders of these tokens can also participate in community-driven governance; this is another hallmark of a permissionless, decentralized exchange. You can buy, sell, and swap tokens on Uniswap once you’re connected to the platform through a wallet.

Compound: Lending and Borrowing

Compound Finance is a DeFi lending protocol that allows you to lend and borrow supported cryptocurrencies. When borrowing tokens, users will use their crypto holdings as collateral. When lending, you stand to earn interest from your crypto holdings. These processes are permissionless and do not require an intermediary. It uses an algorithm to adjust the interest based on demand and supply, which then creates the decentralized money market.

Compound Finance has its native token, COMP. With it, users can participate in the governance and decision-making process of the protocol.

MakerDAO: Decentralized Stablecoins

To explain the MakerDAO protocol, I need to define what a stablecoin is. A stablecoin is a type of cryptocurrency whose value is pegged to a reference asset, which in most cases is the US dollar. This is done to stabilize the value of that asset. In most cases, 1 stablecoin is equal to $1. People usually want to convert their crypto holdings to a stablecoin.

So, what is MakerDAO all about?

The MakerDAO protocol allows users to borrow the stablecoin DIA while using their crypto assets as collateral. However, these loans are overcollaterized, which means you’ll need to deposit more funds than what you’ll receive. All these are done on the blockchain without relying on a centralized authority. It has a governance token, MKR, that allows users to participate in the decision-making and development of the protocol.

People prefer to borrow DAI rather than sell their other crypto because they’ll be able to get DAI without selling their other volatile crypto like Ethereum, and the lending protocol offers higher returns for stablecoins than cryptos like Ethereum.

Aave: Unlock Liquidity with Flash Loans

Just like compound finance, Aave works like a decentralized lending pool. However, thanks to a concept called flash loans, users can also borrow tokens on the Aave protocol without collateral as long as the borrowed funds are returned within the same transaction. Thanks to this development, it has opened new frontiers in the decentralized finance sector in the form of arbitrage trading. If the arbitrage is not successful, the funds will be returned to the protocol. However, if it's a success, the fund will still be returned to the protocol while the trader carts away the profit.

The protocol’s native token, AAVE, allows holders to participate in the governance and decision-making of the platform. DeFi protocols have changed the world of decentralized finance by facilitating all that is possible in the traditional banking sector into the decentralized space.

Conclusion

While DeFi has had its criticism, it is an evolving industry. Some innovations, such as cross-chain interoperability, yield aggregators, and decentralized derivatives, are some that will shape the DeFi space in time to come. We have to keep building, adjusting, and making adjustments where necessary.