lens
lens copied to clipboard
Add possibility to compound daily / weekly Staking/Liquidity Pools rewards
I think this feature should be under a lens start
. The staking rewards will be relatively straightforward but the LP pools on osmosis will require importing osmosis code (which could cause dependency issues). Would also prefer to have instructions for setting up and using authz before building this feature, but this is def something we need to do. So list of tasks here:
- [ ] Have instructions/commands for connecting a ledger to
lens
and useauthz
commands to delegate the ledger (keyring-backend: os
) farming tx permission (MsgDistributionWithdrawRewards
,MsgStakingDelegate
,MsgOsmosisLPStuff
, etc...) to akeyring-backend: test
wallet. Also send it some $$ for fees - [ ] write up
lens start autocompound
- [ ] instructions on how to use and documentation of security concerns.
I'd imagine this is how it would work?:
From a user’s perspective, there should be two things that need to be done in order to automatically compound their staking rewards:
-
lens daemon init staking <chains> <key_name> <grant_key_name> <validators>
(abstracts the several authz commands that'd need to be run) -
lens daemon start staking <chains>
Initialization would:
- generate softkeys required for sending out
MsgWithdrawRewards
,MsgDelegate
and any other messages needed - store information needed in configuration (key names, enabled chains, etc.)
When started, the daemon would:
- Gather epoch frequency from enabled chains
- Startup goroutines that sleep until before every epoch/set frequency
- The goroutines would send out
MsgWithdrawRewards
andMsgDelegate
- Gather metrics on successful / failed txs?
I have been thinking about this and the most secure way of doing this would be to authorize one account to withdraw rewards and retake them on behalf of your main accounts without giving it the right to hold onto or transfer the funds.
The flow would be, submit authz txs to auothrize one account to have permission to withdraw and retake rewards, then set a list of accounts on various chains in a .toml file that the compounder should submit txs for.