Original title: "Popular Science | DeFi Lending Agreement Guide"
Original source: Ethereum Enthusiast
Today, many liquidity mining projects rely on DeFi lending protocols. The DeFi lending protocol is regarded as a relatively safe and mature way to use cryptographic assets to generate income. With interest in DeFi protocols growing, we thought it was time to write an article detailing DeFi lending protocols to help people choose the one that’s right for them. This primer compares popular lending platforms on Ethereum in terms of APR, fees, and security, and explains some important considerations about fees.
The DeFi lending protocol allows anyone to lend money without going through KYC, and it is different from centralized exchanges , it is impossible for the custodian to run away with the money.
Although there is a certain amount of risk in investing, many DeFi lending agreements have been in operation for a while and have not yet happened Major accident. Facts have proved that these lending agreements are already highly resistant to attack, have survived severe market shocks, and can still provide an annualized rate of return of about 5%.
Before comparing the popular lending platforms and discussing the important considerations in choosing a lending platform, we must first know the lending income from where. As far as the lending agreement is concerned, the income from lending comes from the borrower.
Each lending protocol provides crypto asset loans and requires the lender to pay interest on repayment. Interest is paid to savers. Typically, there are more savers (i.e., liquidity providers) than lenders, and thus higher lending rates.
Regarding how to choose a DeFi lending agreement, there is actually no standard answer to this question. Popular protocols such as AAVE, Compound, and dYdX adopt roughly the same model, with the main differences being risks, benefits, and individual needs. From this perspective, some important considerations can be made.
Discussion When lending a protocol, the first topic people talk about is likely to be the expected return. In other words, people want to know how much annualized rate of return DeFi protocols offer savers.
The annualized rate of return determines the expected income of savers in one year under the condition that other conditions remain unchanged interest income. The problem is that the annualized rate of return offered by DeFi protocols fluctuates wildly. Generally speaking, the annualized rate of return is determined by the ratio between deposited funds and loaned funds (that is, the utilization rate of the lending pool). If the utilization rate of funds in the lending pool is high, the deposit rate will rise, incentivizing lenders to inject more liquidity into the lending pool, but it will also discourage many lenders.
The ratio between lenders and savers may change frequently from day to day, or even from block to block . For example, in just a few days, the annualized rate of return of the BAT token on the BAT protocol increased from 0% to 27% due to Compound’s introduction of the COMP governance token, and then fell to 0%.

- BAT annualized rate of return: rose from 0% to 27%, then fell back to 0% (source: Compound)-
At the time of writing, each DeFi lending protocol The annualized yields offered are shown below, but are subject to change.

It can be seen from the above picture , the annualized rate of return varies between different protocols and even between different assets, even for highly correlated assets such as stablecoins (DAI/USDC/USDT are all stablecoins anchored to the US dollar).
A better way is to track the annualized rate of return in real time. Historical data graphs for all assets supported by the platform are available on Compound’s website. Of course, historical data cannot allow us to predict the future, but it can provide us with a good reference. (You can also check out historical annualized yields for different agreements and assets on defirate.com and loanscan.io.)

- DAI annualized rate of return on different platforms in the past 30 days (source: loanscan)-
As we know, every transaction on Ethereum requires a fee to be paid to the miners to secure the network security. The dollar cost of each transaction mainly depends on the following three factors:
gas consumption: represents the complexity of the calculation. The more complex the smart contract, the more gas is required to complete each transaction.
Gas price: The greater the user's demand for transactions, the higher the gas price. The space of each block is limited, so users must pay a higher gas price to have their transactions included in the block.
ETH Price: Gas is paid in ETH. If the price of ETH increases, transaction costs increase.
GasAmount * GasPrice * EthPrice = transaction_fee
< /p>
The price of gas and ETH has nothing to do with the DeFi lending protocol. Both depend on user demand for ETH and transactions on the Ethereum blockchain.
The amount of gas required to use the platform will vary according to different protocols, different tokens, and even deposit and withdrawal Varies from transaction to transaction.
Once the gas consumption is known, multiply the gas consumption by the gas price and ETH price to calculate the transaction price. For a fair comparison of the AAVE, Compound, and dYdX protocols, we calculated the average gas consumption per deposit transaction (lending) and single withdrawal transaction (withdrawal) of each protocol based on the transaction history of Ethereum.

- Wallet display transaction cost (in USD)-< /blockquote>
The above table records the transaction cost (in USD) displayed by the wallet when the gas price is 50GWei and the ETH price is 400 USD .
Whether it is a deposit transaction or a withdrawal transaction, the transaction cost of each asset on the dYdX protocol is the lowest . Compound’s ETH deposit transaction fee is the lowest, and the withdrawal transaction cost of all assets on AAVE is much higher than other transactions.
The price displayed by the wallet usually slightly overestimates the actual amount of gas required for the transaction to succeed. For a more accurate estimate, we looked at historical data on gas cap transactions for several of the more popular tokens on the three protocols. Specific results can be viewed in our data dashboard on Dune Analytics (account required). Some key conclusions are as follows:
DAI deposit transaction fees are highest on Compound and lowest on dYdX.
The table below shows a month to the average gas consumption.
-Average gas consumption of transactions-
- Average gas cost of a transaction in USD when gas price is 50 Gwei and ETH price is 400 USD-
In most use cases, the AAVE protocol is more expensive to use than other lending protocols. dYdX is the most consistent protocol, and the amount of gas consumed for depositing and withdrawing tokens is almost the same. Compound has the lowest cost for ETH deposit transactions, and has lower costs than AAVE for USDT deposit and withdrawal transactions (dYdY does not provide a USDT lending pool).
Calculation
Before deciding whether to participate in lending, you have to do some calculations. You need to make the right choice based on each protocol’s current annualized rate of return, current market price, lock-up time, and minimum pledge requirements.
For example, we want to deposit USDC on dYdX, because of the miner’s fees required for a single transaction The lowest, and the current annualized rate of return is the highest. Assuming that the annualized rate of return is stable at 5%, the price of ETH is stable at $400, and the price of gas reaches 50 GWei due to network congestion. First, we calculate the gas fees for deposit and withdrawal transactions.
According to the table data, the total amount of gas required to deposit and withdraw USDC on dYdX is:
188,784 + 210,934 = ~400,000 Gas
The known price of ETH is 400 USD, multiply the total amount of gas by 50GWei (50*10^-9 ETH) to get:
50*10^-9 ETH/GAS * 400,000 GAS * 400 $/ETH = $8
Considering the handling fee, we should lend at least X*0.05 >$8, which is $160, in order to guarantee the return in one year. Of course, these parameters are subject to change. Gas prices are highly volatile, and ETH prices and annualized yields also change daily. The good thing is that the gas fee is almost independent of the amount of funds deposited. The fees charged by the Ethereum network are the same whether you deposit $100 or $100,000.
Security
Security is the protocol of choice important factor of time. Running on the blockchain does not mean that these DeFi protocols are absolutely safe. At the end of the day, all these contracts that make the protocol work are just software, and any software can have bugs that can lead to the loss of user funds or the complete breakdown of the protocol.
A recent example is the bZx Fulcrum platform, where users lost $350,000 due to a contract bug. When the event occurs, the protocol can only be suspended completely, with no withdrawals or deposits allowed. (Interlude: At that time, the CEO of Compound criticized the bZx platform for plagiarizing Compound's code with half-knowledge.)
With all Like other financial services, as a user, it is necessary to know whether these lending platforms have accumulated good reviews and are reliable. AAVE, Compound, and dYdX have all undergone code audits by reputable security firms. Several platforms also received more than one audit. While auditing is not a guarantee of security, as the code may still be flawed, if it is not audited, then the reliability of the protocol will be a question mark.
Another important security factor to consider is whether a single entity controls these contracts, who holds Is there a control key, is there a refund service if funds are lost. Sometimes these factors are difficult to fully understand, but users should not give up due diligence in this regard. This is especially true for users with large savings.
Recently, Gauntlet and Defipulse launched A safety index was developed, firstly analyzing Compound and AAVE. The security index is based on internal simulations performed by Garuntlet, simulating various market scenarios and network scenarios. The purpose of the Safety Index is to determine the likelihood that each protocol will remain solvent (even after a challenge as severe as "Black Thursday"). This index is not a constant number, nor does it take all risk points into consideration, but it is also a useful tool when making investments.
Not all platforms support the same variety of tokens. In our tests, dYdX was the best performer in terms of fees, but it only supports USDC, DAI, and ETH. The types of tokens supported by AAVE and Compound are larger and more comprehensive. For example, UNI token can be borrowed on Compound now, but if you want to borrow KNC, you can only borrow it on AAVE.
At ZenGo, we have recently added several well-known DeFi tokens to our list of supported assets , including the above-mentioned AAVE, UNI (users can also buy and trade) and KNC tokens. ZenGo Savings also integrates the Compound protocol, so all assets supported by Compound can be used in Savings, which is very simple and safe, and you can also earn COMP tokens.
Finally, this guide would not be complete without Yearn. Yearn is a set of protocols developed by veteran smart contract developer Andre Cronje, which has brought many surprises to everyone. Yearn’s YFI token was also recently added to ZenGo’s list of supported assets.
When the agreement was first born, it appeared as a yield aggregator of the lending agreement. It is to help users maximize the annualized rate of return on savings on different DeFi lending platforms. Instead of switching savings platforms manually, it puts all funds into one pool (one pool for each token), and then invests all funds in the platform that can generate the highest rate of return.
Every time a user interacts with Yearn, whether TA deposits or withdraws money, the Yearn contract will check once The annualized rate of return on savings for each platform (at the time of writing, Yearn covers dYdX, Compound, and AAVE). If the platform that can generate the highest rate of return is different from the platform where the funds in the pool are currently located, all funds will be withdrawn and transferred to a more profitable platform.
- Funds in the Yearn contract will be transferred between protocols-
The structure of Yearn has changed compared to when it was first born, but the principle is the same: put all funds in a pool , let the contract decide where the money should be put to generate income.
In the future, the coverage of Yearn may be wider, but it needs to be reminded that each additional contract will An extra layer of complexity and risk. Moreover, because Yearn is an aggregator, the transaction fee for interacting with it also depends on the underlying protocol used and the complexity of the added contract itself.
Lending protocols are a great way to use cryptocurrency assets to obtain stable income without taking a lot of risk. Still, everyone must do their own due diligence to protect their assets and get the most out of their investments. So, be sure to maintain the following habits:
Know the historical value of the annualized rate of return paid by the agreement. While this value is unlikely to be stable, it is still an important indicator.
Think about how much money and how long you want to invest. While you can withdraw funds at any time, withdrawal fees can be prohibitively high.
Know the security of the protocol and the reputation of the operator.
The transaction fee rate has been high for the past few months, and the network usage seems to only increase with the More agreements are released and the tide rises, so it is more cost-effective to invest a large amount at one time.
Original text link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia