hats-finance / Velvet-Capital-0x0bb0c08fd9eeaf190064f4c66f11d18182961f77

Core smart contracts of Velvet Capital
Other
0 stars 1 forks source link

Rebalancing : before removing the portfolio tokens, rewards are not claimed #99

Open hats-bug-reporter[bot] opened 2 weeks ago

hats-bug-reporter[bot] commented 2 weeks ago

Github username: @aktech297 Twitter username: kaka Submission hash (on-chain): 0xb972d59694c5b645a205b3dc0fbebba52375932e1af82857051e01a35e7266d1 Severity: medium

Description: Description

In Rebalancing contract, the assetmanager can call the function s removePortfolioToken, removeNonPortfolioToken removePortfolioTokenPartially and removeNonPortfolioTokenPartially to remove any of the portfolio tokens from the actie array.

The issue here is, the rewards claiming are missed in those function.

If we see the portfolio tokens, these can be staked in the various activities like staking, liquidity provision, or participation in DeFi protocols.

There is separate function to claim the rewards claimRewardTokens which can be called by the assetmanager.

As mentioned in the above functions, before removing the portfolio tokens, the claimRewardTokens call is missed.

Impact

loss of rewards.

Solution

We would suggest to call the claimRewardTokens function before removing the portoflio tokens.

langnavina97 commented 2 weeks ago

The asset manager is responsible the process, and most protocols distribute rewards upon transfer. @aktech297

aktech297 commented 2 weeks ago

Could you pls share the reference where the rewards are claimed during the transfer

aktech297 commented 2 weeks ago

The asset manager is responsible the process, and most protocols distribute rewards upon transfer. @aktech297

Hi @langnavina97 . would you please explain in brief about this.

langnavina97 commented 2 weeks ago

Most LP tokens or tokens with rewards will claim rewards on transfer. However, the asset manager is responsible for managing the portfolio. If there are any possible rewards that need to be claimed before removing the token, the asset manager should handle this to ensure all potential rewards are collected. @aktech297

aktech297 commented 2 weeks ago

Most LP tokens or tokens with rewards will claim rewards on transfer. However, the asset manager is responsible for managing the portfolio. If there are any possible rewards that need to be claimed before removing the token, the asset manager should handle this to ensure all potential rewards are collected. @aktech297

Thats perfect.

But, make sure the assetmanager calls before removing token.