You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the function _writeOff of navfeed.sol, I find an error in caculating PV(Present Value). // first time written-off if (isLoanWrittenOff(loan) == false) { uint256 fv = futureValue(nftID_); if (uniqueDayTimestamp(lastNAVUpdate) > maturityDate_) { // write off after the maturity date overdueLoans = secureSub(overdueLoans, fv); latestNAV_ = secureSub(latestNAV_, fv); } else { // write off before or on the maturity date buckets[maturityDate_] = safeSub(buckets[maturityDate_], fv); uint256 pv = rmul(fv, rpow(discountRate, safeSub(uniqueDayTimestamp(maturityDate_), nnow), ONE)); latestDiscount = secureSub(latestDiscount, pv); latestNAV_ = secureSub(latestNAV_, pv); } }
I think you should use rdiv to caculate PV by FV.
The text was updated successfully, but these errors were encountered:
In the function _writeOff of navfeed.sol, I find an error in caculating PV(Present Value).
// first time written-off if (isLoanWrittenOff(loan) == false) { uint256 fv = futureValue(nftID_); if (uniqueDayTimestamp(lastNAVUpdate) > maturityDate_) { // write off after the maturity date overdueLoans = secureSub(overdueLoans, fv); latestNAV_ = secureSub(latestNAV_, fv); } else { // write off before or on the maturity date buckets[maturityDate_] = safeSub(buckets[maturityDate_], fv); uint256 pv = rmul(fv, rpow(discountRate, safeSub(uniqueDayTimestamp(maturityDate_), nnow), ONE)); latestDiscount = secureSub(latestDiscount, pv); latestNAV_ = secureSub(latestNAV_, pv); } }
I think you should use rdiv to caculate PV by FV.
The text was updated successfully, but these errors were encountered: