Skip to content

Commit

Permalink
fix: revert removal of FE workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
aziolek committed Apr 19, 2024
1 parent 83d5e2a commit a9891fe
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ const MetricsEpochGridFundsUsage: FC<MetricsEpochGridFundsUsageProps> = ({

const projectCosts = epochInfo ? epochInfo.operationalCost : BigInt(0);
const staking = epochInfo ? epochInfo.staking : BigInt(0);
const ppf = epochInfo ? epochInfo.ppf : BigInt(0);
// const ppf = epochInfo ? epochInfo.ppf : BigInt(0);
/**
* WORKAROUND
* Temporary ppf forced by backend changes. Correct formula above!
* TODO OCT-1567: https://linear.app/golemfoundation/issue/OCT-1567/restore-correct-ppf-formula-in-client
*/
const ppf = epoch === 3 && epochInfo ? epochInfo.ppf - epochInfo.individualRewards : BigInt(0);
const communityFund = epochInfo ? epochInfo.communityFund : BigInt(0);

const donatedToProjects = epochInfo
Expand All @@ -48,7 +54,17 @@ const MetricsEpochGridFundsUsage: FC<MetricsEpochGridFundsUsageProps> = ({
if (!epochInfo) {
return BigInt(0);
}
/**
* epochInfo.ppf includes epochInfo.individualRewards.
* Half of PPF goes to the users to manage.
* Half of PPR goes to "PPF" section.
*/
if (epoch === 3) {
/**
* WORKAROUND
* Temporary ppf forced by backend changes. Correct formula above!
* TODO OCT-1567: https://linear.app/golemfoundation/issue/OCT-1567/restore-correct-ppf-formula-in-client
*/
return (
ppf / 2n + epochInfo.individualRewards - totalUserDonationsWithPatronRewards - unusedRewards
);
Expand Down

0 comments on commit a9891fe

Please sign in to comment.