Ring Protocol
Search…
RingRewardsDistributor
The escrow contract responsible for dripping RING into the staking rewards

Contract

Description

The RingRewardsDistributor contract is responsible for sending rewards to the RingStakingRewards contract with weekly frequency.
It has one public method exposed for keepers to execute this drip functionality, which rewards the caller with a fixed amount of RUSD.

Release Schedule

The release schedule for the total reward amount R of RING is a linearly decreasing RING distribution. The distribution function is:
Daily Distribution
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 RING should be released. The formula is:
Total Unreleased

Events

Drip
RingWithdraw
FrequencyUpdate
IncentiveUpdate
StakingContractUpdate
Sent RING to the RingStakingRewards contract
type
param
description
address indexed
_caller
account that triggered the drip
uint256
_amount
amount of RING dripped
A withdrawal of RING from the distributor
type
param
description
uint256
_amount
amount withdrawn
Change the drip frequency
type
param
description
uint256
_amountReward
new drip frequency
Change in the RUSD reward for dripping
type
param
description
uint256
_incentiveAmount
new incentive amount
A change in the staking contract to send RING to.
type
param
description
address indexed
_stakingContract
the new staking contract

Read-Only Functions

incentiveAmount

1
function incentiveAmount() external view returns (uint256);
Copied!
Returns the amount of RUSD sent to the caller of drip().

dripFrequency

1
function dripFrequency() external view returns (uint256);
Copied!
The minimum frequency allowed between rewards distribution.

isDripAvailable

1
function isDripAvailable() external view returns (bool);
Copied!
Returns true if nextDripAvailable() preceeds the current block timestamp

nextDripAvailable

1
function nextDripAvailable() external view returns (uint256);
Copied!
The next block timestamp when reward distribution is allowed by the contract. Equals lastDistributionTime() + dripFrequency()

lastDistributionTime

1
function lastDistributionTime() external view returns (uint256);
Copied!
The last block timestamp when rewards were distributed from the contract.

stakingContract

1
function stakingContract() external view returns (IStakingRewards);
Copied!
The RingStakingRewards contract address

totalReward

1
function totalReward() external view returns (uint256);
Copied!
Returns the total amount of rewards released over the entire window, including claimed, released, and unreleased.

releasedReward

1
function releasedReward() external view returns (uint256);
Copied!
Returns the amount of rewardToken available for claiming by the pool. Calculated as rewardBalance() - unreleasedReward().

unreleasedReward

1
function unreleasedReward() external view returns (uint256);
Copied!
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

1
function rewardBalance() external view returns (uint256);
Copied!
The amount of RING held by the contract, released or unreleased.

distributedRewards

1
function distributedRewards() external view returns (uint256);
Copied!
The total amount of RING already distributed to RingStakingRewards.

EOA-Only 👤 State-Changing Functions

drip

1
function drip() external returns (uint256);
Copied!
Sends releasedReward() RING to the stakingRewards() contract and updates the reward rate.
Incentivizes the caller with incentiveAmount() RUSD.
Only callable when nextDripAvailable() is below the current block timestamp and the contract is not paused

Governor-Only⚖️ State-Changing Functions

governorWithdrawRing

1
function governorWithdraw(uint256 amount) external;
Copied!
Withdraws amount RING tokens from the pool to Ring Core.

governorRecover

1
function governorRecover(address tokenAddress, address to, uint256 amount) external;
Copied!
Recovers tokenAddress ERC20 tokens from the RingStakingRewards contract to address to. This is used if there were AMM rewards distributed.

setDripFrequency

1
function setDripFrequency(uint256 _frequency) external;
Copied!
Sets the frequency with which the contract calls the RingStakingRewards.

setIncentiveAmount

1
function setIncentiveAmount(uint256 _incentiveAmount) external;
Copied!
Sets the incentive amount for calling drip().

setStakingContract

1
function setStakingContract(address _stakingRewards) external;
Copied!
Sets the staking contract to send RING to.

ABIs

irewardsdistributor.json
3KB
Binary
RewardsDistributor Interface ABI
Last modified 4mo ago