yearn / yearn-vaults-v2-subgraph

26 stars 41 forks source link

Strategy Fee income is fungible across vaults #133

Closed bsamuels453 closed 2 years ago

bsamuels453 commented 2 years ago

The following section of code handles the calculation of strategist performance fees: https://github.com/yearn/yearn-vaults-v2-subgraph/blob/main/src/utils/transfer.ts#L49-L54

Vault share transfers to any strategy will always count as strategist performance fees, regardless of whether the strategy belongs to the relevant Vault.

That means if you transfer yvUSDC shares to a strategy address associated with a DAI vault, the transfer will erroneously count as performance fees against the USDC vault.

This issue originally came up while discussing ways to handle delegated strategies. No guarantee we'll encounter this logic flow any time soon, but still best to be prudent and add guard rails to prevent fees from being over counted.

Good first issue

0xkofee commented 2 years ago

I'll take a look.

also, are you sure the code in question isnt this block? https://github.com/yearn/yearn-vaults-v2-subgraph/blob/main/src/utils/transfer.ts#L45-L49

bsamuels453 commented 2 years ago

I'll take a look.

also, are you sure the code in question isnt this block? https://github.com/yearn/yearn-vaults-v2-subgraph/blob/main/src/utils/transfer.ts#L45-L49

There was a big refactor on transfer logic after this issue was filed. It appears that refactor might have eliminated this issue. Can probably close this ticket.