Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify Aura rewards estimation function to changes introduced #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sajanrajdev
Copy link
Collaborator

Modify Aura rewards estimation function based Aura contract changes and as per WatchPug's recommendations.

@GalloDaSballo
Copy link
Contributor

Copy link
Contributor

@shuklaayush shuklaayush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits

@@ -293,6 +293,9 @@ contract StrategyAuraStaking is BaseStrategy {
view
returns (uint256 amount)
{
uint256 mintAmount = _balAmount
.mul(BOOSTER.getRewardMultipliers(address(baseRewardPool)))
.div(BOOSTER.REWARD_MULTIPLIER_DENOMINATOR());
Copy link
Contributor

@shuklaayush shuklaayush Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Store it as a constant (10000)

Comment on lines 296 to 298
uint256 mintAmount = _balAmount
.mul(BOOSTER.getRewardMultipliers(address(baseRewardPool)))
.div(BOOSTER.REWARD_MULTIPLIER_DENOMINATOR());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to move this out of getMintableAuraRewards and call the function with the adjusted bal value

uint256 balAmountAdjusted = _balAmount.mul(BOOSTER.getRewardMultipliers(address(baseRewardPool))).div(REWARD_MULTIPLIER_DENOMINATOR;
getMintableAuraRewards(balAmountAdjusted);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, pushed

@sajanrajdev
Copy link
Collaborator Author

@GalloDaSballo, the only thing that changed within the booster is that the amount to be passed to the minter is modified by the multiplier, the minting logic remained unchanged as it is handled within the AURA token. The way I handled it here (and WatchPug) suggested, combines the added logic to the booster with the existing minting logic into one function.

I will extract the first step of the process, as @shuklaayush suggests, from the AURA rewards estimation function for it to be more aligned with the Aura infra (this portion is handled within the booster as you pointed out).

Copy link
Contributor

@shuklaayush shuklaayush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. We probably don't need the foundry config file though

@sajanrajdev
Copy link
Collaborator Author

LG. We probably don't need the foundry config file though

I always end up adding it locally when flattening so I figured we might as well add it for good. Happy to remove it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants