Intro to DeFi Lending Protocols

TL;DR; DeFi lending protocols that power many of today’s yield farming ventures are considered a relatively safe and tested way to make extra income on crypto-assets. With interest in these protocols on the rise, we thought it’s an excellent time to provide a more detailed write up to help people choose the right lending protocol. This introductory guide compares popular lending platforms on Ethereum based on APR, fees, and security and explains some important fee considerations.     

DeFi lending protocols allow anyone to become a lender and make a profit without going through KYC, and unlike a centralized exchange, no custodian can disappear with all the funds. 

While no investment is ever risk-free, it’s good to know that many DeFi lending protocols have been running for quite some time, without any major incidents. They have proven quite resilient, with some protocols surviving highly volatile markets, all while providing ~5% APR on investments.

Where does the interest come from?

Before we compare popular lending platforms and delve into the key considerations when choosing a lending platform, it’s essential to first understand where the interest you’ll earn comes from. In the case of lending protocols, the interest comes from the borrowers. 

Each lending protocol also offers the option to borrow supported assets with borrowers paying back their loans with interest. These repaid interstate funds are paid to the lenders. Usually, there are more lenders (aka liquidity suppliers) than borrowers, and thus the interest rate for borrowing is higher.   

How to choose a DeFi lending platform

There is no one right answer when it comes to choosing a DeFi lending protocol. The modus operandi of popular protocols like AAVE, Compound, and dYdX is more or less the same, so it mainly comes down to risk, reward, and individual needs. With this in mind, here are some critical considerations to take into account. 

Comparing APR

Probably the first topic to come up in conversation when discussing lending protocols pertains to the expected yield. In other words, people want to know what APR (Annual Percentage Rate) is offered by the protocol for deposited funds. 

The APR determines how much income can be expected in a year if nothing else changes. The problem is the APR in DeFi protocols is highly volatile. In general, APR is determined by the ratio between the funds lent to the pool and the funds borrowed (the pool’s utilization). If a high percentage of the pool is borrowed, the interest goes up, incentivizing lenders to add liquidity to the pool and disincentivizing borrowers to take loans at high rates. 

This ratio between lenders and borrowers can change with very high frequency, day by day, and even block by block. For example, the APR of BAT token on the BAT protocol went from 0% to 27% and back to 0% in just a few days due to the introduction of the Compound COMP governance token.

BAT Interest Rate (APR): from 0% to 27% and back to 0% (source: compound

The following APRs were recorded at the time of writing. But these are likely different now.

APRToken   
ProtocolDAIETHUSDCUSDT
AAVE4.14%0.08%1.07%2.22%
Compound3.48%0.16%2.22%2.62%
dYdX2.30%0.09%5.60%N/A

As can be observed, the APR changes from protocol to protocol and from asset to asset, even in highly correlated assets such as stablecoins (DAI/USDC/USDC should all be pegged to 1 USD).

A somewhat better approach is to track the APR over time. Compound offers a historical data chart of every asset on the platform on their website. Of course, historical data cannot help predict the future, but it can provide a better approximation of what to expect. (Check out defirate.com and loanscan.io, which also display APR historical data for various protocols and assets.)

DAI APR on various platforms, past 30 days (source: loanscan)

Transaction costs and gas fees

As you may already know, each transaction on Ethereum has a fee paid to miners for keeping the network secure. The cost of each transaction in USD depends on three main factors:

  • Gas Amount: This is the complexity of the computation. The more complex the smart contract, the more gas is required to complete each transaction.
  • Gas Price: The more demand there is for transactions, the higher the price. Each block’s space is limited, so it will cost more if a transaction needs to be included.
  • ETH Price: Gas is paid in ETH. If ETH goes up, transactions become more expensive.
`GasAmount * GasPrice * EthPrice = transaction fee`

Gas and ETH price have nothing to do with the protocol. These are determined by the demand for ETH and transactions on the Ethereum blockchain.

The gas amount (or gas limit) required to use a platform varies from protocol to protocol, token to token, and whether the transaction is depositing or withdrawing from the protocol.

Given the gas amount required, the way to derive the transaction price is by multiplying the amount by the gas and ETH price. To fairly compare AAVE, Compound, and dYdX protocols, we looked at both a single transaction of depositing to the protocol and the average gas amount required for a transaction from the Ethereum transaction history.

USDToken       
 DAI ETH USDC USDT 
ProtocolLendWithdrawLendWithdrawLendWithdrawLendWithdraw
AAVE5.8912.895.3911.846.0713.8465.9517.62
Compound10.848.534.848.446.646.846.246.24
dYdX4.8225.446.356.135.194.39N/AN/A
Displayed Transaction Cost per protocol per asset 

The table represents the typical transaction cost seen in a wallet (in USD) when the gas price is 50GWei per unit of gas, and the price of ETH is 400$ USD.

The protocol dYdX stands out with the lowest transaction price for all assets for both lending and withdrawal. Compound has about the same transaction price for Lending ETH, while AAVE has significantly higher withdrawal costs for all assets. 

Prices displayed by wallets are usually a slight overestimation of the real gas amount required to successfully complete a transaction. To get a more accurate estimation, we looked at the historical gas limits of translation for all three protocols, for popular tokens. A full summary of the results is available in our dashboard on Dune Analytics (requires opening an account). Here are some highlights from the analysis:

Lending DAI is most expensive on Compound (300K gas) and cheapest on dYdX.

The table displays the averaged gas amount required in a month:

USDToken       
 DAI ETH USDC USDT 
ProtocolLendWithdrawLendWithdrawLendWithdrawLendWithdraw
AAVE237854519348226521542664248527584527254803219181
Compound302016327759157460285657199247264291187039195977
dYdX183071195053216387217874188784210934N/AN/A
Summary of gas costs over the past month
USDToken       
 DAI ETH USDC USDT 
ProtocolLendWithdrawLendWithdrawLendWithdrawLendWithdraw
AAVE4.7510.384.5310.854.9411.695.094.38
Compound6.046.5583.1425.713.985.283.743.91
dYdX3.663.904.324.353.774.21N/AN/A
Gas cost converted to USD, GasPrice=50GWei, ETH=$400

AAVE stands out as the most expensive protocol to use in most cases, relative to the other lending protocols. dYdX is the most consistent protocol, where gas demands are somewhat similar for both supplying and withdrawing liquidity for most available assets. Compound is better optimized for supplying ETH and is cheaper than AAVE when it comes to USDT (USDT is not available on dYdX). 

Running the numbers

When deciding if lending is the right move for you, one needs to do the math. Making the right decision depends on the current APR of each protocol, the current market prices, how long funds are locked up, and whether there is a minimum amount required for deposit.

For example, let’s say we want to deposit USDC on dYdX because it requires the least fees and gives the highest current APR. Assuming APR is constant at 5%, ETH price is steady at $400, and network congestion sets gas prices at 50GWei per gas unit. First, we calculate the gas fees for deposit and withdrawal. 

The sum of gas required to deposit and withdraw USDC from dYdX, according to the table is:

188,784 + 210,934 = ~400,000

Multiplying by 50Gwei (50*10^-9 ETH) and a price of $400 per ETH we get: $8.

Taking these fees into account means we should deposit at least X * 0.05 > $8, which works out to $160 to break even after one year for this trade to make financial sense. Of course, all of these parameters can change. Gas prices are highly volatile, and ETH prices and APR change daily. The plus side is gas fees have almost no relation to the amount lent. The fee for depositing $100 or $100,000 is virtually the same.  

Security

Security is a critical factor when choosing a protocol. The fact that all DeFi protocols run on a blockchain doesn’t mean they are inherently safe. At the end of the day, the smart contracts powering these protocols are just software, and any piece of software can have bugs that lead to a loss of funds and the complete dissolution of the protocol. 

The recent example of the bZx Fulcrum platform, which lost $350K of user funds due to a bug in the contract, is a cautionary tale with valuable lessons. The protocol was temporarily paused, and no deposits or withdrawals were possible. (Sidenote: The CEO of Compound criticized the bZx platform for plagiarizing the Compound codebase without fully understanding its implications.)

Like any financial service, it’s critical to check if a lending platform is well regarded and reliable. AAVE, Compound, and dYdX all underwent audits by respectable firms. Some of them were audited more than once. While an audit isn’t a security guarantee as code can still be defective, the lack of an audit should raise suspicions about the protocol’s maturity.

Other essential security factors to consider are whether or not there is a single entity controlling the contracts, who holds the keys, and whether the service guarantees a refund if funds are lost. These parameters can sometimes be hard to establish, but that shouldn’t stop users from conducting thorough due diligence. This is especially true for those depositing large amounts.

Recently, Gauntlet, along with Defipulse, launched a security index for Compound and AAVE. The security index is based on an in-house simulation performed by Gauntlet, simulating various market and network conditions. Its purpose is to determine the likelihood that the protocol will remain solvent, even in the face of harsh conditions as seen on Black Thursday. This is not a constant number and does not encompass all the protocol’s risk factors, but it can be used as another tool when making an investment decision.  

Supported assets

Not all platforms support the same range of tokens. dYdX, which excelled in gas fees in our test, only supports USDC, DAI, and ETH. AAVE and Compound support a much more comprehensive range of tokens. For example, lending the UNI token is currently only available in Compound. Similarly, for KNC, AAVE is the only option.

On Zengo, we have recently added several leading DeFi tokens to our list of supported assets, including the aforementioned AAVE, UNI, (also available for purchase and trading), and KNC tokens. The Compound protocol is natively integrated into Zengo Savings. All of the assets supported by Compound can be used in savings, simply and securely, with the added benefit of earning COMP tokens.

Yearn, the lending yield aggregator

This overview would not be complete without mentioning Yearn, a new project garnering lots of excitement. Yearn is a protocol developed by Andre Cronje, a veteran smart contract developer. Yearn’s YFI token was also recently added to Zengo’s list of supported assets.

The protocol was initially born as a lending yield aggregator that helps maximize the APR earned on various DeFi lending platforms. Instead of manually switching between platforms, Yearn operates as a single pool (per token) where all the pool funds are deposited in the protocol with the highest APR.

Every time a user interacts with the protocol, by either lending or withdrawing, the Yearn contract checks the APRs available on all enabled platforms (dYdX, Compound, and AAVE at the time of writing). If the highest APR is available on a different platform from the one currently in use, all funds are withdrawn and moved to the more lucrative platform.  

Funds in the Yearn contract are moved between protocols

Since the first generation of Yearn, the architecture has changed, but the principle remains the same. Put funds in a single pool, and let the contract decide where these funds will make the best returns. 

We’ll likely cover Yearn more extensively in the future, but it’s important to note that the added contract adds another level of complexity and layer of risk. It’s up to the investor to decide if they wish to take on this additional risk. What’s more, because Yearn is an aggregator, the fees for interacting with it might also depend on the current underlying protocol in use and the added complexity of the contract itself. 

Summary & takeaways

Lending protocols are a great way to earn a steady income on crypto assets without taking crazy risks. However, everyone must conduct their own due diligence to protect themselves and get the most from an investment. It’s critical to always:

  • Look at the historic APR values paid by the protocol. While not constant, they are still an important indicator.
  • Consider how much is invested and for how long. Although funds can be withdrawn at any time, withdrawal costs and fees can be quite expensive.
  • Consider the security of the protocol and the reputation of its operators.

With gas fees higher than usual in the past few months and network usage looking like it’s only going to rise as more protocols launch, it makes sense to invest relatively large amounts. 

** This post is for general information purposes only. It does not constitute investment advice or a recommendation or solicitation to buy or sell any investment and should not be used in the evaluation of the merits of making any investment decision. It should not be relied upon for accounting, legal or tax advice, or investment recommendations. This post reflects the current opinions of the authors and does not necessarily reflect the opinions of ZenGO, its affiliates, or individuals associated with Zengo. The opinions reflected herein are subject to change without being updated.