Charging a Streaming Fee

What is the StreamingFeeModule:

The Streaming Fee Module is a module that accrues streaming fees for Set managers. Streaming fees are denominated as percent per year and realized as Set inflation rewarded to the manager.

Initializing the StreamingFeeModule:

All modules need to be added to the SetToken as the first step. Learn how to add a module to your SetToken in this section.

Once you have added the StreamingFeeModule to the SetToken, you must initialize the SetToken on the StreamingFeeModule:

/**
 * SET MANAGER ONLY. Initialize module with SetToken and set the fee state for the SetToken. Passed
 * _settings will have lastStreamingFeeTimestamp over-written.
 *
 * @param _setToken                 Address of SetToken
 * @param _settings                 FeeState struct defining fee parameters
*/
function initialize(ISetToken _setToken, FeeState memory _settings)

The FeeState struct is constructed as followed:

struct FeeState {
    address feeRecipient;                   // Address to accrue fees to
    uint256 maxStreamingFeePercentage;      // Max streaming fee manager commits to using (1% = 1e16, 100% = 1e18)
    uint256 streamingFeePercentage;         // Percent of Set accruing to manager annually (1% = 1e16, 100% = 1e18)
    uint256 lastStreamingFeeTimestamp;      // Timestamp last streaming fee was accrued
}

The feeRecipient is the address where streaming fees will accrue.

The maxStreamingFeePercentage is the max streaming fee that the manager commits to charging. The manager will be able to change streaming fees below that amount. This is denominated in percentages (1e16).

The streamingFeePercentage is the percent of Set accruing to manager annually.

The lastStreamingFeeTimestamp is the timestamp of last streaming fee was accrued. The module will set this parameter as the current block timestamp, so you can pass in any value here (e.g. 0).

Accruing Fees:

Anyone can call the accrueFee function to mint streaming fees to the fee recipient. Streaming fees are calculated as a total inflation percentage. Position units are adjusted down (in magnitude) in order to ensure full collateralization of the SetToken.

/*
 * Calculates total inflation percentage then mints new Sets to the fee recipient. Position units are
 * then adjusted down (in magnitude) in order to ensure full collateralization. Callable by anyone.
 *
 * @param _setToken       Address of SetToken
 */
function accrueFee(ISetToken _setToken)

Last updated