Skip to content

Add Aave V4 Fee Minter Keeper#1059

Draft
CheyenneAtapour wants to merge 3 commits intomainfrom
feat/fee-minter
Draft

Add Aave V4 Fee Minter Keeper#1059
CheyenneAtapour wants to merge 3 commits intomainfrom
feat/fee-minter

Conversation

@CheyenneAtapour
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do not copy paste, this should be pre-deployed and referenced in the AIP directly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah maybe a todo to rm these local deps once the pr is merged into v4. Anyway we wouldnt need IAccessManager and IHub to be local deps given that you're updating the remappings to use v4 deps?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

let's ref the specific aave-v4 branch for now so we can remove this and have correct dependencies then, it will be easier to clean up once the PR is merged there.

import {CollectorUtils, ICollector} from 'aave-helpers/src/CollectorUtils.sol';

import {IAaveCLRobotOperator} from 'src/interfaces/IAaveCLRobotOperator.sol';
import {FeeSharesMinterBase} from './dependencies/FeeSharesMinterBase.sol';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's have consistent import patterns

using SafeERC20 for IERC20;
using CollectorUtils for ICollector;

uint96 public constant LINK_AMOUNT = 200 ether;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

prefer not to use ether units for non ethereum assets (just imo)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also wondering on general costs, how long 200e18 worth of LINK will last here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the amount should be enough to start with, should last quite a while, as the actions are not that gas expensive. But would be good to have a real estimate ofc, depending on the number of reserves to cover.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if doing local deps, could just move this into the dependencies/ dir in this AIP folder


import {IAaveCLRobotOperator} from 'src/interfaces/IAaveCLRobotOperator.sol';
import {IFeeSharesMinterBase} from 'src/interfaces/IFeeSharesMinterBase.sol';
import {AaveV4Ethereum_RegisterFeeSharesMinterKeeper_20260409} from './AaveV4Ethereum_RegisterFeeSharesMinterKeeper_20260409.sol';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

consistent imports


## Specification

- Deploy the FeeSharesMinterBase contract owned by the governance executor
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

above it is mentioned as being pre-deployed prior to this aip?

uint256 accruedFees = hubContract.getAssetAccruedFees(assetId);
uint256 totalAddedAssets = hubContract.getAddedAssets(assetId);

if ((accruedFees * PERCENTAGE_FACTOR) / totalAddedAssets < minAccruedFeesPercent) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this on an old version of the fee minter? this is percentMul there i see

address minterAddress = _getMinterAddressFromLogs(logs);
IFeeSharesMinterBase minter = IFeeSharesMinterBase(minterAddress);
IHub hub = AaveV4EthereumHubs.CORE_HUB;
uint256 assetId = 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't know if I'm comfortable with us only testing 1 specific asset one Core Hub, I'd prefer we have multiple scenarios, especially since the FeeSharesMinter is fully based on amounts now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agree, esp with high/low decimals and value


function execute() external {
// TODO: Replace this deployment with the pre-deployed address once available.
address feeSharesMinter = address(new FeeSharesMinterBase(GovernanceV3Ethereum.EXECUTOR_LVL_1));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

rm please, let's have it deployed with the Deploy Engine in aave-v4 and set as a constant here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

todo: add this to deploy engine for me

Comment on lines +43 to +54
uint256 withdrawnBalance = AaveV3Ethereum.COLLECTOR.withdrawFromV3(
CollectorUtils.IOInput({
pool: address(AaveV3Ethereum.POOL),
underlying: AaveV3EthereumAssets.LINK_UNDERLYING,
amount: LINK_AMOUNT
}),
address(this)
);
IERC20(AaveV3EthereumAssets.LINK_UNDERLYING).forceApprove(
MiscEthereum.AAVE_CL_ROBOT_OPERATOR,
withdrawnBalance
);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

let's put this in the pre hook

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.

4 participants