Giter Club home page Giter Club logo

distribute-by-locked-vote-weight's Introduction

Description

This program can be used to distribute tokens to users. Users get a fraction of the allocated funds, based on their locked vote weight at some point in the future.

Example:

  • create_distribution with
    • registration_end_ts = one month from now: This is when the register phase ends and the claim phase begins.
    • weight_ts = one year from now: This is the time for which eligible locked vote weight will be calculated.
    • a specific voter-stake-registry registrar
  • deposit tokens to the ATA of the distribution
  • anyone with a voter account on the voter-stake-registry registrar can register with the distribution by calling create_participant
  • if participants lock up more tokens before registration_end_ts, they can call update_participant to register their new weight
  • when registration_end_ts is reached, the claim instruction becomes available
  • anyone who's previously registered can claim their share of the deposited tokens, closing their participant account

How is the vote weight used exactly?

When users call create_participant their vote weight at weight_ts is calculated, counting only vote weight generated from tokens that are guaranteed to still be locked at that point in time.

For example, weight_ts could be registration_end_ts, allowing anyone to register who has tokens that will still be locked at that time.

Another option is to set weight_ts to a point further in the future. The effect is that a longer minimum lockup time is required for people to be able to claim a part of the distributed tokens.

Concrete examples for

lockup_saturation = 5y
lockup_bonus = 1x
weight_ts = 2y in future
user_token_amount = 1000
  1. You have less than a two-year lockup: You have no weight and can't register.
  2. You have a three-year cliff lockup: Your weight is the bonus vote weight produced by a one-year cliff lockup: 200.
  3. You have a five-year constant lockup: Your weight is the bonus vote weight produced by a three-year cliff lockup: 600.
  4. You have a five-year monthly vested lockup: Your weight is the bonus vote weight produced by the 600 tokens that'll still be locked in two years, adjusted for their vesting points. That means 185.

License

This code is currently not free to use while in development.

distribute-by-locked-vote-weight's People

Contributors

ckamm avatar silas-x avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sethdford

distribute-by-locked-vote-weight's Issues

Syncing mental model

So I am assuming CreateDistribution would be called by the dao? Can we have multiple distributions running parallely? Update: I see an index in pda derivation, I am assuming yes

The funds to be distributed e.g. fees earned by mango would be then transferred to the vault of the Distribution? So we would need proposals every month or whatever?

The participant will be newly created per distribution? Update: I see a close particpant todo in claim ix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.