Modular, upgradeable fee management contract for vaults.
The FeeManager is responsible for managing and calculating various fee types in a vault system, including deposit, redemption, performance, and protocol fees. It uses a flexible architecture with deterministic storage slots (via SlotLibrary) and supports per-vault configurations.
assets * price = shares)Uses an isolated storage slot per deployment instance, computed deterministically using SlotLibrary.getSlot("FeeManager", name, version), ensuring safety and upgradability.
Each vault is associated with:
baseAsset: Reference token used for performance fee calculation.minPriceD18: Minimum price recorded (used for performance fee calculation).timestamps: Last update timestamp for time-based fee accrual.calculateDepositFee(uint256 shares) → uint256Computes a linear fee as shares * depositFeeD6 / 1e6.
calculateRedeemFee(uint256 shares) → uint256Computes a linear fee as shares * redeemFeeD6 / 1e6.
calculateFee(...) → uint256 sharesCalculates the total fee to be charged based on: