Curriculum
Course: Coins & Exchanges
Login

Curriculum

Coins & Exchanges

Video lesson

DeFi Lending & Borrowing

Lending and Borrowing in DeFi

Lending and borrowing have long been cornerstones of our financial systems, enabling both personal growth and economic development through loans and interest. With the rise of decentralized finance (DeFi), these concepts transition into a world of blockchain technology, providing novel opportunities for users like you to engage with your assets in ways that traditional finance could only dream of. This lesson explores how lending and borrowing work in DeFi, comparing popular protocols such as Aave and Compound to traditional financial systems for a well-rounded understanding of this intriguing landscape.

Core Concepts

  1. Lending and Borrowing
    In traditional finance, lending and borrowing involve a financial institution facilitating transactions between depositors (lenders) and borrowers (loan takers). You might recognize this through personal experiences with student loans or mortgages. In the DeFi realm, these transactions happen on decentralized platforms without intermediaries, allowing you to retain full custody of your assets while participating in lending and borrowing.

  2. Money Market
    Money markets in traditional finance provide access to short-term loans and instruments like Treasury bills. DeFi builds upon this idea, offering users similar services through decentralized protocols like Aave and Compound, where lending and borrowing occur in a permissionless manner.

  3. Over-Collateralization
    In DeFi, loans are generally over-collateralized, meaning you need to deposit an amount worth more than the loan for security. While it might sound puzzling to provide collateral that exceeds your loan, it helps mitigate the risk of defaults and protect the system. This practice contrasts with traditional banks, which often rely on credit scores to determine lending eligibility.

  4. Liquidity and Collateral Factor
    The amount that can be borrowed in DeFi depends on available funds in the markets and the collateral factor—essentially a risk adjustment metric for the asset you’re using as collateral. Understanding the collateral factor is vital for determining how much you can borrow, limiting the risk of liquidation.

  5. APY (Annual Percentage Yield)
    The interest earned by lenders and paid by borrowers in DeFi is often variable and calculated with stunning frequency—per Ethereum block! Learning how APYs fluctuate based on supply and demand is crucial for navigating the lending landscape. This mirrors traditional finance but at a much quicker pace.

  6. C Tokens and A Tokens
    In platforms like Compound and Aave, when you supply assets, you receive “”C tokens”” or “”A tokens”” respectively. These serve as interest-bearing tokens, which can be redeemed later. Understanding how these tokens interact with your underlying assets is vital in maximizing your returns.

  7. Market Risks
    DeFi may minimize risks associated with traditional finance, but it isn’t without challenges. Understanding market volatility, smart contract risks, and rapidly changing APYs is essential for navigating this exciting but risky territory.

Key Steps

Understanding the Mechanism of Lending in DeFi

  • Lenders supply funds in tokens.
  • Interest rates are determined by supply/demand ratios.
  • Tokens are converted to C or A Tokens, accruing interest over time.

Lending in DeFi starts with you supplying tokens that are converted into interest-bearing format through protocols like Aave or Compound. As the supply of tokens fluctuates with user demand, so do the corresponding interest rates—this dynamic nature emphasizes the importance of keeping an eye on market activity.

Borrowing from DeFi Protocols

  • Utilizing collateral for loans.
  • Understanding collateral factors.
  • Maintaining a check on your loan-to-value ratio.

When borrowing, you lock your C or A tokens as collateral to secure the funds. These assets allow you to borrow other tokens but monitoring your collateral value against market fluctuations is crucial to avoiding liquidation.

The Nuance of Interest Rates

  • Variable vs. stable APYs offered by protocols.
  • Calculating potential interest accrued.
  • Monitoring daily fluctuations of APYs.

Interest rates in DeFi are not static—by learning to track them, you can adapt your strategies. Aave’s stable APY feature offers a different strategy from Compound, as it gives you some predictability amidst the chaos.

Understanding Liquidation Risks

  • Thresholds for under-collateralization.
  • Tokens are sold off when collateral dips below certain values.
  • Market impact during extreme volatility.

Liquidation is a harsh reality in the decentralized landscape. You need to be attentive to market movements, maintaining sufficient collateral to safeguard against sudden drops in the value of your assets.

Blockchain Lending

Lending and borrowing in DeFi represents a paradigm shift from traditional finance by eliminating intermediaries and fostering true asset ownership. For instance, Compound and Aave mirror the services of banks but operate on smart contracts which allow more transparency and efficiency while minimizing risks associated with custodianship—as well as opening exciting doors for innovation.

Real-World Applications

Consider a historical context: DeFi lending emerged post-2017 when Ethereum gained traction as a platform for decentralized applications. In 2020, we saw yields soar during yield farming trends, impacting both access to funds in traditional finance and innovative lending mechanisms in crypto, shifting paradigms and user expectations.

Challenges and Solutions

Among common challenges faced in DeFi lending:

  • Smart contract vulnerabilities
  • Volatility of interest rates
  • User awareness around liquidation risks

Solutions can include diversifying your holdings, spreading your collateral across multiple protocols, and employing risk management strategies to mitigate liquidation risks. Tackling misconceptions about the safety of DeFi can help newcomers embrace this more innovative financial model without fear.

Key Takeaways

  1. Lending and borrowing are accessible and decentralized in DeFi: Transform traditional finance’s loan application into a simple blockchain transaction.
  2. Understanding over-collateralization is critical: This principle safeguards against defaults but can be counterintuitive to traditional borrowing norms.
  3. APYs fluctuate rapidly: Staying agile and informed helps you capitalize on market conditions.
  4. Liquidation poses a real risk: Always know your collateral value compared to borrowed amounts to avoid unexpected losses.
  5. Market awareness is paramount: Keep an eye on market dynamics and protocol updates to make informed decisions.

As you navigate through DeFi loans, consider employing tools and platforms that offer analytics to track your assets and market conditions seamlessly.

Discussion Questions and Scenarios

  1. How do the risks associated with DeFi lending compare to those you encountered in traditional lending?
  2. What strategies can you adopt to manage the inherent volatility of APYs in DeFi?
  3. Imagine a scenario where your collateral value drops suddenly—how would you approach this situation?
  4. Discuss the pros and cons of decentralized lending versus traditional banking systems.
  5. If you were to choose between Aave and Compound, what factors would you consider in your decision-making process?
  6. Reflect on potential regulatory implications that could arise with the widespread acceptance of DeFi protocols.

Glossary

  • Lending and Borrowing: The act of providing or receiving funds, where lenders receive interest and borrowers repay the amount borrowed.
  • Money Market: A sector of the financial market that specializes in short-term borrowing and lending.
  • Over-Collateralization: A practice requiring borrowers to deposit collateral worth more than the loan.
  • APY (Annual Percentage Yield): A measure of interest earned on deposits, including compounded interest, expressed as a percentage.
  • C Tokens and A Tokens: Tokens received in DeFi platforms (Compound and Aave) that represent the value of deposits plus interest owed.

This lesson encapsulates the thrilling and dynamic nature of lending and borrowing in the DeFi space while bridging essential concepts of traditional finance.

Continue to Next Lesson

Ready to dive deeper into the world of decentralized finance? Let’s continue exploring the exciting components of Crypto Is FIRE (CFIRE) training in the next lesson!

 

Read Video Transcript
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.