Skip to content
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

Withdrawing active stake (for user withdrawals) #93

Closed
ruuda opened this issue May 20, 2021 · 4 comments · Fixed by #324
Closed

Withdrawing active stake (for user withdrawals) #93

ruuda opened this issue May 20, 2021 · 4 comments · Fixed by #324
Labels
Milestone

Comments

@ruuda
Copy link
Contributor

ruuda commented May 20, 2021

An idea by Anatoly in the weekly meeting: it’s fine if withdrawals withdraw an activated stake account. That way the user immediately has custody of their funds, and it doesn’t make the user experience worse with respect to the earlier withdrawal note idea, because withdrawals are always going to be a two-step process due to the deactivation period. (Although now that I’m writing this down, with withdrawal notes you could have a bot make a final transfer, so it’s one step + wait for the user, assuming somebody else operates the bot.)

If withdrawals can return an activated stake account, that simplifies things tremendously for us, because we no longer have to track the deactivation process, we can return the stake account right from the stake pool to the user.

@malikankit malikankit added this to the v1 milestone May 30, 2021
@ruuda
Copy link
Contributor Author

ruuda commented Jun 3, 2021

I just realized, if we withdraw active stake, then the rewards for that stake earned over the epoch all go to the withdrawer. If you withdraw early in an epoch that sounds fair, because you held the active stake during most of the epoch. But if you withdraw late in the epoch, that sounds unfair; you get a bonus on top of your withdrawal, and Lido misses out on rewards. See also #136.

@ruuda
Copy link
Contributor Author

ruuda commented Jun 3, 2021

On the other hand, if you withdraw late in the epoch, sure you get a bonus, but if you waited until after the epoch boundary, you could have withdrawn more SOL for the same stSOL. You don’t pay the Lido fee if you withdraw earlier, so get more SOL, but on the other hand you now have an active stake account with a single validator, no longer with a pool ... so you take on the higher risk and get the higher reward, that sounds reasonable actually.

@ruuda
Copy link
Contributor Author

ruuda commented Jul 23, 2021

Summary of off-channel discussion with @enriquefynn:

  • For withdrawals, we can split off a part of an active stake account, and return it as active stake account to the withdrawer.
  • The user will still need to deactivate the stake and wait for it to cool down, so this “cooldown” is still there, only it is no longer our problem.
  • To prevent withdraws from disturbing the balance, we should only allow withdrawals from the validator that is furthest above its target (which if we go with a uniform distribution is just the validator with the most stake), and we should not allow the stake account balance to drop below MINIMUM_STAKE_ACCOUNT_BALANCE (1 SOL at the moment).
    • This means that for large withdrawals, users may need to break them up into multiple smaller ones, but that is fine, withdraw is only for power users anyway.
    • This means that for now, if every stSOL holder wants to withdraw, once there is only 1 SOL per validator left, the remainder cannot be withdrawn. If needed this can be resolved later when we add validator removal, but we don’t expect to decommission Lido anyway, so we shouldn’t end up in this situation anyway. E.g. if every validator themselves puts in 1 SOL without the intention to withdraw, then every user who wants to withdraw will be able to.
  • If a large amount portion of stake is still activating, withdrawals may temporarily be limited, because there is no active stake to split from, but that problem goes away after one epoch.

So withdrawals may be a lot simpler than we expected!

@malikankit malikankit changed the title Withdrawing active stake Withdrawing active stake (for withdrawals) Jul 26, 2021
@malikankit malikankit changed the title Withdrawing active stake (for withdrawals) Withdrawing active stake (for user withdrawals) Jul 26, 2021
@ruuda
Copy link
Contributor Author

ruuda commented Jul 28, 2021

I wrote a summary of how staking on Solana works, how we propose to do withdrawals in Solido, and the concerns I could think of. It also goes over the Eth2 concerns linked in #136 (comment). Feedback is welcome.

https://docs.google.com/document/d/19SGw6EUNdbcagjaLtGEV-v8Q2-WYAaI2_HTALD_ZZXU/edit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants