Set Documentation
Search…
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:
1
/**
2
* SET MANAGER ONLY. Initialize module with SetToken and set the fee state for the SetToken. Passed
3
* _settings will have lastStreamingFeeTimestamp over-written.
4
*
5
* @param _setToken Address of SetToken
6
* @param _settings FeeState struct defining fee parameters
7
*/
8
function initialize(ISetToken _setToken, FeeState memory _settings)
Copied!
The FeeState struct is constructed as followed:
1
struct FeeState {
2
address feeRecipient; // Address to accrue fees to
3
uint256 maxStreamingFeePercentage; // Max streaming fee manager commits to using (1% = 1e16, 100% = 1e18)
4
uint256 streamingFeePercentage; // Percent of Set accruing to manager annually (1% = 1e16, 100% = 1e18)
5
uint256 lastStreamingFeeTimestamp; // Timestamp last streaming fee was accrued
6
}
Copied!
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.
1
/*
2
* Calculates total inflation percentage then mints new Sets to the fee recipient. Position units are
3
* then adjusted down (in magnitude) in order to ensure full collateralization. Callable by anyone.
4
*
5
* @param _setToken Address of SetToken
6
*/
7
function accrueFee(ISetToken _setToken)
Copied!
Last modified 8mo ago