The Vault contract is an upgradeable ERC4626-compliant vault that integrates with AMMs (like Uniswap) and lending protocols (like Aave). It features role-based access control, fee management, and price feed integration.
- ERC4626 compliant vault functionality
- AMM integration for token swaps
- Aave integration for lending/borrowing
- Chainlink price feed integration
- Fee management system
- Role-based access control
- Upgradeable design
OWNER_ROLE: Can perform administrative actionsSTRATEGY_ROLE: Can execute strategy-related functionsDEFAULT_ADMIN_ROLE: Can manage roles
function initialize(
address asset_,
address ammRouter_,
address lendingPool_,
address dataProvider_,
address priceFeed_,
address strategy_
) public initializerdeposit(uint256 assets, address receiver): Deposit assets and receive shareswithdraw(uint256 assets, address receiver, address owner): Withdraw assets by burning sharesmint(uint256 shares, address receiver): Mint exact shares by depositing assetsredeem(uint256 shares, address receiver, address owner): Redeem shares for assets
function swapTokensOnAMM(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
uint256 deadline
) externalfunction depositToAave(uint256 amount) external
function withdrawFromAave(uint256 amount) external
function borrowFromAave(address assetToBorrow, uint256 amount, uint256 interestRateMode) external
function repayToAave(address assetToRepay, uint256 amount, uint256 interestRateMode) externalfunction updateFeeBasisPoints(uint256 newEntryFeeBasisPoints, uint256 newExitFeeBasisPoints) external
function updateFeeRecipients(address newEntryFeeRecipient, address newExitFeeRecipient) external