<!-- canonical: https://0xsimao.com/findings/clip-finance-ii-compounding-shares-overtime-rewards -->

# Compounding shares will overtime get less rewards than non compounding shares

Medium · Three Sigma · DeFi infrastructure · 15th March 2024

Finding 3S-Clip-M01 of the Clip Finance Strategy Upgrade security review.

- Protocol: https://www.clip.finance/
- Report: /reports/clip-finance-strategy-upgrade
- Source: https://github.com/0xsimao/audits/blob/main/Three%20Sigma/2024-03-15-clip-finance-ii.pdf

---

### Description

keepPortion and sellPortion are based on the total number of shares of each type.
However, compoundShareRate is expected to increase due to accumulating rewards. This
means that, for compounding shares, the same liquidity minted compared to non
compounding shares will lead to less shares, when depositing. Thus, over time, assuming
equal deposits of compounding and non compounding shares, the total supply of non
compounding shares is expected to grow more than compounding shares.

### Recommendation

keepPortion and sellPortion should be calculated based on the total liquidity of each
share type, not the total supply, as liquidity is effectively what is generating rewards.

### Status

Addressed in [#2464036](https://github.com/ClipFinance/StrategyRouter-private/pull/107/commits/246403632989e7540acab2238a5e40e170452de2).

Disclosed by 0xSimao (https://0xsimao.com/).

---

Related findings:

- [Delegate rewards system is unfair to delegates with less tokens and reduces decentralization](https://0xsimao.com/findings/ajna-protocol-delegate-rewards-system-decentralization): Ajna Protocol
- [Possible to mint or burn infinite shares, stealing all rewards or making transfers fail](https://0xsimao.com/findings/trestle-mint-shares-rewards-transfers): Trestle wTIA Bridge
