BeanstalkFarms/Beanstalk

RFC: Dynamic Seeds per BDV

Closed this issue · 0 comments

Brean0 commented

Summary

  • Introduce granularity in seed issued per BDV for an given whitelist asset.
  • Introduce the ability to change the seeds per BDV for an given whitelisted asset.

Problem

Various inefficiencies are present within Beanstalk:

  1. The seeds given per BDV for an asset is static and only can be set upon whitelist. This limits control in what beanstalk can adjust. By allowing the seeds per BDV to be dynamic, beanstalk obtains an additional layer of parameters to utilize for peg maintenance (i.e assigning seed parity for unripe assets).
  2. Seeds are implemented without decimals, reducing the precision for beanstalk to set seeds.
  3. Older deposits are at risk of losing stalk when converting from an asset with a higher seeds per BDV, to a lower seeds per BDV.

Proposed Solution

  • Introduce a cumulativeStalkPerBdv counter, or “stem”, for each Whitelisted Silo Token.
    The cumulative grown stalk per bdv, or “stem tip” for a token increases every season to reflect the amount of stalk grown per BDV of deposited value. This starts at 0 at the time of stem deployment for each whitelisted token, or when a new token is whitelisted.

  • Index Deposits based on cumulativeStalkPerBdv or stem instead of Season

  • A higher culumativeStalkPerBDV for a deposit means that the user deposited in a later season.

  • Make claiming Grown Stalk token specific, since stalk now grows in different rates per asset.
    Introduce decimals at the stalkEarnedPerSeason level (seeds), 6 decimal places

  • Modify existing SiloFacet, ConvertFacet and other facet functions to use stems

  • Add a mowAndMigrate migration function, to migrate users from silo V2 to silo V3.

  • Split up SiloFacet logic into MigrationFacet and ApprovalFacet to reduce the SiloFacet size.