Richa-iitr / EthereumDefi

0 stars 0 forks source link

Defi Protocols #[1] #2

Open Richa-iitr opened 2 years ago

Richa-iitr commented 2 years ago

Compound: Money Market Protocol

Implementation

Questions

  1. How the protocol avoids the risk whenever borrowing amount exceeds borrowing capacity? Had difficulty understanding this, If the value of an account’s borrowing outstanding exceeds their borrowing capacity, a portion of the outstanding borrowing may be repaid in exchange for the user’s cToken collateral, at the current market price minus a liquidation discount ; this incentives an ecosystem of arbitrageurs to quickly step in to reduce the borrower’s exposure, and eliminate the protocol’s risk.
  2. How does the protocol decides the Interest Rate?
  3. The protocol incentivizes lenders to to lend to the market by giving them cTokens whose value may increase due to the interest rates or market demand but how is it incentivizing the borrowers to borrow from the market?
  4. What does the function repayBorrow(uint amount) do?
  5. When the borrowers assets are liquified due to collateral falling or borrowed assets' value increase, the liquidate function is called. Who calls this function? Does the contract keeps check of this from time to time?