1Hive/tulip-frontend

Yield Rewards are Incorrectly displayed in Farms

Closed this issue · 1 comments

So the issue is that when you use getDistribution() you don't take into account that this function returns the total xComb that will be distributed to all deposits/shares in that specific pool between that time range.
So... the deposits with more shares due to the multiplier are getting picked up by getDistribution(). This means that the displayed yield is an average of the current deposit yield per pool, rather than the base yield without any lock.
In other words... the displayed yield is incorrect, since the displayed yield already takes into account maybe an average multiplier of 1.3 or 1.6 depending on the pool.

To get the average multiplier for a specific pool we can divide the total shares by the total amount of tokens in the farm contract. For example, in the case of agve/hny the average multiplier is about 1.54752358, so the yield you see on the farms page is actually for a lock period of 64 days, rather than the implied 0 day lock.

To solve for this discrepancy simply discount the returned value from getDistribution(now, futureTimestamp) by the current average multiplier for the respective pool by dividing.

pxbee commented

Done