Add LP staking into Picasso runtime#3504
Add LP staking into Picasso runtime#3504RustNinja merged 34 commits intoComposableFi:mainfrom RustNinja:picasso-lp-staking
Conversation
- update picasso runtime - refactor unit tests - update mock runtime for farming and reward pallet
Refactor reward pallet and remove unused constant from pallet config
add runtime api for reward pallet
Add reward rpc to composable node
|
@kollegian can we test this out please? thanks |
|
@josietyleung this is wip. Writing test plan now. |
Add logs for update reward schedule and remove comments
yes. i checked. i use locally: there are associated pallets. working close with @kollegian to test it together |
fix benchmarking tests for farming pallet.
|
@josietyleung @blasrodri @RustNinja tested lp staking sirs. Other than one bug it seems good. #3555 |
Fix benchmarking tests and cargo clippy
We already discussed with @kollegian and I want to leave explanation here: but actually it is not a bug. this is by design.
Imagine that we want to distribute BTC(it will help us easily understand the logic if we take BTC for example). or some very expensive assets. |
@blasrodri Please re-approve this PR because i push changes and remove commented code. |



This PR added
rewardandfarmingpallets to cover use cases related toLP Reward stakingIntroduced configuration of this pallets to
picasso-runtimeRewardandfarmingpallet contains Mock Runtime and covered by unit tests.rewardpallet stores stakes and claimable reward for LP stakers.farmingpallet provides extrinsics:for Root origin:
update_reward_schedule- create or overwrite the reward scheduleremove_reward_schedule- Explicitly remove a reward schedule and transfer any remaining back to holding accountfor any origin:
deposit- Stake the LP tokens in the reward pool and lock user balances until withdraw action(Store value in reward pallet)withdraw- Unstake the LP tokens from the reward poolclaim- Withdraw any accrued rewards from the reward poolon_initializehook - distribute reward each N block according to scheduled(created byupdate_reward_scheduleextrinsic). User steel need to call extrinsicclaimto move reward fromFarmingAccountto user account.picasson-runtimeimplements two runtime function for rpc endpoints:compute_farming_rewardestimate_farming_rewardconppsable-nodeexposes this RPC endpoints for picasso runtime.