Open Stevewu1234 opened 2 years ago
Regarding to the function of distributeBorrowerComp() in https://github.com/compound-finance/compound-protocol/blob/master/contracts/Comptroller.sol, the formula of calculating account borrow amount is: uint borrowerAmount = div_(CToken(cToken).borrowBalanceStored(borrower), marketBorrowIndex);
uint borrowerAmount = div_(CToken(cToken).borrowBalanceStored(borrower), marketBorrowIndex);
I saw the borrowAmount calculation in cToken is: recentBorrowBalance = borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex
recentBorrowBalance = borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex
Is the borrowerAmount in distributeBorrowerComp() correct or not?
Hi @Stevewu1234, did you figure this out at the end? I also have the same question and just came across this issue.
Regarding to the function of distributeBorrowerComp() in https://github.com/compound-finance/compound-protocol/blob/master/contracts/Comptroller.sol, the formula of calculating account borrow amount is:
uint borrowerAmount = div_(CToken(cToken).borrowBalanceStored(borrower), marketBorrowIndex);
I saw the borrowAmount calculation in cToken is:
recentBorrowBalance = borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex
Is the borrowerAmount in distributeBorrowerComp() correct or not?