Lending And Borrowing In DEFI Explained – Aave, Compound
https://www.youtube.com/watch?v=aTp9er6S73M
Transcript:
So, have you ever been wondering how lending and borrowing works in DeFi? How are the supply and borrow rates determined? And what is the main difference between the most popular lending protocols, such as Compound and Aave? We’ll answer all of these questions in this video. Before we begin, if you want to learn more about Decentralized Finance and the technology behind it, make sure you subscribe to my channel.
You can also check out our free guide to defy that i will link in the description box below let’s start with what lending and borrowing is lending and borrowing is one of the most important elements of any financial system most people at some point in their life are exposed to borrowing usually by taking a student loan a car loan or a mortgage the whole concept is quite simple lenders aka depositors provide funds to borrowers in return for interest on their deposit borrowers or loan takers are willing to pay interest on the amount
they borrowed in exchange for having a lump sum of money available immediately. Traditionally, lending and borrowing is facilitated by a financial institution, such as a bank or a peer-to-peer lender. When it comes to short-term lending and borrowing, the area of traditional finance that specializes in it is called the money market the money market provides access to multiple instruments such as CDs repos Treasury bills and others in the cryptocurrency space lending and borrowing is accessible either through
DeFi protocols such as other or compound or by S5 companies for instance blockfi or celsius c5 or centralized finance operates in a very similar way to how banks operate this is also why sometimes we call these companies crypto banks blockfi for example takes custody over deposited assets and lends them out to either institutional players, such as market makers or hedge funds, or to the other users of the platform.
Although the centralized lending model works just fine, it is susceptible to the same problems as centralized crypto exchanges, mainly losing customer deposits by either being hacked or other forms of negligence. You can also argue that the CeFi model basically goes against one of the main value propositions of cryptocurrencies, self-custody of your assets.
This is also where DeFi lending comes into play. DeFi lending allows users to become lenders or borrowers in a completely decentralized and permissionless way while maintaining full custody over their coins. DeFi lending is based on smart contracts that run on open blockchains, predominantly Ethereum.
This is also why DeFi lending, in contrast to CeFi lending, is accessible to everyone without a need of providing your personal details or trusting someone else to hold your funds. Aave and Compound are two main lending protocols available in DeFi. Both of the protocols work by creating money markets for particular tokens such as ETH, stablecoins like DAI and USDC, or other tokens like LINK or Wrapped BTC.
Users who want to become lenders supply their tokens to a particular money market and start receiving interest on their tokens according to the current supply APY. The supply tokens are sent to a smart contract and become available for other users to borrow. In exchange for supply tokens, the smart contract issues other tokens that represents the supply tokens plus interests.
These tokens are called C tokens in Compound and A tokens in Aave and they can be redeemed for the underlying tokens. We’ll dive deeper into their mechanics later in this video. It’s also worth mentioning that in DeFi at the moment pretty much all of the loans are over collateralized. This means that the user who wants to borrow funds has to supply tokens in the form of collateral that is worth more than the actual loan that they want to take.
At this point you may ask the question, what’s the point of taking a loan if you have to supply tokens that are worth more than the actual amount of the loan taken? Why wouldn’t someone just sell their tokens in the first place? There are quite a few reasons for this. Mainly the users don’t want to sell their tokens, but they need funds to cover unexpected expenses.
Other reasons include avoiding or delaying paying capital gain taxes on their tokens or using borrowed funds to increase their leverage in a certain position. So is there a limit on how much can be borrowed? Yes, the amount that can be borrowed depends on two main factors. The first one, how much funds are available to be borrowed in a particular market.
This is usually not a problem in active markets, unless someone is trying to borrow a really big amount of tokens. The second one, what is the collateral factor of supply tokens? Collateral factor determines how much can be borrowed based on the quality of the collateral. DAI and ETH, for example, have a collateral factor of 75% on compound.
This means that up to 75% of the value of the supply DAI or ETH can be used to borrow other tokens. If a user decides to borrow funds the value of the borrowed amount must always stay lower than the value of their collateral times its collateral factor if this condition holds there is no limit on how long a user can borrow funds for if the value of the collateral falls below the required collateral level, the user would have their collateral liquidated in order for the protocol to repay the borrowed amount.
The interest that lenders receive and the interest that borrowers have to pay are determined by the ratio between supplied and borrowed tokens in a particular market. The interest that is paid by borrowers is the interest earned by lenders, so the borrow APY is higher than the supply APY in a particular market.
The interest APYs are calculated per Ethereum block. Calculating APYs per block means that DeFi lending provides variable interest rates that can change quite dramatically depending on the lending and borrowing demand for particular tokens. This is also where one of the biggest differences between Compound and Aave comes in.
Although both protocols offer variable supply and borrow APYs, Aave also offers stable borrow APYs, Aave also offers stable borrow APY. Stable APY is fixed in a short term but it can change in the long term to accommodate changes in the supply-demand ratio between tokens.
On top of stable APY, Aave also offers flash loans where users can borrow funds with no upfront collateral for a very short period of time, one Ethereum transaction. More on the flash loans here. To better understand how the DeFi lending protocols work, let’s dive into an example. But before we do that, if you made it this far and you enjoyed the video, hit the like and subscribe buttons so this kind of content can reach a wider audience.
Let’s dive deeper into the mechanics of compound and C tokens. In our example, a user deposits 10 ETH into compound. In exchange for 10 ETH, compound issues C tokens. In this case, C ETH. How many C ETH tokens will the user receive? This depends on the current exchange rate for a particular market, in this case ETH.
When a new market is created, the exchange rate between C tokens and underlying tokens is set to 0.02. This is an arbitrary number, but we can assume that each market starts at 0.02. We can also assume that this exchange rate can only increase with each Ethereum block. If the user supplied 10 ETH when the market was just created, they would have received 10 divided by 0.02 equals 500 C ETH.
Because the ETH market has been operating for a while, we can assume that the exchange rate is already higher. Let’s say it’s 0.021. This means that the user would receive around 476.19 C ETH. If the user decided to immediately redeem their ETH, they should receive roughly the same amount as it was deposited, which is around 10 ETH.
Now here is when the magic happens. The user holds their CETH. This is just another ERC20 token that can be sent anywhere. The main difference is that CETH is necessary to redeem the underlying ETH from compound. On top of that, CETH keeps accumulating interest, even if it’s sent from the original wallet that initiated the deposit to another wallet.
With each Ethereum block, the exchange rate would increase. The rate of the increase depends on the supply APY, which is determined by the ratio of supplied borrowed capital. In our example, let’s say that the exchange rate from CETH to ETH increases by this amount with each block. Assuming that the rate of increase stays the same for a month, we can easily calculate the interest that can be made during that time.
Let’s say on average we have 4 blocks per minute. This gives us the following numbers. Now we can add this number to the previous exchange rate and get the following number that is slightly higher than the previous exchange rate and get the following number that is slightly higher than the previous exchange rate.
If the user decides to redeem their ETH, they would receive around 10.0165 ETH, so the user just made 0.0165 ETH in a month, which is around 0.16% return on their ETH. It’s worth noting that the original amount of CETH that the user received hasn’t changed at all, and only the change in the exchange rate allowed the user to redeem more ETH than was initially deposited.
Aave uses a similar model with interest being accumulated every single block. The main difference is that A token’s value is pegged to the value of the underlying tokens at a 1 to 1 ratio. The interest is distributed to A token holders directly by continuously increasing their wallet balance. A token holders can also decide to redirect their stream of interest payments to another Ethereum address.
When it comes to borrowing, users lock their C tokens or A tokens as collateral and borrow other tokens. Collateral earns interest, but users cannot redeem or transfer assets while they are being used as collateral. As we mentioned earlier, the amount that can be borrowed is determined by the collateral factor of the supplied assets.
There is also a smart contract that looks at all the collateral across user’s account and calculates how much can be safely borrowed without getting liquidated immediately. To determine the value of collateral, Compound uses its own price feed that takes prices from several highly liquid exchanges. Aave, on the other hand, relies on Chainlink and falls back to their own price feed if necessary.
If a user decides to repay the borrowed amount and unlock their collateral, they also have to repay the accrued interest on their borrowed assets. The amount of accrued interest is determined by the Borrow APY and is also increased automatically with each Ethereum block. Different lending, although reducing a lot of risks associated with centralized finance, comes with its own risks.
Marketing although reducing a lot of risks associated with centralized finance comes with its own risks. Mainly the ever present smart contract risks but also quickly changing APYs. For example during the last yield farming craze the borrow APY on the BAT token went up to over 40%. This could cause unaware users who are not tracking compound interest rates daily, to get liquidated by having to repay more than expected in the same period of time.
So what do you think about lending and borrowing in DeFi? And what is your favorite platform? Comment down below. And as always, if you enjoyed this video, smash the like button, subscribe to my channel and check out the cinematics on Patreon to join our DeFi community. Thanks for watching.
Crypto Education – Lending & Borrowing
https://www.youtube.com/watch?v=SrArEE6p3zM
Transcript:
Hi and welcome to a new Cryptomatics episode! If you are interested in being the first to find out when we publish a new video, don’t forget to subscribe and turn on notifications. For the latest news and reviews of the crypto space, you can also find us on our other YouTube channel CryptoRobin. In this video, we will explain what crypto lending and borrowing mean and how they work.
We will also cover their benefits and risks. What are crypto lending and borrowing mean and how they work. We will also cover their benefits and risks. What are crypto lending and borrowing? Lending and borrowing are two of the core elements of any financial system. DeFi and the crypto space make no exception.
Through crypto lending, depositors or lenders provide funds to loan takers or borrowers in return for interest on their deposits. You could think of it as a savings account that puts your money to work and allows you to earn interest. Borrowers, on the other hand, can thus have access to a specific sum of money immediately in return for an interest they pay.
These two processes involve three parties – the lenders, the borrowers, and the lending platform. Interest rates and lending-borrowing conditions vary from one crypto lending platform to another. How much a lender gets in return for their investment depends automatically on the type of platform used.
Centralized and Decentralized Crypto Lending In the crypto area, these two processes can be accessed through centralized finance companies or decentralized finance protocols. CeFi Crypto Lending Centralized crypto lending is a subclass of CeFi and takes place on platforms that work similarly to banks.
Their regulations and infrastructure follow those of traditional finance. They integrate Know Your Customer and Anti-Money Laundering verification, assume custody of customer deposits, and even offer cold storage solutions. The overall process falls under human governance. A few examples of such platforms are BlockFi, Nexo, and Binance.
However, these platforms are susceptible to the same problems as centralized crypto exchanges, such as hacks that could result in the loss of customer deposits. Plus, they act as a custodian. DeFi Crypto Lending By contrast, DeFi lending takes place on decentralized, or peer-to-peer lending protocols. It allows users to lend and borrow in a completely decentralized way, all without giving up custody of their coins.
Since it is based on smart contracts running on open blockchains, DeFi lending is highly accessible. Generally, it offers favorable loan terms for borrowers and more appealing interest rates for lenders. A few examples of such lending protocols include Aave, Compound, and DYDX. How do crypto lending and borrowing work? Simply put, the entire process typically involves the following main steps.
The loan taker chooses a lending platform and requests a crypto loan. Once the loan is accepted, the borrower stakes their crypto collateral, which is higher than the amount they want to borrow. Meantime, the investor funds the loan via the platform for which they receive regular interest.
The borrower can get back their crypto collateral only when they pay off the entire loan. Some platforms even offer flash loans, and you can find out more about them in our video on this topic. Benefits and Risks of Crypto Lending and Borrowing Some of the benefits of crypto lending and borrowing include Low interest rate Borrowers can often get crypto loans at an interest rate below 10%.
Fast funding Once a loan is approved, the borrower can get the funds in just a few hours. No credit check Crypto loans can be issued without the platform running a credit check. Higher yields for lenders compared to a conventional savings account. Crypto lending and borrowing also come with risks, though, such as smart contract risks.
Hackers can exploit the smart contract’s vulnerabilities to steal funds, interest rate volatility, and liquidation. Conclusion Whether they use a DeFi or CeFi lending platform, lenders can increase the productivity of their crypto assets and maximize profits.
Borrowers can also use their cryptos as collateral to get fast and inexpensive loans. However, before engaging in either side of crypto lending, it is of utmost importance to understand both the risks and benefits involved and acquaint yourself with the lending platform before using it. I hope you enjoyed today’s video and if you have other questions about lending and borrowing, don’t hesitate to tell us in the comment section.