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

feat: add aave strategy #118

Merged
merged 5 commits into from
Apr 16, 2024
Merged

feat: add aave strategy #118

merged 5 commits into from
Apr 16, 2024

Conversation

toprince
Copy link
Collaborator

No description provided.

Comment on lines 48 to 58
uint256 beforeBal = balanceOfWant();

// claim all rewards to the vault
IAaveV3Incentives(incentivesController).claimAllRewards(rewardAssets, address(vault));

uint256 wantHarvested = balanceOfWant() - beforeBal;
uint256 fee = chargePerformanceFee(wantHarvested);
deposit();

lastHarvest = block.timestamp;
emit StratHarvest(msg.sender, wantHarvested - fee, balanceOf());
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to calculate the balance, charge perf fee and deposit.

uint256 beforeBal = balanceOfWant();

// claim all rewards to the vault
IAaveV3Incentives(incentivesController).claimAllRewards(rewardAssets, address(vault));
Copy link
Contributor

Choose a reason for hiding this comment

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

This API supports directly claiming into the specified address

@fb-alexcq
Copy link
Contributor

npm run "format:write"

Comment on lines +25 to +27
address public constant aavePool = address(0x794a61358D6845594F94dc1DB02A252b5b4814aD); // Aave: Pool V3
address public constant incentivesController = address(0x929EC64c34a17401F460460D4B9390518E5B473e); // Aave: Incentives V3
address public constant dataProvider = address(0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654); // Aave: Pool Data Provider V3
Copy link
Contributor

Choose a reason for hiding this comment

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

@0xmer1in could you please help double check these addresses in deployment?

Copy link
Contributor

Choose a reason for hiding this comment

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

both correct

toprince and others added 3 commits April 16, 2024 12:13
1. No need to calculate the balance, charge perf fee and deposit.
2. add reward treasury address, directly claiming into this address
@0xmer1in 0xmer1in force-pushed the Aave-Strategy branch 3 times, most recently from 295447d to 81535ec Compare April 16, 2024 08:42
chore: upgrade

fix: compile && format

chore: update emergencyExit permission

chore: rename back to the origin
@0xmer1in 0xmer1in merged commit b9418ee into main Apr 16, 2024
2 checks passed
@0xmer1in 0xmer1in deleted the Aave-Strategy branch April 16, 2024 09:26
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