Skip to content

Meta Fee Partitioner

0x80108Ee81A92091Db6B8B2326B1875ce9388f461 | Git Source

Inherits: IMetaFeePartitioner, Initializable, OwnableUpgradeable, UUPSUpgradeable

An utility contract the signals to each vault how to partition the fee between its recipient and the morpho one.

The morpho fee recipient is named as "platform fee recipient" in order to avoid confusion.

State Variables

ONE_HUNDRED_PERCENT

solidity
uint256 private constant ONE_HUNDRED_PERCENT = 10000

INIT_FEE_PERCENTAGE

The init fee percentage value.

solidity
uint256 public constant INIT_FEE_PERCENTAGE = 1500

defaultPlatformFeePercentage

The default platform fee percentage each vault has if no specific fee is set.

solidity
uint256 public defaultPlatformFeePercentage

_vaultFeePercentages

Percentage of fees collected by the platform.

The percentage is represented as a value between 0 and ONE_HUNDRED_PERCENT

The remaining percentage (ONE_HUNDRED_PERCENT - platformPercentage) is collected by the vault feeRecipient.

solidity
mapping(address => FeePercentage) internal _vaultFeePercentages

Functions

constructor

Note: oz-upgrades-unsafe-allow: constructor

solidity
constructor() ;

initialize

Initializes the contract.

solidity
function initialize(address governance) external initializer;

Parameters

NameTypeDescription
governanceaddressThe address of the governance.

_authorizeUpgrade

solidity
function _authorizeUpgrade(address) internal override onlyOwner;

setFeePercentage

Sets the fee percentage for a vault that is taken by the platform.

solidity
function setFeePercentage(address vault, uint256 newFee) external onlyOwner;

Parameters

NameTypeDescription
vaultaddressThe address of the vault.
newFeeuint256The fee percentage to set, represented in basis points

setDefaultPlatformFeePercentage

Sets the default platform fee percentage.

solidity
function setDefaultPlatformFeePercentage(uint256 newFee) external onlyOwner;

Parameters

NameTypeDescription
newFeeuint256The new default fee percentage

getShares

Get the vault fee splitted between the platform and the vault recipient.

solidity
function getShares(address vault, uint256 fee)
    external
    view
    returns (uint256 platformShare, uint256 recipientShare);

Parameters

NameTypeDescription
vaultaddressThe address of the vault.
feeuint256The fee amount.

Returns

NameTypeDescription
platformShareuint256The fee amount for the platform.
recipientShareuint256The fee amount for the vault recipient.

getPlatformPercentage

The percentage of fees collected by the platform for a specific vault.

solidity
function getPlatformPercentage(address vault) public view returns (uint256 percentage);

Parameters

NameTypeDescription
vaultaddressThe address of the vault.

Returns

NameTypeDescription
percentageuint256The fee percentage in basis points (10000 = 100%).

Structs

FeePercentage

solidity
struct FeePercentage {
    // Share for the platform in basis points:
    uint256 platformPercentage;
    // Whether the fee percentage has been set:
    bool isSet;
}