dForce | Developers
  • Introduction
  • Lending Protocols
    • Yield Markets
      • Architecture
      • Modules
      • Contracts
      • Security
      • Interface
    • Lending & Synthetic Assets
      • iTokens
      • Controller
      • iMSDTokens
      • MSDController
      • Price Oracle
      • Reward Distribution
      • Security
      • Deployed Contracts
      • Glossary
    • Vaults
  • Liquidity Protocols
    • dForce Trade
    • Liquidity Mining
  • DF Staking
    • Free Staking
    • Lock-up Staking
Powered by GitBook
On this page
  • How to calculate staking annual yield?
  • Deployed Contracts
  • Reward Distributor
  • Staking Pool

Was this helpful?

  1. Liquidity Protocols

Liquidity Mining

Active liquidity mining contracts are all here

How to calculate staking annual yield?

For example, in USX/DF staking pool,

  1. Get the price in USD of all assets, in this case, that would be USX and DF, assumption that the price is pUSX and pDF;

  2. Get total balance of USX and DF deposited in the LP contract, say tbUSX and tbDF;

  3. Calculate 1 LP token value should be:

    vLP = (pUSX * tbUSX + pDF * tbDF) / LP.totalSupply;

  4. Get total balance deposited in staking contract, say tbLP, then the total value of deposited LP tokens should be:

    tvLP = vLP * tbLP;

  5. Get reward rate from staking contract, this variable represents the distributed amount of reward token per block, in Ethereum Mainnet, the block period is ~13 seconds (for BSC, it's about 3 seconds per block), so distribution value per year is:

    tvR = pDF * RR(RewardRate) * blockPerYear;

    blockPerYear = 3600 * 24 * 365 / block_peroid;

  6. The annual yield should be:

    annual_yield = tvR / tvLP * 100%;

Deployed Contracts

Name
Address

Reward Treasury

UNISWAP - ETH/DF

Name
Address

Reward Treasury

DODOEX - USX/BUSD

Name
Address

Reward Treasury

DODOEX - USX/USDC

DODOEX - USX/EUX

Curve - USX/2CRV

Name
Address

Reward Treasury

Name
Address

Reward Treasury

Reward Distributor

Function getAllRecipients()

Returns all activated staking contracts.

  function getAllRecipients()
    public
    view
    returns (address[] memory _allRecipients)

Staking Pool

Every staking pool shares the same interface for users depositing/withdraw LP tokens and claim their rewards.

Variables

Name

Descriptions

address rewardToken

reward token address.

uint256 rewardRate

amount of reward token will be distributed per block.

uint256 startTime

timestamp for starting to distribute reward,

who deposits before this time will not get any reward.

function rewardDistributed()

Returns the total distributed amount since start time.

function rewardDistributed() public view returns (uint256);

function earned()

Returns the up-to-date amount of reward to be claimed.

function earned(address _account) public view returns (uint256);

function stake()

Deposit LP token into staking pool.

function stake(uint256 _amount) public;

function withdraw()

Withdraw LP token from staking pool.

function withdraw(uint256 _amount) public;

function getReward()

Claim rewards.

function getReward() public;

function exit()

Withdraw all LP tokens and claim rewards.

function exit() external;
PreviousdForce TradeNextFree Staking

Last updated 2 years ago

Was this helpful?

0x1D22AFC7dc4Bf336532dd6248d453C647CecA1B3
0xFe599129B3018eE3231334d02E0b869a19dB3F8b
0x959715da68DC2D1329F4bb34e13Da03FE10c374b
0x8d61b71958dD9Df6eAA670c0476CcE7e25e98707
0xc0Dc7C5057141C9065bd9bedf79fd4E9EA69a739
0xAa6E14e99E3b7B71ca163AA82384Ed68F9067Dd7
0xd0BaA984Cd2D25A555710B4f199e873Af668866a
0xcdc46a2393706b33ee22a1b8316b8348312212b2
0x7B598182875Df02236eEa8a3e264f9376511D5ad
0x958b0166B9De547a1998cc06A55c4fa5B4304d0d