Lending And Borrowing In DEFI Explained - Aave, Compound
Summary
TLDRThe video explains decentralized finance (DeFi) lending and borrowing protocols like Aave and Compound. It covers how lenders supply assets to earn interest while borrowers lock collateral to take loans, with interest rates set algorithmically based on supply and demand. It details the risks and incentives around overcollateralized loans. Finally, it compares the variable rate models of Compound and Aave, noting Aave's added stable rate option, and advises users to monitor rapid rate changes that could trigger liquidations.
Takeaways
- ๐ป Lending and borrowing in decentralized finance (DeFi) is facilitated through smart contracts, allowing users to lend or borrow assets without a central authority.
- ๐ DeFi lending platforms like Aave and Compound create money markets for various tokens, enabling users to supply tokens to earn interest or borrow against their holdings.
- ๐ฐ Interest rates in DeFi lending are determined by the supply and demand dynamics within each platform's ecosystem, with rates being variable and calculated per Ethereum block.
- ๐งฑ Most DeFi loans are over-collateralized, requiring borrowers to provide more value in tokens as collateral than the amount they are borrowing, to mitigate the risk of default.
- ๐ธ Compound and Aave offer unique features; Compound uses cTokens for interest accrual, while Aave offers stable borrow rates and flash loans, highlighting the diversity in DeFi lending solutions.
- ๐ The collateral factor in DeFi lending dictates how much a user can borrow based on the value of their collateral, affecting the borrowing limits and the risk of liquidation.
- ๐ณ Centralized finance (CeFi) platforms like BlockFi operate similarly to traditional banks but are prone to the same risks, such as hacking or mismanagement of funds.
- ๐ต DeFi lending platforms aim to offer an alternative to traditional and centralized finance by providing transparency, security, and accessibility without requiring personal information.
- ๐ Smart contract risks and rapidly changing interest rates pose significant challenges in DeFi, requiring users to stay informed to avoid potential liquidations or losses.
- ๐น Aave's introduction of stable APYs and flash loans, alongside Compound's dynamic interest accrual mechanism, showcases the innovation and user-centric features available in DeFi lending.
Q & A
What are the two main elements of any financial system that lending and borrowing enables?
-Lending and borrowing enables the two main elements of any financial system - lenders providing funds to borrowers in return for interest on their deposit.
How does decentralized finance (DeFi) lending allow users to participate in lending and borrowing?
-DeFi lending allows users to become lenders or borrowers in a completely decentralized and permissionless way, while maintaining full custody over their coins through smart contracts.
What are the two main DeFi lending protocols mentioned in the script?
-The two main lending protocols available in DeFi mentioned are Aave and Compound. Both create money markets for tokens like ETH, stablecoins, and other cryptos.
Why would a user want to take a loan by supplying collateral worth more than the loan amount?
-Reasons include not wanting to sell their tokens but needing funds for expenses, avoiding/delaying capital gains taxes, or using the borrowed funds to increase leverage on a position.
How are interest rates determined in DeFi lending protocols?
-Interest rates are determined by the ratio between supplied and borrowed tokens in a market. Rates can change dramatically depending on lending/borrowing demand.
What is the main difference between Compound and Aave when it comes to interest rates?
-The main difference is that Aave offers stable interest rates in addition to variable rates like Compound. Stable rates are fixed short-term.
How does supplying and borrowing assets on Compound work?
-Users deposit tokens to Compound and get cTokens which accumulate interest. cTokens can be used as collateral to borrow other tokens. Borrowed assets accrue interest paid to lenders.
What risk comes with the concept of overcollateralized loans in DeFi?
-If asset prices drop, borrowers can get liquidated by having to repay more than expected as their collateral value falls below the loan amount.
How does Compound determine how much a user can borrow?
-Compound uses a smart contract that calculates borrowable amount based on collateral across a user's account without risking immediate liquidation.
What are the main risks of decentralized finance lending?
-Risks include smart contract risks and quickly changing interest rates potentially causing liquidations.
Outlines
๐ Introducing decentralized lending and borrowing
The paragraph introduces the concepts of lending and borrowing, explaining how they work traditionally through financial institutions and how decentralized finance protocols like Aave and Compound enable lending and borrowing while maintaining custody of assets. It compares centralized crypto lending by companies like BlockFi to decentralized alternatives, highlighting the risks of centralized services and the permissionless, transparent nature of DeFi lending powered by smart contracts.
๐ฎ How borrowing limits and interest rates are determined
This paragraph explains how borrowing limits and interest rates are calculated in DeFi lending. Borrowing power depends on the collateral factor of supplied assets and available liquidity in each market. Interest rates for lenders and borrowers are variable based on supply and demand dynamics. Aave offers stable rate lending to reduce rate volatility. Reasons for borrowing despite overcollateralization are also discussed.
๐จโ๐ซ An example explaining Compound cTokens
An example is provided to demonstrate how Compound's cTokens work. A user supplies 10 ETH and receives cETH representing claim on the ETH plus accumulated interest. As the cToken exchange rate increases with each block, users can redeem cTokens for more ETH than they initially supplied, earning interest. The example shows how a 0.16% APY on ETH supply could be achieved over 1 month as cETH exchange rate rises.
Mindmap
Keywords
๐กLending and borrowing
๐กMoney market
๐กSupply APY
๐กBorrow APY
๐กCollateral factor
๐กExchange rate
๐กLiquidation
๐กSmart contract risks
๐กAPY volatility
๐กTrustless
Highlights
Introduction to lending and borrowing in DeFi, highlighting its importance in financial systems.
Explanation of traditional lending and borrowing through financial institutions versus DeFi platforms.
Comparison between centralized finance (CeFi) companies like BlockFi and Celsius, and DeFi protocols like Aave and Compound.
Discussion on the risks associated with centralized lending such as hacks and negligence.
Advantages of DeFi lending including decentralization, permissionless access, and self-custody of assets.
Detailed overview of how Aave and Compound function as leading DeFi lending protocols.
Explanation of over-collateralization in DeFi lending and the rationale behind it.
Factors determining how much can be borrowed in DeFi, including available funds and collateral factor.
The mechanism of interest rates in DeFi lending, highlighting the variable interest rates determined by supply and demand.
The unique features of Aave, such as stable borrow interest rates and flash loans.
In-depth example of how Compound's cTokens work, demonstrating the process of earning interest on deposited assets.
Comparison of Aave's aTokens to Compound's cTokens and their respective interest accumulation models.
The procedure for borrowing in DeFi using collateralized tokens and the implications of liquidation.
How DeFi platforms manage price feeds and assess collateral value to ensure loan security.
Discussion on the risks of DeFi lending, including smart contract vulnerabilities and fluctuating interest rates.
Transcripts
so have you ever been wondering how
landing and borrowing works in d5
how are the supply and borrow rates
determined and what is the main
difference between the most popular
lending protocols
such as compound and other 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 reapers
treasury bills and others in the
cryptocurrency space
landing and borrowing is accessible
either through dsi protocols
such as ave or compound or by c5
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 blockfy 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 their 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 cifi model
basically goes against one of the main
value propositions of cryptocurrencies
self-custody of your assets this is also
where defile landing comes into play
defy lending
allows users to become lenders or
borrowers
in a completely decentralized and
permissionless way
while maintaining full custody over
their coins
define lending is based on smart
contracts that run
on open blockchains predominantly
ethereum
this is also why defile landing in
contrast to c5 landing
is accessible to everyone without a need
of providing your personal details
or trusting someone else to hold your
funds
ava and compound are two main lending
protocols available in d5
both of the protocols work by creating
money markets
for particular tokens such as eth
stable coins like dye and usdc or other
tokens
like ling 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 their current supply
api
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
interest
these tokens are called c tokens in
compound
and a tokens in ava 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 d5 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 percent on
compound
this means that up to 75 percent of the
value of the supply die or
heat 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 api
is higher than the supply api in a
particular market
the interest apis are calculated per
ethereum block
calculating apys per block means
that define lending provides variable
interest rates
that can change quite dramatically
depending on the landing and borrowing
demand for particular tokens
this is also where one of the biggest
differences between compound and other
comes in
although both protocols offer variable
supply and borrow apis
ave also offers stable borrow api
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
ave 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 defile lending protocols work
let's dive into an example
but before we do that if you made it
this far and you enjoy 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 heath into compound in
exchange for 10eth
compound issues c tokens in this case
c if how many c tokens will the user
receive
this depends on the current exchange
rate for a particular market
in this case ether 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
supplies 10 eth
when the market was just created they
would have received
10 divided by 0.02 equals
500 ces because the ether 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
ces if the user decided to immediately
redeem their ease
they should receive roughly the same
amount as it was deposited
which is around 10 eat now here is when
the magic happens
the user holds their ces this is just
another erc20 token
that can be sent anywhere the main
difference
is that ces is necessary to redeem the
underlying heath from compound
on top of that seat 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 c
to 8 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 four 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
if the user decides to redeem their ease
they would receive
around 10.0165 each
so the user just made 0.0165
each in a month which is around 0.16
return on their eath it's worth noting
that the original amount of ces 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
ave uses a similar model with interest
being accumulated
every single block the main difference
is that
a token's value is packed to the value
of the underlying tokens
at the one-to-one 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
other
on the other hand relies on channeling
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
api 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 mainly the
ever-present
smart contract risks but also quickly
changing apis
for example during the last yield
farming craze
the pro apy on the bat token went up to
over 40 percent
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 landing and
borrowing in detail
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 defy community thanks for
watching
Browse More Related Video
What is AAVE? (Animated) Crypto Borrowing and Lending Explained
Aave Tutorial (How to Borrow & Lend Crypto)
How the Fed Steers Interest Rates to Guide the Entire Economy | WSJ
What is DEFI? Decentralized Finance Explained (Ethereum, MakerDAO, Compound, Uniswap, Kyber)
Econ201_chapter4_all
Canadaโs $30,000,000,000 Purchase is Crazy
5.0 / 5 (0 votes)