Skip to main content

WatermarkFeeManager

Git Source

Inherits: MachinePeriphery, AccessManagedUpgradeable, IWatermarkFeeManager

State Variables

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 $);

constructor

constructor(address _registry) MachinePeriphery(_registry);

initialize

Initializer of the contract.

function initialize(bytes calldata data) external override initializer;

Parameters

NameTypeDescription
databytes

onlyMachine

modifier onlyMachine();

authority

Returns the current authority.

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

mgmtFeeRatePerSecond

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

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

smFeeRatePerSecond

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

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

perfFeeRate

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

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

mgmtFeeReceivers

Fixed fee receivers.

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

mgmtFeeSplitBps

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

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

perfFeeReceivers

Performance fee receivers.

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

perfFeeSplitBps

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

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

securityModule

Security module address.

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

sharePriceWatermark

Current share price high watermark for the associated Machine.

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

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
currentShareSupplyuint256
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.
<none>uint256
newSharePriceuint256The new share price of reference.
<none>uint256

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;

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 fixed fee split and receivers.

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

Parameters

NameTypeDescription
newMgmtFeeReceiversaddress[]The new fixed fee receivers.
newMgmtFeeSplitBpsuint256[]The new fixed 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
_securityModuleaddress

_checkFeeSplit

Checks that the provided fee split setup is valid.

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

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;
}