Lending And Borrowing In DEFI Explained - Aave, Compound

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
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
Info
Channel: Finematics
Views: 247,956
Rating: undefined out of 5
Keywords: defi, decentralized finance, lending and borrowing, lending in defi, lending in crypto, crypto lending, aave, compound, ctokens, atokens, blockchain, ethereum
Id: aTp9er6S73M
Channel Id: undefined
Length: 13min 32sec (812 seconds)
Published: Mon Nov 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.