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

Document Superfluid state machine itself #1073

Closed
Tracked by #30
czarcas7ic opened this issue Mar 10, 2022 · 1 comment · Fixed by #1283
Closed
Tracked by #30

Document Superfluid state machine itself #1073

czarcas7ic opened this issue Mar 10, 2022 · 1 comment · Fixed by #1283
Assignees
Labels
T:task ⚙️ A task belongs to a story

Comments

@czarcas7ic
Copy link
Member

czarcas7ic commented Mar 10, 2022

Assigned to @ValarDragon for coming up with some plan for how to improve from here

@czarcas7ic czarcas7ic added the T:task ⚙️ A task belongs to a story label Mar 10, 2022
@ValarDragon ValarDragon self-assigned this Mar 14, 2022
@ValarDragon
Copy link
Member

Describe the overall flow of the superfluid module.

We should make a description that describes the goal (allow LP shares / defi items to help secure consensus in staking). And then note how we achieve this, by using four things:

  • Guaranteed lock durations from the underlying lockup module
  • Intermediary accounts, noting that rewards are linear based on how much you have locked for a given (validator, denomination) pair.
  • Tracking the amount you have superfluidly staked using the lockup module
  • Using the existing gauge reward system for paying out SFS rewards

Details

Then the two main pieces of complexity we should talk about are:
(1) SFS requires actually minting new osmo (also why, and why its safe)
(2) How daily refreshes to staked amount work. Its probably useful to ideate a diagram here, to show that on epoch, we read from the lockup module how much GAMM token we have locked. We get the new oracle price. Then we see is that more or less than we have delegated. If more, mint osmo and update amount delegated. If less, do some 'instant undelegations' and immediately burn.

Then describe at a high level how bonding, unbonding and slashing works.

Bonding:

  • Should talk about the osmo minting
    Unbonding:
  • Moves the tracker for unbonding, allows the underlying lock to start unlocking if desired
    Slashing:
  • Gathers who was SFS delegated to the validator at the height. Slashes their underlying lock collateral.
  • At the moment we do the weaker security thing, of slashing at latest price rather than old price.
    Bank:
  • Osmo supply queries are preserved

State machine

Then describe how every message is processed, hook is dealt with, and epoch update works. (This may just be refining whats already written)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:task ⚙️ A task belongs to a story
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants