DeFi has been one of the primary drivers of the cryptocurrency resurgence in 2020 and continues to be on a tear through much of 2021 so far. Still, it remains one of the industry’s most opaque areas to the outside world. So, what is DeFi and how does it work? Why has it grown so much this year and has become so influential on the cryptocurrency market in general?

This guide provides an in-depth explanation of these concepts. Below, you can find answers to the following: 

  1. DeFi: What it is and how it works
  2. What fueled DeFi’s rise?
  3. DeFi’s top applications — and notable protocols 
  4. Examples: Yearn.Finance and Uniswap 
  5. DeFi: benefits
  6. DeFi: drawbacks and risks 
  7. The future of the industry 

1. DeFi: what it is and how it works

The term “Decentralized Finance” (DeFi) covers financial services carried out on a blockchain. DeFi are financial services with no central authority. It involves taking traditional elements of the financial system and replacing the middleman with a smart contract. We can also describe it as the merger between traditional banking services with blockchain technology, in layman’s terms.

So, for DeFi to work, it needs a decentralized infrastructure to run on. This is where the Ethereum blockchain comes into play. The Ethereum blockchain is a DIY platform for decentralized applications (DApps).

Most DeFi protocols operate on the Ethereum blockchain, although some are now also hosted other competing blockchains, such as the Solana network, to enjoy greater speed and scalability.

2. What fueled DeFi’s rise?

DeFi’s beginning is often traced to MakerDAO, a platform that launched in 2015 that allowed users to use cryptocurrency as collateral for loans. Like traditional cryptocurrencies, DeFi protocols promise to eliminate unnecessary intermediaries. This libertarian view and a desire for investors to make money have fueled the market till now. 

Bitcoin was created in 2009 as an alternative to traditional finance and financial authorities like banks. But while bitcoin was intended to function as money, many limitations still exist. Bitcoin’s functionality depends on a network of new central authorities that keep the wheels turning. These include miners, node operators, wallets and exchanges.

While helpful, these authorities have shown a proclivity for acting like those they came to eradicate. They hold power over several critical aspects. 

These include assets that get listed, customers that can access their services, and more. A genuinely democratized financial ecosystem should be run by the people alone. While Bitcoin has given glimpses of this possibility, it has also fallen short.

There are no central authorities, and protocols are run by smart contracts designed to eliminate foul play. DeFi functions as an open financial network that is trustless and decentralized. This openness has attracted many investors, with the total value of tokens now locked in DeFi protocols exceeding US$165 billion as of this publishing time in September 2021.

3. DeFi’s top applications — and notable protocols 

Now, that we know what DeFi is, let’s look at some of its notable applications.

1. Decentralized exchanges (DEXs)

Decentralized exchanges are exchanges that operate without an intermediary. They are not as popular as their centralized counterparts. 

With DEXs, users can connect directly with one another to buy and sell cryptocurrencies in a trustless environment. Assets traded under DEXs are never held in an escrow or third party wallet, as is done with centralized exchanges. Some top DEXs include Uniswap, Curve and SushiSwap. 

Centralized exchanges, on the other hand, are trading platforms operated by a central authority. Platforms like Binance and Coinbase are popular examples of centralized exchanges. They are custodial in nature. In other words, the buyers and sellers trust the central authority to keep their digital assets safe.

2. Lending Platforms

DeFi proponents say the decentralized lending platforms are democratizing the lending ecosystem. These platforms use smart contracts in place of intermediaries like banks — allowing borrowers and lenders to participate in an open system. Lenders can earn interest on their crypto assets by loaning them out, while borrowers can access liquidity without selling off their assets. 

With the traditional financial system, you need to offer collateral before you can access loans from the bank. This is similar to what happens in DeFi. Borrowers have to over-collateralized their loans by offering assets more valuable than the loan value. Some of the top DeFi lending platforms include Maker, Compound, and Aave.

3. Prediction Markets

A prediction market allows participants to make bets on the outcomes of future events. These platforms function like traditional prediction markets — but with blockchain functionality, which eliminates intermediaries. Examples of DeFi prediction markets are Augur, Gnosis and FTX. Crypto powered prediction markets flourished during the 2020 U.S. presidential elections. Augur recorded a milestone volume of over $8 million. Other platforms like Polymarket and Predictit also saw significant election volumes.

4. Yield farming

Yield farming is the process of locking up cryptocurrencies in exchange for a reward. It’s the hottest new term in the DeFi space. Money markets Compound and Aave are two major platforms to farm DeFi yields. Yield farmers stake popular coins like ether, dai, tether and others.

4. DeFi at work: Yearn.Finance and Uniswap

Yearn.Finance and the YFI token

Yearn. Finance (yearn.finance) is a platform that provides a gateway to other DeFi protocols. It was built by Andre Cronje, a South African financial technologist who found inconsistencies in the yields that several DeFi protocols offered.

The service runs on the Yearn protocol — essentially, a yield optimizer that maximizes yields by allocating liquidity across various DeFi solutions.

The YFI token is the governance token of the Yearn network. Like most DeFi platforms, the decision-making process is powered through token ownership. The more tokens you own, the more sway you have in the voting system. 

It’s an ERC-20 token with a maximum supply of 30,000 tokens. In the beginning, Yearn’s creator gave the tokens out to investors who had deposits in key liquidity pools. 

Since then, the price of YFI has risen astronomically. It even jumped over 270% within five days to become the most expensive cryptocurrency, trading above US$27,000 in August 2020. It’s witnessed some correction over time and is now trading at $17,924, at writing time.

Uniswap: seamless token swaps 

Uniswap is a DeFi protocol built on Ethereum for swapping tokens. Decentralized exchanges solve a multitude of problems that plague centralized exchanges like security breaches and high fees. But, they struggle with liquidity. Uniswap was created to end the issue of liquidity around decentralized exchanges (DEX).

Uniswap is an automated liquidity protocol that doesn’t require an order book to make trades. It relies on liquidity providers and a decentralized pricing mechanism called the Constant Product Market Maker — which is a variant of the Automated Market Maker (AMM) that powers yield farming. AMMs are smart contracts that hold the pool set aside by liquidity providers for traders.

Anyone can list an ERC-20 token on Uniswap. Each token has a smart contract, but not every token has a liquidity pool. 

LPs can create a liquidity pool by depositing an equivalent value of two tokens, say ETH and USDT. Uniswap uses a constant equation: x * y = k to determine pricing. The equation seeks to balance out the value of tokens and their swaps based on how much people want to trade them.

In the equation above, let’s look at a simple ETH/USDT pool. Let’s represent x with the ETH section of the pool and y represent USDT , while k is a constant value that will never change. k represents the total liquidity in the pool. For example, if Ben decides to buy 1 ETH for 500 USDT. What happens in Uniswap is that the supply of ETH falls, while the supply of USDT goes up and the price of ETH rises since there’s less ETH in the pool after the trade and k must always be constant.

5. DeFi benefits 

1. Permissionless

Traditional banks are expensive to run and bureaucratic in nature. They take too long to process transactions and have cut many people out of the financial system due to their stringent requirements. DeFi came to solve many of these issues. Here are some of its benefits.

DeFi opens everyone to the financial system irrespective of income, race, wealth, culture or geographic location. All a user needs is a mobile phone or computer with internet access.

There is a significant number of unbanked people globally. The World Bank estimated in 2018 that 20% of the world’s population lack access to banking services. One reason for this is that most of the unbanked lack much-needed know-your-customer (KYC) documents like state-issued I.D. cards.

Several DeFi platforms allow users to function without any of this. You can take out a Maker loan, for instance, without any identification or credit score.

2. Interest rates for investors

Beyond keeping your wealth like a savings account, DeFi also allows you to earn income. Platforms like Aave and Compound allow you to deposit assets and lend them out to borrowers. At an agreed-upon time, you get your interest and can plow your capital back into the system. 

Compound offers up to 4.3% interest on deposits from some tokens, while Aave is paying out as much as 5.73%. Compared to the 0.6% to 0.7% currently offered by traditional banks for savings accounts, it’s not difficult to see why some people are shifting their assets to DeFi. 

3. Control over your own finances

With DeFi platforms, you remain in control of your finances. While you have to deposit your funds into the platform, you decide what happens to them. Instead of trusting human intermediaries to qualify you for a loan or decide how to manage your investments, a smart contract does that.

No one can ban you from a DeFi protocol. The underlying smart contract is law, and it operates blindly. 

4. Heightened transparency

DeFi enables a greater level of openness and accessibility. Since most DeFi protocols are built on the blockchain — a public ledger — all activities are available to the public. Anyone can view transactions, but these accounts are not tied to anyone directly as is the case with traditional banks. Instead, accounts are pseudo-anonymous, listing only numerical addresses. Users with programming knowledge can also access most DeFi products’ source code to audit or build upon since they’re open source. Open-source codes are far more secure and of higher quality than proprietary software, thanks to community interaction.

6. DeFi drawbacks and security risks 

1. Security issues with smart contracts

What are smart contracts, and what is their role in DeFi? Smart contracts form the backbone of any DeFi protocol. But they are susceptible to manipulation. 

By default, smart contracts are open-source. This design allows prospective users to review them before investing in the DeFi protocol. Most DeFi protocols give their smart contracts to security firms to audit. This is where the problem begins. It’s not unusual for humans to miss flaws in these contracts, which could be exploited in the future. 

Take The DAO, for example. The digital “Decentralized Autonomous Organization” was an investor-directed venture capital fund of sorts that launched in April 2016 and grew quickly to become the biggest crowdfunding platform, managing about $120 million. However, by June that same year, hackers found a vulnerability in the smart contract and stole about a third of its funds. They moved the funds into a “child DAO,” which had the same structure as the parent protocol. Users couldn’t access their funds for weeks, making this perhaps the largest hack in crowdfunding history.

There have been several refunds since then, allowing investors with residual DAO tokens to get some compensation. However, the incident sparked an awakening in the DeFi space. Now, developers who build protocols ensure that their smart contracts go through multiple audit rounds 

2. Data feed centralization

Blockchain protocols can’t access off-chain data. To remedy this, many of them use oracles — third-party services that provide access to external information. Oracles serve as bridges between blockchains and the outside world, relaying information to smart contracts for them to utilize. 

The major issue with oracles is creating a central point of trust into trustless and decentralized setups. This centrality provides a vulnerability for the entire smart contract. When an oracle broadcasts the wrong information, the consequences could be dire. 

Take the case of Synthetix — a DeFi asset issuance platform. On June 25, 2019, an oracle transmitted false price feed data to the platform’s smart contract. A user’s trading bot took advantage of this and inflated the user’s balance. This allowed the user to convert this balance to about 37 million Synthetic ETH (sETH) tokens (worth $70 million at the time). Synthetix confirmed that they reached out to the user, who agreed to reverse the transaction in exchange for an unspecified bug bounty. 

3. Bad actors

In September, the top crypto exchange KuCoin confirmed that it had suffered a hack that saw $150 million in bitcoin and ERC-20 tokens transferred from its hot wallets. Days after the event occurred, blockchain intelligence software Elliptic crunched the numbers and found that the exchange had actually lost about $281 million. 

The report added that the hackers had been laundering the funds through DeFi protocols Uniswap, Kyber Network and others. As Elliptic explained, many centralized exchanges had frozen the hackers’ accounts, preventing them from moving their funds. However, in DEXs, the hackers found the perfect conduits — platforms with no central authorities to freeze their funds.

7. The future of the industry 

DeFi’s performance in 2020 has put the entire crypto market on notice. With assets locked increasing in value, even some traditional crypto companies are looking to cash in on the hype. 

According to DeFi Llama, the total value locked in DeFi now exceeds US$165 billion. This is a 770% rise since January this year and more than 19,000% increase since the start of 2020. 

Unfortunately, DeFi’s boom has attracted a bevy of malicious actors. Recent data from crypto analytics firm CipherTrace reported that total losses from DeFi thefts so far in 2020 is $100 million. And it’s rising. In the second half of 2020 alone, 50% of all cryptocurrency thefts were from DeFi protocols. Centralized exchange KuCoin also had about $19 million liquidated by thieves via decentralized exchanges.

CipherTrace believes that DeFi’s growth made it a prime target for cybercriminals, most of whom understood some of its technical limitations and could take advantage of them. 

The DeFi industry faces the same growing pains as the crypto space as a whole. It’s still in its infancy with plenty of room for growth. But, despite the benefits and returns, it’s still a risky endeavor for the average investor.