FeiRewardsDistributor

The escrow contract responsible for dripping TRIBE into the staking rewards

Contract

FeiRewardsDistributor.sol implements IRewardsDistributor, CoreRef, Timed

Description

The FeiRewardsDistributor contract is responsible for sending rewards to the FeiStakingRewards contract each week.

It has one public method exposed for keepers to execute this drip functionality, which rewards the caller with a fixed amount of FEI.

Release Schedule

The release schedule for the total reward amount R of TRIBE is a linearly decreasing TRIBE distribution. The distribution function is:

Distribution function for TRIBE

This function has a duration of d before it hits a 0 distribution rate. The area under the curve is R, because the y-intercept is 2R/d, by simply multiplying base times height times 1/2.

Set the "unreleased function" U(t) equal to the area under this curve between the current elapsed time t and the total duration d. Note that for t=d the output is equal to 0 as all of the TRIBE should be released. The formula is:

The unreleased function for FeiPool

Events

Drip
TribeWithdraw
FrequencyUpdate
IncentiveUpdate
StakingContractUpdate
Drip

Sent TRIBE to the FeiStakingRewards contract

type

param

description

address indexed

_caller

account that triggered the drip

uint256

_amount

amount of TRIBE dripped

TribeWithdraw

A withdrawal of TRIBE from the distributor

type

param

description

uint256

_amount

amount withdrawn

FrequencyUpdate

Change the drip frequency

type

param

description

uint256

_amountReward

new drip frequency

IncentiveUpdate

Change in the FEI reward for dripping

type

param

description

uint256

_incentiveAmount

new incentive amount

StakingContractUpdate

A change in the staking contract to send TRIBE to.

type

param

description

address indexed

_stakingContract

the new staking contract

Read-Only Functions

incentiveAmount

function incentiveAmount() external view returns (uint256);

Returns the amount of FEI sent to the caller of drip().

dripFrequency

function dripFrequency() external view returns (uint256);

The minimum frequency allowed between rewards distribution.

isDripAvailable

function isDripAvailable() external view returns (bool);

Returns true if nextDripAvailable() preceeds the current block timestamp

nextDripAvailable

function nextDripAvailable() external view returns (uint256);

The next block timestamp when reward distribution is allowed by the contract. Equals lastDistributionTime() + dripFrequency()

lastDistributionTime

function lastDistributionTime() external view returns (uint256);

The last block timestamp when rewards were distributed from the contract.

stakingContract

function stakingContract() external view returns (IStakingRewards);

The FeiStakingRewards contract address

totalReward

function totalReward() external view returns (uint256);

Returns the total amount of rewards released over the entire window, including claimed, released, and unreleased.

releasedReward

function releasedReward() external view returns (uint256);

Returns the amount of rewardToken available for claiming by the pool. Calculated as rewardBalance() - unreleasedReward().

unreleasedReward

function unreleasedReward() external view returns (uint256);

The unreleased reward function following the formula shown in the Release Schedule section above. It starts at the totalReward() amount and then wind down to 0 over the duration of the window.

rewardBalance

function rewardBalance() external view returns (uint256);

The amount of TRIBE held by the contract, released or unreleased.

distributedRewards

function distributedRewards() external view returns (uint256);

The total amount of TRIBE already distributed to FeiStakingRewards.

EOA-Only 👤 State-Changing Functions

drip

function drip() external returns (uint256);

Sends releasedReward() TRIBE to the stakingRewards() contract and updates the reward rate.

Incentivizes the caller with incentiveAmount() FEI.

Only callable when nextDripAvailable() is below the current block timestamp and the contract is not paused

Governor-Only⚖️ State-Changing Functions

governorWithdrawTribe

function governorWithdraw(uint256 amount) external;

Withdraws amount TRIBE tokens from the pool to Fei Core.

governorRecover

function governorRecover(address tokenAddress, address to, uint256 amount) external;

Recovers tokenAddress ERC20 tokens from the FeiStakingRewards contract to address to. This is used if there were AMM rewards distributed.

setDripFrequency

function setDripFrequency(uint256 _frequency) external;

Sets the frequency with which the contract calls the FeiStakingRewards.

setIncentiveAmount

function setIncentiveAmount(uint256 _incentiveAmount) external;

Sets the incentive amount for calling drip().

setStakingContract

function setStakingContract(address _stakingRewards) external;

Sets the staking contract to send TRIBE to.

ABIs