Farming v2 is only deployed to the Moonriver and Moonbeam networks, and the Bifrost network follows a different mechanism, please refer to the next section.
Farming v2 is an improved version of Farming v1, which solves the problems of Farming v1 such as the inability to add multiple reward tokens and the need to frequently migrate LP tokens, it provides users with a more simple and convenient staking/farming experience.
Reward Token: denotes the reward tokens for LPs that contribute liquidity to the pool, and a pool can have multiple reward tokens
Reward Release Rate: denotes X reward tokens per block
Minimum Rewards Claimable Interval: the block interval between two adjacent reward-claimable time points
Claimable Reward Block: "Start Block" + n * "Minimum Rewards Claimable Interval", where n ≥ 1. For example, if "Start Block" is 100 and "Minimum Rewards Claimable Interval" is 200, then "Claimable Reward Block" will be [300, 500, 700...]
Next Claimable Reward Block: The closest "Claimable Reward Block". Referring to the above example, suppose the "Current Block" is 450, then the "Next Claimable Reward Block" is 500 (the conversion to time will be displayed in the Zenlink DEX DApp front-end)
Active: denotes the status of farming in progress (the "long term" of the front-end display does not mean permanent, it means a continuous state where rewards do not stop.)
Ended: denotes the status of the end of farming (stop incentivizing the pool with the reward release rate of 0)
- Farming v2 uses only one long-term contract to manage and run all farming pools, users no longer need to redeem staking tokens after a period of time and re-stake in new farming pools, once you have staked tokens you will continue to earn rewards until the rewards in the pool are fully released or you actively redeem your tokens.
- Stake tokens must be ERC20 tokens (XC-20s), which can be LP Tokens or single tokens (ZLK, WMOVR, WGLMR, BNC, etc.). For a given stake token, multiple farming pools can be created with one or more reward tokens and different “reward release rates”.
- All farming pools will have a “minimum rewards claimable interval”, which is uniform for all, and each account can claim rewards only once in each interval, users can refer to the countdown displayed on the Zenlink DEX frontend to get the next claimable reward time.
- Rewards are released on a block-by-block basis, and the daily rewards shown on the Zenlink DEX DApp front-end page are calculated from the rewards contained in each block (i.e. the reward release rate) and converted over time.
Rewards are calculated based on every block. In a block, a user’s reward allocation is equal to his share times the reward rate.
- Reward_i, rewards that a user can get in block i
- Share_i, pool share that a user have in block i
- Rate_i, reward rate in block i
Because some on-chain actions would cause the farming pool status change, for example, other users execute deposit/redeem action, or the reward rate needs to be adjusted. It means that a user’s pool share is variable, so the accumulated reward cannot be simply obtained by multiplication. It should be given by the following formula:
- Reward_T, total reward
- Reward_i, rewards that a user can get in block i
- m, the block num when a user deposits
- n, the block num when a user redeems
Users can claim rewards once in each reward interval, please refer to the countdown displayed on the front end of Zenlink DEX DAPP for the specific time to claim rewards.
On the Bifrost side, the user can always claim rewards at any time without any restrictions except for ZLK staking, so the following section will focus on the ZLK staking mechanism on Bifrost. (Not related to other faming pools on Bifrost)
Redeem Limit Time: denotes the time interval between the confirmation of redemption and the withdrawal of funds to the account
Unlock Limit Numbers: denotes the maximum numbers of unlocks available for an account in a pool
Unlocks: the status indicating that the funds have ended the redeem limit time and can be redeemed to the account at any time
Pending Unlocks: the status of being in redeem limit time
Pending Unlock Numbers: denotes the sum of the number of orders in both unlocks and pending unlocks, but it should always be less than the unlock limit numbers
- When a user wants to make a redeem, a confirmation of the redeem will be made first, and once the user has successfully submitted a confirmation transaction for the redeem, the redeem will enter the Pending Unlocks status, and rewards will be claimed.
- When the Redeem Limit Time is over, the order will enter the Unlocks state.
- When there are available orders in Unlocks status, users will be able to unlock all available unlock orders and redeem the corresponding funds with one click by clicking on Unlock button.
- The total number of orders in the Pending Unlocks and Unlocks states is always less than the Unlock Limit Numbers, otherwise, the redeem operation will not be available.
- Orders in both Pending Unlocks and Unlocks status can be canceled and the available unlock numbers will be released. Once the order is canceled, the funds will be re-staked to the pool and the reward will be recalculated.