trn-seed
trn-seed copied to clipboard
added pallet for liquidity pool incentive program
Incentive Pallet
The Incentive pallet is a Substrate pallet that facilitates the creation and management of liquidity pools for various assets. It allows users to stake their assets in these pools and earn rewards in the form of native tokens (e.g., ROOT) based on the pool's performance and the user's stake.
Key Features:
-
Pool Creation: Admins can create incentive pools for specific assets by specifying parameters such as the interest rate, maximum token limit, and the lock period (start and end blocks).
-
Pool Succession: Admins can set up a succession relationship between pools, allowing users to automatically roll over their stakes from one pool to the next upon completion.
-
User Participation: Users can join open pools by staking their assets and optionally choose to roll over their stakes to a successor pool automatically.
-
Reward Calculation: The pallet calculates the rewards for users based on their staked amount, the pool's interest rate, and other factors like the asset's and native token's decimal places.
-
Reward Distribution: Users can claim their rewards after a pool matures (reaches the lock end block). If a user has chosen to roll over, their stake is automatically transferred to the successor pool.
-
Unsigned Transactions: An off-chain worker handles the rollover process via unsigned transactions, moving users' stakes from the predecessor pool to the successor pool automatically.
-
Pool Management: Admins can close pools, and the pallet handles the distribution of remaining rewards and the transfer of locked assets back to the main vault account.
Extrinsic Descriptions:
-
create_pool
: Allows an admin to create a new liquidity pool for a specific asset, setting parameters like interest rate, token limit, and lock period. -
set_pool_succession
: Allows an admin to link a predecessor pool to a successor pool for automatic rollover. -
set_pool_rollover
: Allows users to set their preference for rolling over their stake to a successor pool. -
close_pool
: Allows an admin to close an active pool, preventing new stakes. -
enter_pool
: Allows users to join an open pool by staking their assets. -
exit_pool
: Allows users to exit an open pool and withdraw their staked assets. -
claim_reward
: Allows users to claim their rewards from a matured pool, if no succession is set, the principle is returned as well. -
rollover_unsigned
: An unsigned transaction executed by the off-chain worker to handle the rollover process from a predecessor pool to a successor pool.
he @leo-plugdefi noticed there are couple of commits that aimed to address the team comments, can you please mark which comments are resolved. We will do another round of review once all of the comments are resolved.
@leo-plugdefi can we address the conflicts for another round of reviews.
closed, replaced by PR #841