CarmineOptions / konoha

A toolkit for DAO-like governance on Starknet
Apache License 2.0
29 stars 43 forks source link

ODHack: Suggest and implement an alternative function for staking curve #82

Open tensojka opened 4 months ago

tensojka commented 4 months ago

Research staking curves of various protocol and select one staking curve and implement it in staking.cairo

Expected skill level: experienced Cairo and/or smart contract developer. This is a complex task.

Definition of Done

The Cairo code works as expected, has nearly full test coverage, is reasonably documented (docstrings or similar suffice) and readable.

Oshioke-Salaki commented 4 months ago

Can u handle this

tensojka commented 4 months ago

@Oshioke-Salaki Refer to CONTRIBUTING.md on how to claim a complex task, thanks

princeibs commented 4 months ago

I would like to take this task.

vibenedict commented 4 months ago

i will like to jump on it

tensojka commented 4 months ago

@princeibs @vibenedict @Oshioke-Salaki I'm missing details on how specifically you are planning on handling this task. Where would you look for staking curves? Which ones do you have in mind?

KeneePatel commented 4 months ago

Hello @tensojka,

I will try to tackle this issue. Just a short introduction about myself. I am a grad student with a bit of experience in open source contribution. I am more inclined towards having backend tasks because I enjoy its complexities and I just like playing with data.

Here is how I will try to tackle this issue.

Note: I am not that comfortable with Cairo lang, so I will be relying on help at times with the implementation and test part, so please help out with that when in need.

tensojka commented 4 months ago

@KeneePatel Okay, thanks, looks great, assigned you! Good luck and don't hesitate to reach out regarding Cairo

tensojka commented 3 months ago

@KeneePatel No PR from you, unassigning you, okay?

scobi7 commented 2 months ago

New Staking Curve that implements linear decay. Allows for you to create a lock that sets the staking amount and time you will lock it for (create_lock(amount, lock_time). Basically queries when you do so and keeps track of locked amount and lock creation time. Then if you call get_balance_of, it applies linear decay formula which to calculate your current amount at this time stamp.

IMPORTANT:

by changing the functions like set_staking_curve, it affected almost all other test files that used these functions like test_treasury.

Not sure what we must do about this, since both curves are different.

scobi7 commented 2 months ago

accidentally closed, finished but needs review