aave / aave-utilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move Incentives from UiPoolDataProvider to new UiIncentivesDataProvider contract

sendra opened this issue · comments

Remove the return of the reserve incentives from the UiPoolDataProvider.

Use current deployed version as base: https://github.com/aave/protocol-v2/blob/feat/split-ui-dataprovider-logic/contracts/misc/UiPoolDataProvider.sol

move from 139 - 160 (reserve incentives)
move from 187 - 200 (user reserve incentives)

Also move emissionEndTimestamp (given by incentivesController)
Also move userUnclaimedRewards (incentive rewards unclaimed by the user)

We need to Add also an extra check to instead of passing or hardcoding the incentives controller, we should get it from the a/s/v tokens (as they are initialized with it) this will give us also the possibility to operate with incentive controller by token instead of by network. Take into account that having incentivesController by token we will also need to get emissionEndTimestamp by token (not sure if this will have reaple effect. I think it shouldn't as if multiple tokens have same incentivesController the emissionEndTimestamp will be the same)

userUnclaimedRewards will also be affected by the incentivesController by token. If we have different IncentivesControllers then we provably will need to add all the userUnclaimedRewards but if they are the same then we shouldn't as userUnclaimedRewards accounts for all the unclaimedRewards of the different token incentives. Maybe we could calculate teh unclaimed rewards by getting for every asset the method getUserAssetData, and reproducing smart contract calls in the lib, this way we could query for every token without the need to add extra logic in the contract. (So yeah, take a deeper look at that part)