sherlock-audit / 2023-12-arcadia-judging

19 stars 15 forks source link

neo - Tranche gets unfair share of interests regardless of its liquidity #127

Closed sherlock-admin2 closed 9 months ago

sherlock-admin2 commented 9 months ago

neo

medium

Tranche gets unfair share of interests regardless of its liquidity

Summary

A tranche gets an unfair share of interest collected based on weights even if it has minimal liquidity

Vulnerability Detail

When processing interests tranches get allocated their share of interest based on the interestWeightTranches for each tranche in the _syncInterestsToLiquidityProviders

This function has a check to make sure that realisedLiquidity of a tranche is non-zero. But does not have any check to make sure that the tranche has sufficient liquidity to justify the allocation of interest share.

                realisedLiquidity = realisedLiquidityOf[tranches[i]];
                // Don't pay interests to Tranches without liquidity.
                // Interests will go to treasury instead.
                if (realisedLiquidity == 0) continue;
                trancheShare = assets.mulDivDown(interestWeightTranches[i], totalInterestWeight_);

In that case tranche can have minimum liquidity above 1 wei into the lending pool and gain an unfair share of the interests based on this formula:

               trancheShare = assets.mulDivDown(interestWeightTranches[i], totalInterestWeight_);

Impact

Unfair share of interests goes to a tranche with minimal liquidity.

Code Snippet

LendingPool.sol#L759

Tool used

Manual Review

Recommendation

Considering allocating the interest based on the liquidity share of a tranche or ad a minimum liquidity check to justify the interest share allocation based on the weights.

Duplicate of #1

sherlock-admin2 commented 9 months ago

1 comment(s) were left on this issue during the judging contest.

takarez commented:

invalid

nevillehuang commented 9 months ago

Invalid, agree with sponsors comment:

As designed. If there is a quasi-empty tranche getting a fixed share of the interests (the absolute value of interest a tranche gets is independent of the liquidity ratio’s of the tranches), that tranche will have a much higher yield. More: this is exactly the risk-reward tradeoff that will happen between senior and junior tranche depositors. Junior tranche may have lower liquidity, but (for example) an equal share of the interests → higher yield, but higher risk