lens icon indicating copy to clipboard operation
lens copied to clipboard

Add possibility to compound daily / weekly Staking/Liquidity Pools rewards

Open yacinefrom0 opened this issue 3 years ago • 3 comments

yacinefrom0 avatar Jan 01 '22 15:01 yacinefrom0

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 use authz commands to delegate the ledger (keyring-backend: os) farming tx permission (MsgDistributionWithdrawRewards, MsgStakingDelegate, MsgOsmosisLPStuff, etc...) to a keyring-backend: test wallet. Also send it some $$ for fees
  • [ ] write up lens start autocompound
  • [ ] instructions on how to use and documentation of security concerns.

jackzampolin avatar Jan 02 '22 17:01 jackzampolin

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:

  1. lens daemon init staking <chains> <key_name> <grant_key_name> <validators> (abstracts the several authz commands that'd need to be run)
  2. 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:

  1. Gather epoch frequency from enabled chains
  2. Startup goroutines that sleep until before every epoch/set frequency
  3. The goroutines would send out MsgWithdrawRewards and MsgDelegate
  4. Gather metrics on successful / failed txs?

Zygimantass avatar Jan 04 '22 00:01 Zygimantass

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.

tac0turtle avatar Jan 25 '22 10:01 tac0turtle