Giveth / impact-graph

MIT License
49 stars 18 forks source link

Adjust givbacks factors for verified vs. givbacks eligible #1798

Open divine-comedian opened 2 months ago

divine-comedian commented 2 months ago

With the coming changes of Decentralized Verification we will have two tiers of "verification" statuses. verified and givbacksEligible.

verified projects can participate in GIVpower, have a rank, but DO NOT yield GIVbacks to their donors

givbacksEligible projects have GIVpower and yield GIVbacks to their donors.

we will need to be able to make the changes to our givbacks calculations in order to handle this change.

As an example, ff we have 100 projects total that have the statuses GIVbacks Eligible and Verified, then we would handle GIVbacks like below:

Project Rank Status GIVbacks Factor
1 GIVbacks Eligible 80%
2 Verified 0%
3 GIVbacks Eligible 79%
4 GIVbacks Eligible 78%
5 Verified 0%
6 Verified 0%
7 GIVbacks Eligible 77%

As you can see verified projects can potentially have a higher rank than givbacksEligible projects, however we should not consider them when calculating the givbacks factor. When calculating the givbacks factor we skip over the not givbacksEligible projects and only consider the next givbacksEligible projects as if it were the next lowest rank project.

additionally we should ensure project data that shows the predicted givbacks factor are showing the correct percentages @MohammadPCh

Image

for testing

making a project "vouched" status

making a project GIVbacks Eligible

checking GIVbacks factor

so for example if there are 50 ranked projects that are GIVbacks eligible then

30 / 50 = 0.6 so each project from the top rank down should have 0.6% less GIVbacks factor

mohammadranjbarz commented 2 months ago

@MohammadPCh Has separated Givback Eligible and *verified in this PR https://github.com/Giveth/impact-graph/pull/1770

And for this phase we can't separate ranking for verified and givback eligible projects, for that purpose we need to create a new materialized view , ...

@divine-comedian Should we hold on and don't merge that PR till implement this issue or we can merge it and for second phase we apply these requirements?

divine-comedian commented 2 months ago

Following up on this in our convo - we need to make sure we can handle GIVbacks correctly even for the first phase of this feature.

projects that are not givbacks eligible should not receive GIVbacks. We'll need to figure out and estimate the necessary work.

divine-comedian commented 2 months ago

@mohammadranjbarz what is the update on this issue?

mohammadranjbarz commented 1 month ago

@mohammadranjbarz what is the update on this issue?

I made the Pr and @CarlosQ96 approved it, I just didn't merge it to staging because I wanted to do it after the release, if we don't have any release soon, I can merge the PRs

divine-comedian commented 1 month ago

related to this PR https://github.com/Giveth/impact-graph/pull/1770

divine-comedian commented 1 month ago

@mohammadranjbarz should need to make tiny changes to the givbacks-calculation repo - he says only 1 hour of work

let's make sure we get it done!

LatifatAbdullahi commented 1 month ago

@mohammadranjbarz @divine-comedian

Test update

Vouched status

-Donations to this project SHOULD NOT be eligible for GIVbacks - Pass -Donations to project that is only vouched should not show up in the eligibledonations API- Pass

GIVback Eligible status

-Donations to this project should be eligible for GIVbacks - Pending -Donation to this project that is GIVbacks eligible should show up in response - Pending

GIVback Factor

Whilst testing the eligibledonation API the whole page went blank showing this error

https://givback.develop.giveth.io/api-docs/

image

mohammadranjbarz commented 1 month ago

@mohammadranjbarz @divine-comedian

Test update

Vouched status

-Donations to this project SHOULD NOT be eligible for GIVbacks - Pass -Donations to project that is only vouched should not show up in the eligibledonations API- Pass

GIVback Eligible status

-Donations to this project should be eligible for GIVbacks - Pending -Donation to this project that is GIVbacks eligible should show up in response - Pending

GIVback Factor

  • Check top ranked project that is GIVbacks eligible yields 80% GIVbacks factor to donors - Pass
  • Check next highest ranked project that is GIVbacks eligible and if the GIVbacks factor is correct - Pass

Whilst testing the eligibledonation API the whole page went blank showing this error

https://givback.develop.giveth.io/api-docs/

image

It's up and running now, can you test it again?

LatifatAbdullahi commented 1 month ago

@mohammadranjbarz @divine-comedian

Test update

Vouched status

-Donations to this project SHOULD NOT be eligible for GIVbacks - Pass -Donations to project that is only vouched should not show up in the eligibledonations API- Pass

GIVback Eligible status

-Donations to this project should be eligible for GIVbacks - Pass -Donation to this project that is GIVbacks eligible should show up in response - Pass

GIVback Factor

Check top ranked project that is GIVbacks eligible yields 80% GIVbacks factor to donors - Pass Check next highest ranked project that is GIVbacks eligible and if the GIVbacks factor is correct - Pass