Skip to content
LogoLogo

WatermarkFeeManager

Git Source

Inherits: MachinePeriphery, AccessManagedUpgradeable, IWatermarkFeeManager

Constants

MAX_BPS

Full scale value in basis points

uint256 private constant MAX_BPS = 10_000;

MAX_FEE_RATE

Full scale value for fee rates

uint256 private constant MAX_FEE_RATE = 1e18;

WatermarkFeeManagerStorageLocation

bytes32 private constant WatermarkFeeManagerStorageLocation =
        0xede173ec12f445c51c989a2ee4f565cf9b40f8a01bd556574a3890308cdf3900;

Functions

_getWatermarkFeeManagerStorage

function _getWatermarkFeeManagerStorage() private pure returns (WatermarkFeeManagerStorage storage $);

Returns

NameTypeDescription
$WatermarkFeeManagerStorage

constructor

constructor(address _registry) MachinePeriphery(_registry);

Parameters

NameTypeDescription
_registryaddress

initialize

Initializer of the contract.

function initialize(bytes calldata data) external override initializer;

Parameters

NameTypeDescription
databytesThe initialization data, if any.

onlyMachine

modifier onlyMachine();

authority

Returns the current authority.

function authority() public view override returns (address);

Returns

NameTypeDescription
<none>address

mgmtFeeRatePerSecond

Management fee rate per second, 1e18 = 100%.

function mgmtFeeRatePerSecond() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256

smFeeRatePerSecond

Security module fee rate per second, 1e18 = 100%.

function smFeeRatePerSecond() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256

perfFeeRate

Performance fee rate on profit, 1e18 = 100%.

function perfFeeRate() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256

mgmtFeeReceivers

Management fee receivers.

function mgmtFeeReceivers() external view override returns (address[] memory);

Returns

NameTypeDescription
<none>address[]

mgmtFeeSplitBps

Management fee split between receivers in basis points. Values must sum to 10_000.

function mgmtFeeSplitBps() external view override returns (uint256[] memory);

Returns

NameTypeDescription
<none>uint256[]

perfFeeReceivers

Performance fee receivers.

function perfFeeReceivers() external view override returns (address[] memory);

Returns

NameTypeDescription
<none>address[]

perfFeeSplitBps

Performance fee split between receivers in basis points. Values must sum to 10_000.

function perfFeeSplitBps() external view override returns (uint256[] memory);

Returns

NameTypeDescription
<none>uint256[]

securityModule

Security module address.

function securityModule() external view override returns (address);

Returns

NameTypeDescription
<none>address

sharePriceWatermark

Current share price high watermark for the associated Machine.

function sharePriceWatermark() external view override returns (uint256);

Returns

NameTypeDescription
<none>uint256

getRestrictedFeeConfigSelectors

Returns the function selectors for the restricted fee configuration functions.

function getRestrictedFeeConfigSelectors() external pure override returns (bytes4[] memory);

Returns

NameTypeDescription
<none>bytes4[]

calculateFixedFee

Calculates the fixed fee for a given share supply and elapsed time.

May update internal state related to fee accrual or realization.

function calculateFixedFee(uint256 currentShareSupply, uint256 elapsedTime)
        external
        view
        override
        returns (uint256);

Parameters

NameTypeDescription
currentShareSupplyuint256The total supply of shares.
elapsedTimeuint256The elapsed time since the last fee realization.

Returns

NameTypeDescription
<none>uint256fee The calculated fixed fee.

calculatePerformanceFee

Calculates the performance fee based on the share supply, share price performance and elapsed time.

May update internal state related to fee accrual or realization.

function calculatePerformanceFee(uint256 currentShareSupply, uint256, uint256 newSharePrice, uint256)
        external
        override
        onlyMachine
        returns (uint256);

Parameters

NameTypeDescription
currentShareSupplyuint256The current total supply of shares.
_uint256The previous share price of reference.
newSharePriceuint256The new share price of reference.
_uint256The elapsed time since the last fee realization.

Returns

NameTypeDescription
<none>uint256fee The calculated performance fee.

distributeFees

Distributes the fees to relevant recipients.

function distributeFees(uint256 fixedFee, uint256 perfFee) external override onlyMachine;

Parameters

NameTypeDescription
fixedFeeuint256The fixed fee amount to be distributed.
perfFeeuint256The performance fee amount to be distributed.

resetSharePriceWatermark

Resets the share price high watermark.

function resetSharePriceWatermark(uint256 sharePrice) external override restricted;

Parameters

NameTypeDescription
sharePriceuint256

setMgmtFeeRatePerSecond

Sets the management fee rate per second.

function setMgmtFeeRatePerSecond(uint256 newMgmtFeeRatePerSecond) external override restricted;

Parameters

NameTypeDescription
newMgmtFeeRatePerSeconduint256The new management fee rate per second. 1e18 = 100%.

setSmFeeRatePerSecond

Sets the security module fee rate per second.

function setSmFeeRatePerSecond(uint256 newSmFeeRatePerSecond) external override restricted;

Parameters

NameTypeDescription
newSmFeeRatePerSeconduint256The new security module fee rate per second. 1e18 = 100%.

setPerfFeeRate

Sets the performance fee rate.

function setPerfFeeRate(uint256 newPerfFeeRate) external override restricted;

Parameters

NameTypeDescription
newPerfFeeRateuint256The new performance fee rate on profit. 1e18 = 100%.

setMgmtFeeSplit

Sets the management fee split and receivers.

function setMgmtFeeSplit(address[] calldata newMgmtFeeReceivers, uint256[] calldata newMgmtFeeSplitBps)
        external
        override
        restricted;

Parameters

NameTypeDescription
newMgmtFeeReceiversaddress[]The new management fee receivers.
newMgmtFeeSplitBpsuint256[]The new management fee split between receivers in basis points. Values must sum to 10_000.

setPerfFeeSplit

Sets the performance fee split and receivers.

function setPerfFeeSplit(address[] calldata newPerfFeeReceivers, uint256[] calldata newPerfFeeSplitBps)
        external
        override
        restricted;

Parameters

NameTypeDescription
newPerfFeeReceiversaddress[]The new performance fee receivers.
newPerfFeeSplitBpsuint256[]The new performance fee split between receivers in basis points. Values must sum to 10_000.

setSecurityModule

Sets the security module address.

function setSecurityModule(address _securityModule) external override onlyFactory;

Parameters

NameTypeDescription
_securityModuleaddressThe address of the security module.

_checkFeeSplit

Checks that the provided fee split setup is valid.

function _checkFeeSplit(address[] memory _feeReceivers, uint256[] memory _feeSplitBps) internal pure;

Parameters

NameTypeDescription
_feeReceiversaddress[]
_feeSplitBpsuint256[]

Structs

WatermarkFeeManagerStorage

Note:

  • storage-location: erc7201:makina.storage.WatermarkFeeManager
struct WatermarkFeeManagerStorage {
        uint256 _mgmtFeeRatePerSecond;
        uint256 _smFeeRatePerSecond;
        uint256 _perfFeeRate;
        uint256 _sharePriceWatermark;
        address[] _mgmtFeeReceivers;
        uint256[] _mgmtFeeSplitBps;
        address[] _perfFeeReceivers;
        uint256[] _perfFeeSplitBps;
        address _securityModule;
    }

Properties

NameTypeDescription
_mgmtFeeRatePerSeconduint256
_smFeeRatePerSeconduint256
_perfFeeRateuint256
_sharePriceWatermarkuint256
_mgmtFeeReceiversaddress[]
_mgmtFeeSplitBpsuint256[]
_perfFeeReceiversaddress[]
_perfFeeSplitBpsuint256[]
_securityModuleaddress