How DeFi forces investors to think differently about finance

February 24, 2022

How DeFi forces investors to think differently about finance (desktop).png

At a glance

Decentralized finance is upending how major asset classes are structured and accessed, turning disintermediation into an opportunity for financial services players.

Key takeaways

  • We the three main DeFi protocols: decentralized exchanges (DEXs), lending protocols, and yield farming.
  • We also explain the opportunities they present to investors in the cryptoeconomy.

Written by

  • Coinbase Institutional


There are thousands of DeFi (Decentralized Finance) protocols and new ones are being launched every day, so getting to grips with these investment products can appear daunting. 

In practice, however, there are three main DeFi protocols: decentralized exchanges (DEXs), lending protocols, and yield farming. We will explain each below, along with the profit opportunities they present. 

Once you have understood the basic concepts behind each DeFi sub-sector, it’s easier to understand the basic business models of other DeFi protocols. So let’s review each of the three, including their protocol design and underlying economic frameworks.

The three main protocols

Lending protocols

EXAMPLES: Aave, Compound, MakerDAO

Lending/borrowing protocols such as MakerDAO have been around since 2014, but DeFi didn’t really take off until summer 2020. By 2022, the total market capitalization of the DeFi sector was more than $100 billion.

The Compound lending protocol is closely associated with the start of the current boom, so let’s start there. 

Lending protocols allow anyone to loan digital assets, just as a bank might lend out deposits it receives. Anyone who owns digital assets can use these protocols to transform their funds into the principal for loans. And anyone can borrow the same digital assets at a certain rate of interest for a given period. 

But most people don’t have enough money to be a bank (that’s why we have banks). So how does this work?

Individuals with money to lend don’t give it directly to a borrower. Instead, they deposit in a liquidity pool — this is how DeFi lending protocols such as Compound work. Borrowers withdraw money from the pool and pay it back with interest. Lenders receive their pro rata share of interest collected by the pool — so if you deposit 1% of the liquidity pool, you receive 1% of the interest collected from loans from the pool. 

Lenders’ right to receive interest is represented by a liquidity provider (LP) token that acts as a receipt for a deposit in the liquidity pool. With Compound, these tokens are known as cTokens. So if you deposit ether (ETH) you will receive cETH in return. Lenders can withdraw their liquidity at any time by exchanging their LP tokens for their original deposit, plus accrued interest. In addition to cTokens, lenders (and borrowers) receive a reward in the form of a predetermined daily distribution of the protocol’s governance token COMP. This payment provides an incentive to take part in its money market. 

Lending protocols require borrowers to provide collateral for their loans, usually cryptocurrency such as Ether (ETH). Borrowers can withdraw a certain percentage of their collateral as a loan. For example, if a borrower deposits $2,000 worth of ETH, and the protocol allows them to withdraw up to 50% of their collateral, they can borrow up to $1,000 at interest. 

Since the collateral is cryptocurrency — with greater price volatility than traditional asset classes — it is important to understand the rules regarding collateral liquidation. In most lending protocols, if the value of the collateral drops below a certain threshold, the protocol will automatically liquidate it by selling some or all of it to repay part of the loan (and charging the borrower a penalty). Liquidation can also result if the value of the borrowed asset rises to become worth more than the posted collateral.

Lending protocols have become popular because they allow longer-term holders of digital assets to earn a passive income from their investments. Borrowers may wish temporarily to acquire crypto funds for trading purposes or to pay for goods and services or cover the cost of outgoings. Borrowing also allows holders of digital assets to realise value in fiat form by staking collateral and using the borrowed crypto as collateral to borrow fiat without creating a tax liability. Lenders of digital assets are liable for tax on earned interest.

Whatever the reason, many people are interested in borrowing and lending digital assets — and Maker is currently the largest DeFi protocol, with a TVL of nearly $20 billion. 

Decentralized Exchanges (DEXs) 

EXAMPLES: Uniswap, Curve, SushiSwap, PancakeSwap

DEXs feature a key DeFi innovation — the automatic market maker (AMM). Looking at how traditional financial exchanges work can illustrate how DEXs have reimagined the concept.

In a traditional electronic trading exchange (whether for cryptocurrencies, stocks, bonds, options, commodities, futures, or any other financial product), the platform is a centralized entity managing an order book. This matches buy and sell orders using a matching engine system. 

For example, if you log into your TD Ameritrade account and create an order to buy Google stock at a certain price, the exchange looks for a seller (or sellers) willing to sell the stock at your requested price.

“Market makers” are individuals or institutions that provide a majority of the liquidity (in our example, Google shares) to enable the market to function. As buyers and sellers find each other and deals are made, a market price emerges based on the volume of trades.

In any given trading market, apart from institutional liquidity providers, there is a dynamic at play among “makers and takers”. Takers of liquidity are generally those who initiate a market order — that is, they will take the price available — while makers will set the price they are willing to buy at and wait for their “limit order” to be filled. The maker, the person making the limit order, is giving liquidity to the system. In some centralized exchange systems, makers are rewarded for this by the trading fees structure.

DEXs function completely differently, but still rest on the underlying dynamics between buyers and sellers, and makers and takers. A DEX has no central entity and no order book. Instead of relying on a small number of institutional market makers, DEXs let thousands of individuals contribute the liquidity to create a market for a tradable asset. They do this by creating liquidity pools into which anyone can deposit a given quantity of any tradable asset. 

When a buyer wants some of that asset, they withdraw the required amount from the liquidity pool. The buyer pays a trading fee to the DEX and the liquidity providers receive a proportionate share of the pool’s fees. For example, if your deposits represent 1% of total liquidity in the pool, you will receive 1% of the total fees it collects. All trading takes place through smart contracts that implement the protocol rules and automate the process.

The DEX also pays an additional reward in the form of its native token. For example, liquidity providers on Uniswap receive some rewards in the form of the Uniswap token, UNI. Because your tokens represent only a fraction of the total liquidity pool, you can withdraw your deposit at any time, take your earnings and walk away. When a liquidity provider deposits into a dual-asset liquidity pool and the value of the deposited asset falls, they are subject to an “impermanent loss.”

But without an order book to see what traders are paying for assets, how does the DEX calculate their price? It uses a mathematical formula. 

Most liquidity pools will be made up of a trading pair such as ETH/USDC (USDC is a stablecoin issued by a consortium that includes Coinbase), with a liquidity pool for each token in the pair. By applying a formula known as “constant product,” the product of the two token reserves is kept constant: if there is a withdrawal from one pool, the same amount must be added to the paired pool, thus maintaining the product as a constant.

How DeFi forces investors to think differently about finance (desktop) (1)

After every trade, the multiplied result (product) of each token’s liquidity pool has the same value as before the trade. This product, denoted by C in the formula below, is referred to as the invariant (although when fees are included it does vary, as we shall see).

Here is the basic formula (basic because we have not included fees). X and Y are the reserve balances of the trading pair, and C the product that cannot be changed as the result of a trade.

X * Y = C 

Or to express this with the example tokens we cited:

nETH * nUSDC = C (where n is the number of tokens)

To work out the price of ETH, we simply divide the value of the USDC liquidity pool by the ETH liquidity pool:

ETH price = USDC liquidity pool / ETH liquidity pool

And to establish the size of the ETH liquidity pool

Eth liquidity pool = square root (C / ETH price)

Or for the USDC liquidity pool:

USDC liquidity pool = square root (C * ETH price)

As a working example, let's create an ETH-USDC dual-asset liquidity pool (made up of two pools — one for each asset).

The important property to bear in mind when creating a liquidity pool is that each multiplication factor must be equal. So for simplicity's sake, let’s assume the market price of ETH is 100 and we want to place 10 ETH into the pool.

Using the constant product formula and the "equality" rule, the dual-asset pool would be:

10 ETH (10 * 100 = $1,000) * 1000 USDC (1 USDC = 1$) = 10,000 (10 ETH * 1000 DAI = 10,000) 

Because of the equality rule, if 1 ETH is removed from the pool, then 100 USDC must be added (and vice versa).

Trading will change token prices because it will mean adding to one pool and subtracting from the other. In the example below, let's swap ETH for USDC – note the difference in the size of the pools changes in Step 1 and Step 2. The formula also has the effect of making larger trades (swaps) exponentially more expensive.

ETH price = USDC pool / ETH pool

Step 1: Ethereum price = 1000 / 10 = 100

Swap ETH for USDC:

Step 2: Ethereum price = 1100 / 9 = 122.2 recurring

The X * Y = C formula creates a price curve.

If we add trading fees, then the constant C will increase, because fees are paid to the liquidity pool from which liquidity providers take a share proportionate to the liquidity they provided.

Here's the reworked formula with fees included, using the example of 1 ETH being removed from the pool:

(10 ETH - 1 ETH) * 1,000 USDC + (1 ETH * price + fee) = C

You make profits on DEXs through earning passive income as a liquidity provider and by trading. However, because asset prices are determined by the relationships of dual-asset pools, as described above, the price of an asset on a DEX will vary from the spot price, presenting profitable opportunities for arbitrage, usually by using bots to exploit price differences.

As mentioned above in reference to Uniswap, an important feature of liquidity pools is that when you deposit into one, you receive a liquidity provider (LP) token as a receipt (similar to the LP tokens given to lenders in lending protocols). To withdraw your deposit from the liquidity pool, you exchange your token for a corresponding amount of coins from the pool. The LP token also has its own market value. 

For example, Curve protocol has a liquidity pool called the TriPool that includes three stablecoins (coins designed to maintain a stable market price either by tying their value to a fiat currency, such as the U.S. dollar, or by using a software algorithm, or both): USDT, USDC and DAI. When you deposit in the Curve TriPool, you receive a corresponding amount of its LP token, 3CRV. 

Some DEXs let you stake (lock) your LP tokens in a vault. Locked tokens help the DEX maintain the tokens’ market value. If they're in the vault, they’re not being sold, which would drive the price down, so this reduces circulating supply. Also, keeping more value locked in the protocol helps maintain financial stability, as well as providing the protocol with a supply of LP tokens to pay liquidity providers. In exchange, the DEX pays the staker additional rewards. 

These rewards can be so lucrative that an entire category of DeFi protocols exists solely to collect liquidity provider tokens and find places to stake them for maximum rewards. These DeFi protocols are called yield farms.

Yield farms

EXAMPLES: Convex, Yearn, Harvest

As DEXs, LP reward schedules and trading pairs available for swaps have proliferated, products have arisen that persistently survey all earnings opportunities in real time to maximize yields, often via complex strategies. These DeFi products are known collectively as yield farms.

These trading strategies often involve a “money Lego” approach. This refers to the practice of exploiting a host of DeFi protocols as an interlocking series of trades. 

For example, Curve maintains a liquidity pool in which an LP can deposit funds for Curve to invest on the lending protocol Aave. Curve’s algorithm will continually move the pool’s funds around on Aave, investing in whichever coin has the highest interest rate, maximizing the pool’s rewards. In this pool, you’ve invested in Curve because it’s investing your funds on Aave, seeking to maximize your yield by letting you earn rewards from both Aave and Curve.

In return for depositing funds in the Aave pool on Curve, the LP also receives a corresponding amount of the Curve LP token, a3Crv. An LP can take their a3Crv coins to Convex and stake them on Convex Finance to maximize Curve rewards. (By participating in the large Convex pool, an LP can earn a “Curve boost.”) This can earn additional Convex rewards. 

There are many yield-farming strategies with varying levels of complexity. For example, Pickle Finance has a vault to earn rewards from Curve, Yearn, SushiSwap, and Pickle. Harvest Finance has a vault to earn rewards from Curve, Convex, Lido, and Harvest. 

Yield-farming strategies become very complicated very quickly, so the most sophisticated players control risk through hedging. Perpetual futures contracts can be opened in opposite directions to the yield-farming trades. Once they are familiar with the basic concepts — such as pooling to maximize “boost” rewards, and algorithmic trading to maximize exposure to the highest interest rates on lending protocols — digital asset day traders can find that yield farming can offer viable investing opportunities.

Democratizing finance — but not risk free

These three DeFi categories cover the key concepts and features on offer in this fast-developing sector of the cryptoeconomy. However, DeFi, in its broadest sense, can include tokenization of securities, real estate and other assets, prediction markets, aggregators, staking platforms, and much more.

With opportunities come risks, though. Apart from suffering losses on trades, protocols can be attacked by bad actors exploiting bugs in code to siphon off investors’ funds. DeFi is currently unregulated, so there is no Federal Deposit Insurance Corporation coverage for losses from business failure.

Of course, DeFi investments, like all investments, involve risk. So if you’re excited about DeFi but wonder about the possible downsides, please look at our article on DeFi risks.


Sign up for our insights

Get the latest market insights, developments and updates, direct to your inbox.