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

Reward Distributor

Function getAllRecipients()

Returns all activated staking contracts.

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

Staking Pool

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


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;

Last updated