EUSDMiningIncentives
Contract Overview
EUSDMiningIncentives is a stripped down version of Synthetix StakingRewards.sol, to reward esLBR to eUSD&peUSD minters.
Differences from the original contract:
totalStaked and stakedOf(user) are different from the original version.
When a user's borrowing changes in any of the Lst vaults, the
refreshReward()
function needs to be called to update the data.This contract requires users to stake LP tokens in the StakingRewardsV2 contract with a value exceeding the minDlpRatio proportion of stakedOf(user). Otherwise, the mining rewards of the user can be purchased by others using LBR or eUSD at a value proportional to the biddingFeeRatio.
Function Documentation
totalStaked
View function to get the total amount of staked EUSD.
It iterates through the vaults array and retrieves the total circulation of each asset pool using the getPoolTotalCirculation() * function from the ILybra interface. The total staked amount is calculated by multiplying the total circulation by the vault's * weight (obtained from configurator.getVaultWeight()).
stakedOf
Returns the total amount of eUSD and PeUSD borrowed by a specific user.
Parameters:
Similar to totalStaked()
, stakedOf(address user)
is equal to the sum of the user's borrowing amount in each vault multiplied by the weight of that vault.
stakedLBRLpValue
Returns the value of the user's staked LP tokens in the ETH-LBR liquidity pool.
lastTimeRewardApplicable()
lastTimeRewardApplicable()
Returns the last time when the reward was applicable.
rewardPerToken()
rewardPerToken()
Calculates and returns the current reward per token.
Returns: The reward per token.
refreshReward
Updates the user's claimable reward data and records the timestamp.
getBoost
Calculates and returns the boost for a user.
Returns: The user's boost value.
earned
Calculates and returns the total earned rewards for a user.
Returns: The total earned rewards.
isOtherEarningsClaimable
Checks if the user's earnings can be claimed by others.
Returns: A boolean indicating if the user's earnings can be claimed by others.
getReward
Claims the earned rewards for the calling user.
buyOthersEarnings
Allows the caller to purchase the earnings from multiple users.
Last updated