8000 GitHub - pcanwar/DeFiEngine: innovative defi to earn dynamic rewards with incentives tailored to staking duration and amount
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

innovative defi to earn dynamic rewards with incentives tailored to staking duration and amount

Notifications You must be signed in to change notification settings

pcanwar/DeFiEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Staking Rewards Contract

The contract allows users to stake ERC20 tokens in exchange for rewards. Users can stake tokens, withdraw their staked tokens, and claim rewards based on their staking duration and the amount staked.

Overview

Key Features

  • Staking: Users can stake ERC20 tokens.
  • Withdrawal: Users can withdraw their staked tokens.
  • Reward Claiming: Users can claim rewards based on their staking activity.
  • Incentives: Reward multipliers based on staking duration and amount.

Mathematical Formulas

  1. Reward Per Token Calculation:

    accumulatedRewardPerToken = accumulatedRewardPerToken + 
    ((block.timestamp - lastRewardUpdate) * baseRewardRate * 10^tokenDecimals) / totalStaked
  2. Total Earned Rewards Calculation:

    totalRewards = sum(calculateEarnedRewards(events[i], account) for i in range(staker.processedIndex, len(events)))
  3. Earned Rewards Calculation:

    earnedRewards = (stakingEvent.amount * combinedMultiplier * baseRewardRate * stakingDuration) / 10^tokenDecimals

    where:

    combinedMultiplier = (timeMultiplier * tierMultiplier) / 10^tokenDecimals

Note: Development on this contract is ongoing, and additional features and advanced improvements are planned in future commits

About

innovative defi to earn dynamic rewards with incentives tailored to staking duration and amount

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0