MaxApyVault
Overview
Constants
uint256 public constant MAXIMUM_STRATEGIES = 20; // Maximum number of strategies the vault can manage
uint256 public constant MAX_BPS = 10_000; // Base points scale (100%)
uint256 public constant SECS_PER_YEAR = 31_556_952; // Seconds in a year (365.2425 days)
uint256 public constant AUTOPILOT_HARVEST_INTERVAL = 1 weeks; // Interval between automated harvestsuint256 public constant ADMIN_ROLE = _ROLE_0;
uint256 public constant EMERGENCY_ADMIN_ROLE = _ROLE_1;
uint256 public constant STRATEGY_ROLE = _ROLE_2;Errors
error QueueIsFull(); // Withdrawal queue has reached maximum capacity
error VaultInEmergencyShutdownMode(); // Operation not allowed during emergency shutdown
error StrategyInEmergencyExitMode(); // Strategy is in emergency exit mode
error InvalidZeroAddress(); // Zero address provided where not allowed
error StrategyAlreadyActive(); // Attempt to add already active strategy
error StrategyNotActive(); // Operation attempted on inactive strategy
error InvalidStrategyVault(); // Strategy's vault address doesn't match
error InvalidStrategyUnderlying(); // Strategy's underlying asset doesn't match
error InvalidDebtRatio(); // Debt ratio exceeds maximum allowed
error InvalidMinDebtPerHarvest(); // Invalid minimum debt per harvest value
error InvalidPerformanceFee(); // Performance fee exceeds maximum allowed
error InvalidManagementFee(); // Management fee exceeds maximum allowed
error StrategyDebtRatioAlreadyZero(); // Strategy's debt ratio is already zero
error InvalidQueueOrder(); // Invalid withdrawal queue ordering
error VaultDepositLimitExceeded(); // Deposit would exceed vault's limit
error InvalidZeroAmount(); // Zero amount provided where not allowed
error InvalidZeroShares(); // Zero shares amount where not allowed
error LossGreaterThanStrategyTotalDebt(); // Reported loss exceeds strategy's total debt
error InvalidReportedGainAndDebtPayment(); // Invalid gain and debt payment reported
error FeesAlreadyAssesed(); // Fees have already been assessedEvents
Strategy Management Events
Configuration Events
Operation Events
State Variables
Functions
Basic View Functions
name
symbol
asset
totalAssets
totalDeposits
sharePrice
Asset/Share Conversion Functions
convertToShares
convertToAssets
Deposit Limit Functions
maxDeposit
maxMint
maxWithdraw
Preview Functions
previewMint
previewWithdraw
previewRedeem
Strategy View Functions
creditAvailable
debtOutstanding
getStrategyTotalDebt
Deposit Functions
deposit
depositWithPermit
mint
mintWithPermit
Withdrawal Functions
withdraw
redeem
Strategy Management Functions
addStrategy
removeStrategy
revokeStrategy
exitStrategy
updateStrategyData
Reporting Functions
report
Configuration Functions
setWithdrawalQueue
setPerformanceFee
setManagementFee
setDepositLimit
setEmergencyShutdown
setTreasury
setAutopilotEnabled
setAutoPilot
Internal Functions
_forceOneHarvest
_reportLoss
_assessFees
_creditAvailable
_computeDebtLimit
_debtOutstanding
_organizeWithdrawalQueue
_revokeStrategy
_issueSharesForAmount
Helper Functions
eitherIsZero
inc
_sub0
ERC4626 Override Functions
_underlyingDecimals
_decimalsOffset
_totalAssets
_totalDeposits
_deposit
_withdraw
_redeem
Last updated