Functions
Here is a summary of views and functions
Last updated
Here is a summary of views and functions
Last updated
User functions
Once funded, the rewarded_token cannot be removed from a pool.
Must be called under ESDTTransfer function.
Transferred token will be set as reward (rewarded_token).
The staked_token define what token users will have to stake to harvest rewards
This function have a 10% default deposit fee for new pools. Fees can be cut forever on a pool with a $MID payment with removePoolFees function
Must be called under ESDTTransfer function.
Transferred token will be set as a staked_token.
User will have to choose the rewarded_token he want as reward
Allow to remove staked_token from a pool.
Time spent in pool will be reseted and calculated rewards harvested.
If opt_unstake_amount is not set the unstaked amount will be set to user max user position.
Will calculate rewards from the pool for user and send them to his wallet.
Time spent in pool will be reseted
Will calculate rewards from the pool. But instead to send rewards to user's wallet his position will be compounded.
Time spent in pool will be reseted
Must be called under ESDTTransfer function.
This function will set to 0% the fees deposit of tokens in a pool. It can be called before the first deposit. The payment will be added to MID:MID pool as a staking rewards minus the fees set in MID:MID pool.
Owner functions
Edit the configuration of a pool :
fees : Percentage of deposited token redirected to the "fee_wallet"
burn : Percentage of deposited token redirected to the "burn_wallet"
blocks_to_max : Configure the pool speed. Allowing to slow down or speed up rewards distribution of the pool.
Edit configuration
def_staked_token : Set the main token that will be used as payement
fee_wallet : set the wallet that will receive fees tokens
burn_wallet : set the wallet that will receive burn tokens
remove_fees_price : define price in main token to remove fees from a pool
Pause functions of contract : fund, stake, stakeRewards, removePoolFees
Users can still unstake and claimRewards from all pools
Pause main functions of a specific pool : fund, stake, stakeRewards, removePoolFees
Users can still unstake and claimRewards from the pool
If a pool did not received any new fund after one year and is paused. This function allow to remove the pool from the contract and send all staked tokens to respective users. if some rewards are still in the pool, they will first be distributed to removed users based on their share and time spent in pool. The very last remaining tokens will then be sent to the burn wallet.
View functions
This array represent the list of tokens that can be staked in contract to get rewards
This array represent the list of tokens that can be harvested for a specific staked token creating a staking pool from a pair staked_token:rewarded_token
This array return the address list of participants in a specific pool
Return pool information :
balance : Tokens availaibles as reward
total_stake : Tokens staked by users
total_rewarded : All time rewarded since the first fund
fee_percentage : Fund percentage (default 10%)
burn_percentage : "Burn" percentage (default 0%)
last_fund_block : Block of the last fund deposit
paused : Is the pool fund/stake/stakeRewards paused ?
blocks_to_max : Number of blocks a user has to stay in pool to claim 100% of his pool share. (default 5 256 000 ~one year)
Return user participation information in pool :
stake_amout : The amount of token staked by user
last_action_block : Last block since the user has called one of the stake/unstake/claimRewards/stakeRewards function
Compute the current theoretical available rewards for user in pool.
{stake_amout} * {%} / {total_stake} * {balance} / {%} * {last_action_block} / {blocks_to_max} = theoretical rewards
Only for pools where staked_token = rewarded_token