code-423n4 / 2021-05-88mph-findings

0 stars 0 forks source link

Longer maturity leads to lower returns #14

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

cmichel

Vulnerability details

Vulnerability Details

The LinearDecayInterestModel computes the interestAmount on a deposit as depositAmount * moneyMarketInterestRatePerSecond * IRMultiplier * depositPeriodInSeconds where the IRMultiplier is a function of the depositPeriodInSeconds computed in:

function getIRMultiplier(uint256 depositPeriodInSeconds)
    public
    view
    returns (uint256)
{
    uint256 multiplierDecrease = depositPeriodInSeconds * multiplierSlope;
    if (multiplierDecrease >= multiplierIntercept) {
        return 0;
    } else {
        return multiplierIntercept - multiplierDecrease;
    }
}

The higher the duration the lower the interest amount, if the duration is long enough no interest will be returned.

Impact

I'd expect longer durations to lead to a higher percentage on the principal due to opportunity cost on the money. If I take a loan with a long maturity (multiplierDecrease >= multiplierIntercept) I get zero interest. Why would anyone do that?

Recommended Mitigation Steps

I might not understand what the intention is or the multiplier is wrong.

ZeframLou commented 3 years ago

88mph decreases the offered interest rate for longer deposits because the longer it is the more uncertain we are about the average floating rate during the deposit period, so this is by design.

ghoul-sol commented 3 years ago

As it is expected behavior, closing as invalid.