How-To Guides: Intermediate

What is Defi?

By Jinia Shawdagor | May 28, 2021

Get a clear picture of the DeFi ecosystem and its impact on finance. This guide breaks down the history or DeFi, the components, while briefly touching on the risks of DeFi applications.

What is DeFi

Decentralized finance or DeFi as it is popularly known is a world of monetary freedom and endless lucrative possibilities. However, the journey into DeFi can be daunting to anyone who is just getting started. Not only is there a lot to learn, but the industry itself is also still young and therefore things are constantly changing and at a rapid pace.

There is no doubt that DeFi, in general, will have a profound impact on how we view cryptocurrencies and finance. The sector’s capacity to design an infrastructure where financial systems are devoid of gatekeepers and intermediaries, not to mention trust, is astonishing. A democratic decentralized approach to the global financial system can change healthcare, governance, and education, to mention just a few.

In recent months, DeFi has been a hot topic even as a bull rally ensued in the cryptocurrency markets. Despite the criticism, DeFi projects continue to emerge with an ever-increasing number of users disproving the naysayers.

From reports of DeFi flash loans skyrocketing to unimaginable heights to, liquidity providers accruing generous returns all from locking funds on a platform and even the many scams that proliferate the industry, this article will give you a detailed guide as you begin your journey into the world of decentralized finance.

What is DeFi

One could argue that all cryptocurrencies are part of decentralized finance. While that might be somewhat true, the term DeFi refers to a specific ecosystem of financial products and applications built on blockchain and smart contracts to provide democratized and open access.

To enable true independence and democratization without intermediaries, these DeFi applications are built on permissionless Blockchains like Ethereum where smart contracts are used to automate and replace trusted intermediaries. DeFi applications can deliver a variety of financial services and products ranging from insurance, spot and margin trading, derivatives trading, savings accounts, lending, and borrowing. In most cases, the application will be designed to use lucrative incentive mechanisms to encourage participation from its users.

For example, a lending and borrowing DeFi application will incentivize lenders with rewards and a cut of the interest generated from borrowers. Borrowers will also be incentivized with quick and instant loan approval processes. The entire goal of a DeFi application is to remain non-custodial meaning the user is always in full control of their assets hence the requirement to connect with Web 3 crypto wallets such as MetaMask on almost all DeFi platforms.

Where it all began

Without a doubt, Bitcoin sparked the DeFi movement with an introduction to blockchain technology. However, as a pioneer of decentralized finance, Bitcoin’s network had to focus on security above everything. This resulted in a network that was rigid to change such that proposed changes take a long time to implement even with enough support. While rigidity serves Bitcoin’s use as a store of value, it prevents the network’s capacity to support a DeFi ecosystem.

Cue Ethereum. Ethereum’s launch in 2015 featured the beginning of programmable Blockchains thanks to the use of a programing language called Solidity. Although sophisticated, Solidity allows developers to develop smart contracts that give Ethereum’s blockchain a level of flexibility that was previously unfathomable on Bitcoin’s Blockchains. This development facilitated the hosting of decentralized applications on the Ethereum network.

By 2017, a growing number of developers began building on top of Ethereum and used initial coin offerings (ICO) to fund their projects. This brought about a speculative mania as a plethora of questionable and dubious projects joined the fray to capitalize on the opportunity. However, amid all the hype and especially after the crash of the market in late 2017 leading up to the 2018 to 2019 bear market, a little-known project called Uniswap emerged.

Uniswap single-headedly introduced a protocol that would later be adopted throughout the DeFi ecosystem. As a decentralized exchange (DeX from now on), Uniswap managed to solve the lack of liquidity in legacy DeXs by using an automated market-making protocol that runs on Ethereum’s smart contracts. Instead of outsourcing liquidity from centralized venues, Uniswap used an automated market maker that outsourced liquidity from the platform’s users. Anyone could provide liquidity to the DeX by locking funds to a liquidity pool controlled by a smart contract that generated returns for the liquidity provider based on the fees charged to traders. These liquidity pools replaced the conventional order books on centralized exchanges. Traders, on the other hand, have access to a non-custodial DeX with no KYC or lengthy AML verification process.

Since the Uniswap AMM protocol is an open-source protocol, other projects soon started to adopt the protocol into their project’s design. For instance, SushiSwap (a fork of Uniswap) offered a native token on its DeX. Sushi swap users were able to earn rewards in Sushi on top of the fees they receive from providing liquidity. Other iterations of Uniswap’s protocol have been built on other Blockchains as well with examples including the Binance Smart Chain, Compound, and soon Cardano.

A breakdown of the DeFi ecosystem

The past 12 months have seen an explosion of lucrative activities in the DeFi space with Ethereum at the red-hot center and $13.6 billion in capital flowing into the sector. While this wave of activity was primarily driven by DeFi’s lending and trading applications such as Compound, Aave, Uniswap, Kyber, and MakerDao, there is a lot more to DeFi than these trading, lending, and borrowing platforms.

DeFi and its many concepts are also used to create Stablecoins, create oracles that feed data to smart contracts, create derivative markets and even build wallets and prediction markets. This section will break down the many applications of DeFi as well as all the DeFi concepts that make up the entire ecosystem.


DeFi wallets are more like the front-end interface of the entire ecosystem. While the companies that create DeFi wallets don’t necessarily compete in terms of finances, they do compete in terms of design, ease of use, customer support, and localization. At its core, a wallet producer aims to acquire the most customers with an intuitive interface with high functionality while still keeping it simple and easy to understand. A few examples include MetaMask, Exodus, TrustWallet, and Math.

DeFi’s Transaction layer

Having a wallet is just the beginning of your journey into DeFi. Next, you need to understand the concept of a transaction layer. It is the transactional layer that gives you the ability to transact with other wallets or with smart contracts as most DeFi platforms are non-custodial. As the DeFi ecosystem grows, its level of complexity increases as DeFi protocols depend on one another to operate smoothly.

For example, you can use ETH as collateral to get a loan on a lending platform such as Compound and then exchange the USDC or USDT loan you have received for a token pair and provide liquidity on Uniswap. The liquidity pool tokens you get from Uniswap can be used on Sushiswap for a variety of activities including farming, betting, or creating NFTs.

As you can see, the entire ecosystem is not only complex by held together by the transaction layer. As assets are moved from one platform to the other, transaction costs accrue. With Ethereum as a major host of DeFi projects, network congestions have recently gone as high as $100 per transaction across the entire network.

Atomic units of value (Stablecoins)

Next, we have the Stablecoins or the atomic units of value. These are crypto-assets whose value is pegged to a stablecoin or the underlying value of liquidity provided in a liquidity pool.  Examples include DAI, USDT, USDC, cTokens, Liquidity Pool (LP) tokens, aTokens, and so forth. In the DeFi ecosystem, Ethereum is considered an atomic unit of value as the value of most tokens is pegged to Ethereum. Other DeFi platforms will create a token whose value is pegged to a major crypto-asset such as BTC with examples including the renBTC, tBTC, pBTC, and WBTC. Essentially, you can exchange these tokens with stable crypto assets such as BTC or ETH on a ratio of 1:1.

DeFi Price Oracles

Oracles are the bridge between the blockchain and the rest of the world. As smart contracts on the blockchain are unable to communicate with programs outside the blockchain, Oracles bridge the gap by validating data from without the blockchain, translating it to a language smart contracts understand and vice versa. Price oracles in the DeFi ecosystem are essential as they secure and verify inputs from market data. Without the input of market data, smart contracts on DeXs such as Uniswap would not be able to appropriately price the assets in the liquidity pool. Price oracles, to be specific, enable DeFi protocols to initiate liquidation events. The most popularly known examples include Nest, Coinbase, MakerDAO’s Medianizer, Compound’s Open Oracle, UMA, Tellor, Chainlink, and Brand.

Lending Protocols

Decentralized lending and borrowing platforms give loans to businesses or individuals with collateral but without an intermediary or KYC and AML processes. These platforms incentivize users to lend and earn an interest where a user can deposit funds to a lending pool that generates interest. Borrowers can then access the funds by depositing collateral.

For example, Compound (an interest rate market) allows users to supply crypto assets to the protocol, then those assets begin to earn a variable interest. Lenders can withdraw their principal amount plus interest at any time. When a user supplies an asset to the Compound protocol, they receive cTokens (an ERC20 token that is redeemable for the underlying asset in the protocol). Borrowers can borrow from the Compound protocol while using other crypto assets as collateral. For instance, a user holding ETH can supply it to Compound as collateral for a loan in DAI. The borrower will then pay an interest rate and it is this interest that is paid out to lenders.

Other examples of lending platforms include Aave, Cream, bZx, Yield, and Mainframe.

Automated Market Making DeXs

Decentralized exchanges have become the face of DeFi as headlines of DeXs inching closer to the market share of centralized exchanges hits the headlines. Before Uniswap, decentralized exchanges were known for their limited liquidity and even lower trading volumes. The automated market-making protocol has since transformed DeXs and now they are designed with incentives that produce liquidity as traders flock to venues with high liquidity and low fees. An automated market maker is a smart contract (or a collection of smart contracts) that runs the entire DeX. Uniswap’s AMM protocol for instance relies on a series of smart contracts that automate price matching, exchange of one token for another, and determination of gas fees based on the input data from oracles.  Other examples of DeXs include DODO, Curve, bZx, Bancor, BlackHoleSwap, PancakeSwap, BakerySwap, and many more.

Protocol aggregators

A protocol aggregator in DeFi is a platform that searches through all the lending and staking DeFi applications including the DeXs and pulls the best prices across the DeFi landscape and presents it on one platform for the user to optimize their trading and liquidity mining strategy. Without a protocol aggregator, you would have to look through all the DeXs and their various liquidity pools to find the best deal with the least fees and most returns. Furthermore, for traders looking to deploy algorithms in their trading or liquidity mining strategy, a protocol aggregator helps speed up and automate the process. Aggregators also help users compare and combine strategies. The most popular protocol aggregators at the moment include Yearn Finance, ParaSwap, Benchmark, APY Finance, Auto Finance, Harvest Finance, and Rari Capital to mention only a few.

Prediction markets

DeFi prediction markets use multiple oracles to capture knowledge about a particular event in the world. That data is then uploaded to a smart contract that issues out rewards and deducts losses based on the outcome of the bet. For instance, if there is a match between two teams, a user will deposit funds to a prediction market with a given set of odds. If the user’s predictions are right, the smart contract will immediately disburse the rewards to the user’s wallet. A few examples of DeFi applications that offer predictions markets include augur, Gnosis, Omen.eth, and Polymarket.

Derivatives markets

As the name suggests, a derivative simply derives its value from an underlying asset. For instance, developers can create a token that derives its value from the stock exchange tracking the value of stocks such as Apple or Tesla. Therefore, anyone who doesn’t have access to these assets can still get exposure by trading these derivatives as opposed to the actual asset. By using smart contracts to create the derivatives, a new layer of complexity can be added to the derivatives allowing for different possibilities including futures trading, Collateralized Debt Obligations (CDO), Forwards, Options trading, and so forth. Synthetix is one of the most popular platforms for the derivatives market and other examples include Opyn, DerivaDeX, Pods, Primitive, and BarnBridge.


Similar to insurance in traditional finance, DeFi insurance protects the insured in return for a specific premium. A premium is a periodic amount paid by the insured for the risk covered by the insurer. Unlike traditional insurance, DeFi insurance is not underwritten by a centralized multinational insurer. Instead, the insurance policy is democratized whereby a community dictates a premium and orchestrates pay-outs. Therefore, the community-driven DeFi insurance platform will make a decision that will be recorded and enforced by smart contracts and only members can decide which claim is valid or invalid.

 Currently, most of the insurance products on offer include coverage for smart contract exploits. Given that the entire DeFi space is untested, and the fact that smart contracts are heavily involved, any potential loophole in the code of the smart contract can lead to a loss of funds. Therefore, DeFi enthusiasts will get a cover whenever they deal with a risky project that is likely to be exploited. Examples of companies offering this solution include Nexus Mutual, Opium insurance, and Cover Protocol.

Risks of DeFi applications

While DeFi has many profit opportunities, the sector’s existence within a young emerging crypto industry means most of its products and solutions are untested. As a result, DeFi poses significant risks to users ranging from the risk of volatile asset prices to the risk of composability and even regulatory risks.

The risk of Composability

Composability is the capacity of an asset’s resources to be used by developers as a building block for other higher-order applications. Composability is an important aspect especially for programmers and developers as it allows them to achieve more with far less, eventually escalating into a series of rapid compounding sets of innovations. While DeFi shows a high capacity for composability given the fact that resources from one platform such as Ethereum can be used to build and develop higher-order applications, there is a high risk involved as innovations compound. The fact that the DeFi ecosystem is highly interconnected and at such deep levels means a failure in any part of the ecosystem could lead to a devastating collapse of the whole. For example, the failure of a stablecoin like USDT that is used on many DeFi applications will affect the whole DeFi space.

Impermanent loss

Impermanent loss is one of the biggest risks of liquidity mining on AMM DeXs. It refers to the temporary loss of funds that a liquidity provider experiences whenever volatility hits one of the assets paired in the liquidity pool. For example, if you are a liquidity provider who provides liquidity in a pool of asset A paired to asset B, and the price of asset B goes down or up faster than the price of A, you will end up with less of asset B and more of asset A as the smart contract will adjust the value of your liquidity to fit the new price in the market.

This phenomenon occurs as a result of the constant product automated market-making protocol used on most DeXs. The AMM protocol requires that a user deposits equivalent values of both assets in a liquidity pool. That means a user looking to mine liquidity on Uniswap, for instance, will deposit 5 ETH and 10 BNB in a pool where total liquidity is programmed to retain a constant value of $10,000.

The constant product formula of the AMM protocols will adjust the amount of ETH and BNB in the pool to maintain a constant in an equation where X amount of ETH multiplied by X amount of BNB should always be equal to a constant.

Therefore, when the price of one asset in the pair changes, the ratio adjusts accordingly. For an AMM that maintains constant liquidity of $10000, a user who bought the 5 ETH at $1000 and 10 BNB at $500 will be at a loss if ETH’s price went up to $2000 per ETH. The AMM protocol would adjust the ratio of ETH to BNB in the pool such that the user would now have 2.5 ETH and 10BNB.

If the user had not provided liquidity, that user would still have the 5 ETH now priced at $2000 each.

DeFi Rug pulls

DeFi rug pulls are popular and are a type of scam where a project’s promoter will drain the liquidity of a market leaving liquidity providers holding a bag of worthless tokens of an abandoned project. While decentralized exchanges are popular for their lucrative incentives, they are also known to be proliferated by rug pulls.

DeXs such as Uniswap and SushiSwap are open-source therefore anyone can list a project and pair that project’s token to a popular cryptocurrency such as ETH. The promoter will then move to crowdsource liquidity for that project. Once the project has sufficient liquidity, the promoter of the project will swap or exchange a huge amount of the token’s project he created for ETH thereby draining all the ETH from the liquidity pool. A few examples of rug pulls include Compounder Finance where $10.8 million of liquidity provider’s funds was stolen.