Reward Manager
The reward manager can be called from any other contract that handles rewards. But its primary purpose is to handle rewards for swapping ctAssetTokens against treasury tokens (see Concrete Swapper).
The reward manager holds a set of incentive parameters with respective setters and getters and a function that calculates the reward percentage. It inherits from the Ownable trait and designates one owner that has previleges to alter the parameters.
Parameters
The central data object is the struct SwapperRewards that holds various parameters that ultimately determine the reward rate (percentage) for the swapper premium exchange rates (oracle_price * reward_rate), which we discuss below:
struct SwapperRewards {
uint16 baseRewardrate;
uint16 maxProgressionFactor;
uint176 progressionUpperBound;
uint16 bonusRewardrateUser;
uint16 bonusRewardrateCtToken;
uint16 bonusRewardrateSwapToken;
}
Note: All reward rates are quoted in Basispoints, so the uint16 is sufficient to hold values less than or equal to 10000.
Calculating the Swapper Reward Rate
The Swapper calls the Reward Manager to get a quote for the reward rate (in basispoints). To that end the Reward Manager exposes the following function
function quoteSwapperRewardrate(address user, address ctAssetToken, address rewardToken, uint256 ctAssetAmountInStables) external view returns(uint256 rewardRate)
Thus the user, the ctAssetToken, the rewardToken and the ctAssetAmountInStables (USD in this case) are used to determine the reward rate.
There is a baseRewardrate that sets the reward rate, irrespective of the assets and user. Then on top of that token-specific and user-specific reward rates are added. The bonusRewardrateCtToken, the bonusRewardrateSwapToken and the bonusRewardrateUser are globally set flat rates that handle this for all enabled tokens and users. If a ctAssetToken is whitelisted for the bonus reward, then it gets that extra rate, likewise for the swapped token (reward token in the treasury) or the user. If a certain ctAssetToken needs to be acquired by the treasury and a certain token needs to be sold from the treasury or a certain contract or externally owned account should be encouraged, they can be enabled for some bonus reward. For instance if these rates are all at 100 Basispoints (1%) and if ctETH and a hypothetical ASSET token and a user Alice are all enabled for the respective bonuses, then we obtain
Rewardrate = baseRewardrate + bonusRewardrateCtToken + bonusRewardrateSwapToken + bonusRewardrateUser = 4%
There is also a way to have a non-flat (progressive) reward rate. The more it is deposited (i.e. swapped against the reward) the higher the reward. This is handled through the two parameters maxProgressionFactor and progressionUpperBound. The first one is the maximum additional rewardRate that is added to the baseRewardrate. If the swapped amount in USD exceeds the progressionUpperBound, then the max progression factor is added. If the swapped amount is below that then the following progressive rate is added:
progressiveRate = swappedAmountInUSD * maxProgressionFactor / progressionUpperBound
Last updated