yearn / yearn-vaults

Yearn Vault smart contracts
https://yearn.finance/
GNU Affero General Public License v3.0
518 stars 317 forks source link

Management fee is charged on total assets at time of harvest leading to unfairly high fees for early LPs #160

Closed Grandthrax closed 3 years ago

Grandthrax commented 3 years ago

image

Management fee is calculated during report. It takes the current total assets and calculated by taking the difference between current timestamp and the last reported time. This is grossly unfair for the initial depositors if there is a big wait time between vault creation and first harvest.

Let's look at Hegic for example. Hegic vault was created 15 days ago. first harvest was 3 days ago.

So hegic vault created. Over the next two weeks it sits empty. Then money ($450k) is deposited and harvest is run. That deposit is charges management fee as if it had been in the vault for two weeks.

As we can see in the tx report users are charged about 743 HEGIC on their deposits of 1_146_733 HEGIC (0.06%) even though nothing has happened yet.

Suggest that we use total assets at last report. Not current total assets.

storming0x commented 3 years ago

Good catch, I would suggest mitigation on new vault deployments to deposit a small amount and run harvest as close as possible to activation, would that mitigate the issue @Grandthrax ?

fubuloubu commented 3 years ago

Potential solution: only charge mgmt on invested funds e.g. Vault.totalDebt

This will eliminate issues when Vaults are first stood up but deposited funds are uninvested, and ensures an incentive exists for governance to add more strategies and use up the debt ratio effectively.


Edit: implemented in https://github.com/iearn-finance/yearn-vaults/pull/162