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

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

Open
tensojka opened this issue May 22, 2024 · 10 comments
Open
Assignees

Comments

@tensojka
Copy link
Contributor

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
Copy link

Can u handle this

@tensojka
Copy link
Contributor Author

tensojka commented May 22, 2024

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

@0xibs
Copy link
Contributor

0xibs commented May 23, 2024

I would like to take this task.

  • I will need two working days for research and 1 working day for implementation.
  • I am a fullstack engineer and I have vast experience building on both ethereum and starknet. I have also deployed a couple of profile to the mainnet and contributed to a number of core projects in the ecosystem.
  • I have the following skills relevant for this task: Cairo, Solidity.

@vibenedict
Copy link

i will like to jump on it

@tensojka
Copy link
Contributor Author

@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
Copy link

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.

  • I will first try to come up with some options for the curve, make those curve functions in the desmos graphing calculator.
  • I will then present it to the team, get it approved, and start working on the implementation of the curve.
  • After the implementation of its logic with manual testing, I will then write necessary tests for the function.

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
Copy link
Contributor Author

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

@tensojka
Copy link
Contributor Author

tensojka commented Jun 3, 2024

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

@scobi7 scobi7 pinned this issue Jul 4, 2024
scobi7 pushed a commit to scobi7/konoha that referenced this issue Jul 7, 2024
scobi7 pushed a commit to scobi7/konoha that referenced this issue Jul 7, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 10, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 10, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 10, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 10, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 10, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 10, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 12, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 13, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 14, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 14, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 14, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 15, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 15, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 15, 2024
Since I changed staking set curve point, and the test_staking setups, it changes all the other tests. Will have to see if I need to re-add these.

For example, other test functions use set_staking_curve
@scobi7 scobi7 closed this as completed Jul 15, 2024
@scobi7
Copy link
Collaborator

scobi7 commented Jul 15, 2024

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 added a commit to scobi7/konoha that referenced this issue Jul 15, 2024
scobi7 added a commit to scobi7/konoha that referenced this issue Jul 15, 2024
@scobi7 scobi7 reopened this Jul 22, 2024
@scobi7
Copy link
Collaborator

scobi7 commented Jul 22, 2024

accidentally closed, finished but needs review

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

No branches or pull requests

6 participants