Skip to content

[WIP] mev claim instructions#1

Open
jgur-psyops wants to merge 7 commits intomainfrom
mev-claim-fix
Open

[WIP] mev claim instructions#1
jgur-psyops wants to merge 7 commits intomainfrom
mev-claim-fix

Conversation

@jgur-psyops
Copy link

Claiming MEV rewards (which are just SOL chilling in the pool_stake account), will be a two-step process:

  1. process_initialize_temp_stake creates a second single-pool program owned stake account just like the main pool and sweeps all the excess SOL into it
  2. process_merge_temp_stake merges the temp pool into the main pool, without claiming any vouchers, which automatically splits that stake among depositors

WIP

  • An attacker can deposit -> process_merge_temp_stake -> instantly withdraw to steal some MEV.
  • Deposit should now (1) check that process_initialize_temp_stake has run recently (let's say one month) or fail (if the pool itself is less than one month old, we also allow the deposit), (2) check if process_merge_temp_stake is eligible to run (the temp stake account is active) and crank it if so.
  • We may want to add some small SOL incentive to running the crank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant