-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LP staking into Picasso runtime #3504
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
reward
andfarming
pallets to cover use cases related toLP Reward staking
Introduced configuration of this pallets to
picasso-runtime
Reward
andfarming
pallet contains Mock Runtime and covered by unit tests.reward
pallet stores stakes and claimable reward for LP stakers.farming
pallet 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_initialize
hook - distribute reward each N block according to scheduled(created byupdate_reward_schedule
extrinsic). User steel need to call extrinsicclaim
to move reward fromFarmingAccount
to user account.picasson-runtime
implements two runtime function for rpc endpoints:compute_farming_reward
estimate_farming_reward
conppsable-node
exposes this RPC endpoints for picasso runtime.