Closed c4-bot-3 closed 8 months ago
gzeon-c4 marked the issue as sufficient quality report
gzeon-c4 marked the issue as duplicate of #109
JustDravee marked the issue as unsatisfactory: Invalid
JustDravee marked the issue as unsatisfactory: Invalid
Hey @JustDravee, I think that this issue is different from #109. This submission describes a problem where yield is not automatically claimed when rates decrease. Could you please take another look?
Hey @kazantseff, This vulnerability depends on the participants' timing and it is their own responsibility to maximize their profit by claiming when the ibt rate increases and not when it decreases. No one gives you 100% that using the protocol you will collect maximum yield.
@AydoanB Fair enough, it makes sense what you are saying.
Lines of code
https://github.com/code-423n4/2024-02-spectra/blob/383202d0b84985122fe1ba53cfbbb68f18ba3986/src/tokens/PrincipalToken.sol#L340-L366
Vulnerability details
Bug description
Yield in the protocol is determined by the
ibtRate
. An increase inibtRate
results in a positive yield for users. updateYield()The above function is responsible for updating the yield for a user. It does so by calling
_computeYield()
of thePrincipalTokenUtil
library. Assume a scenario where there are two users, each holding 100 PT/YT tokens after a deposit of 100 tokens of underlying. Let's sayibtRate
increases by 50%, now userA claims his yield, but userB does not. After thatibtRate
decreases by 33% to its original value and both users claim their yield. This will result in userA receiving 49 underlying tokens of yield, while userB will receive only 33 underlying tokens, which results in 16 tokens of yield lost for userB. While userA got rewarded for a positive increase inibtRate
, userB did not.49999999999999999898 33499999999999999954