Skip to content

Commit 84b9dcd

Browse files
committed
feat: metrics adjusted to e11 -- simplification, removal of sections not applicable to lack of MF
1 parent 33fd08e commit 84b9dcd

File tree

6 files changed

+50
-20
lines changed

6 files changed

+50
-20
lines changed

client/src/api/calls/epochInfo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type Response = {
1111
operationalCost: string;
1212
patronsRewards: string | null;
1313
ppf: string | null;
14+
stakingMatchedReservedForV2: string | null;
1415
stakingProceeds: string;
1516
totalEffectiveDeposit: string;
1617
totalRewards: string;

client/src/components/Metrics/MetricsEpoch/MetricsEpoch.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ const MetricsEpoch = (): ReactElement => {
105105
<MetricsEpochGridTotalUsers className={styles.totalUsers} isLoading={isLoading} />
106106
<MetricsEpochGridCurrentDonors className={styles.currentDonors} isLoading={isLoading} />
107107
<MetricsEpochGridPatrons className={styles.patrons} isLoading={isLoading} />
108-
<MetricsEpochGridAverageLeverage className={styles.averageLeverage} isLoading={isLoading} />
108+
{epoch < 11 && (
109+
<MetricsEpochGridAverageLeverage
110+
className={styles.averageLeverage}
111+
isLoading={isLoading}
112+
/>
113+
)}
109114
<MetricsEpochGridRewardsUnused className={styles.rewardsUnused} isLoading={isLoading} />
110115
<MetricsEpochGridUnallocatedValue
111116
className={styles.unallocatedValue}
@@ -116,17 +121,21 @@ const MetricsEpoch = (): ReactElement => {
116121
isLoading={isLoading}
117122
totalUserDonations={sumOfDonations}
118123
/>
119-
<MetricsEpochGridTotalMatchingFund
120-
className={styles.totalMatching}
121-
isLoading={isLoading}
122-
matchingFund={matchedRewards}
123-
/>
124-
<MetricsEpochGridDonationsVsMatching
125-
className={styles.donationsVsMatching}
126-
isLoading={isLoading}
127-
matchingFund={matchedRewards}
128-
totalUserDonations={sumOfDonations}
129-
/>
124+
{epoch < 11 && (
125+
<>
126+
<MetricsEpochGridTotalMatchingFund
127+
className={styles.totalMatching}
128+
isLoading={isLoading}
129+
matchingFund={matchedRewards}
130+
/>
131+
<MetricsEpochGridDonationsVsMatching
132+
className={styles.donationsVsMatching}
133+
isLoading={isLoading}
134+
matchingFund={matchedRewards}
135+
totalUserDonations={sumOfDonations}
136+
/>
137+
</>
138+
)}
130139
<MetricsEpochGridDonationsVsPersonalAllocations
131140
className={styles.donationsVsPersonal}
132141
isLoading={isLoading}

client/src/components/Metrics/MetricsEpoch/MetricsEpochGridFundsUsage/MetricsEpochGridFundsUsage.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ const MetricsEpochGridFundsUsage: FC<MetricsEpochGridFundsUsageProps> = ({
2929
Number(Number(formatUnitsBigInt(value, 'wei')).toFixed(3));
3030

3131
const leftover = epochInfo ? epochInfo.leftover : BigInt(0);
32+
const stakingMatchedReservedForV2 = epochInfo ? epochInfo.stakingMatchedReservedForV2 : BigInt(0);
33+
34+
const leftoverToUse = epoch === 11 ? leftover - stakingMatchedReservedForV2 : leftover;
3235

3336
const projectCosts = epochInfo ? epochInfo.operationalCost : BigInt(0);
3437
const donatedToProjects = epochInfo ? epochInfo.donatedToProjects : BigInt(0);
@@ -72,7 +75,8 @@ const MetricsEpochGridFundsUsage: FC<MetricsEpochGridFundsUsageProps> = ({
7275
staking +
7376
ppf / 2n +
7477
communityFund +
75-
leftover;
78+
stakingMatchedReservedForV2 +
79+
leftoverToUse;
7680

7781
const isTestnet = window.Cypress ? !!window.isTestnetCypress : networkConfig.isTestnet;
7882

@@ -98,13 +102,13 @@ const MetricsEpochGridFundsUsage: FC<MetricsEpochGridFundsUsageProps> = ({
98102
}).primary,
99103
},
100104
{
101-
label: t('leftover', { epochNumber: epoch + 1 }),
102-
value: getNumberValue(leftover),
105+
label: t('leftover'),
106+
value: getNumberValue(leftoverToUse),
103107
valueLabel: getValuesToDisplay({
104108
cryptoCurrency: 'ethereum',
105109
getFormattedEthValueProps,
106110
showCryptoSuffix: true,
107-
valueCrypto: leftover,
111+
valueCrypto: leftoverToUse,
108112
}).primary,
109113
},
110114
{
@@ -157,6 +161,16 @@ const MetricsEpochGridFundsUsage: FC<MetricsEpochGridFundsUsageProps> = ({
157161
valueCrypto: ppf / 2n,
158162
}).primary,
159163
},
164+
{
165+
label: t('stakingMatchedReservedForV2'),
166+
value: getNumberValue(stakingMatchedReservedForV2),
167+
valueLabel: getValuesToDisplay({
168+
cryptoCurrency: 'ethereum',
169+
getFormattedEthValueProps,
170+
showCryptoSuffix: true,
171+
valueCrypto: stakingMatchedReservedForV2,
172+
}).primary,
173+
},
160174
].filter(({ value }) => value > 0);
161175

162176
return (

client/src/hooks/queries/useEpochInfo.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type EpochInfo = {
1414
patronsRewards: bigint;
1515
ppf: bigint;
1616
staking: bigint;
17+
stakingMatchedReservedForV2: bigint;
1718
stakingProceeds: bigint;
1819
totalEffectiveDeposit: bigint;
1920
totalRewards: bigint;
@@ -63,6 +64,9 @@ export default function useEpochInfo(
6364
? parseUnitsBigInt(response.patronsRewards, 'wei')
6465
: BigInt(0),
6566
ppf: response.ppf ? parseUnitsBigInt(response.ppf, 'wei') : BigInt(0),
67+
stakingMatchedReservedForV2: response.stakingMatchedReservedForV2
68+
? parseUnitsBigInt(response.stakingMatchedReservedForV2, 'wei')
69+
: BigInt(0),
6670
stakingProceeds: parseUnitsBigInt(response.stakingProceeds, 'wei'),
6771
totalEffectiveDeposit: parseUnitsBigInt(response.totalEffectiveDeposit, 'wei'),
6872
totalRewards: parseUnitsBigInt(response.totalRewards, 'wei'),

client/src/locales/en/translation.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@
552552
"totalUsers": "Total users",
553553
"fundsUsage": "Epoch {{epoch}} funds usage ",
554554
"epochTotal": "Epoch {{epoch}} Total",
555-
"leftover": "Moved to E{{epochNumber}}",
555+
"leftover": "Moved to next epoch",
556+
"stakingMatchedReservedForV2": "Reserved for v2 MF",
556557
"staking": "Staking",
557558
"communityFund": "Community Fund",
558559
"ppf": "PPF",
@@ -737,4 +738,4 @@
737738
"title": "Manual allocation"
738739
}
739740
}
740-
}
741+
}

client/src/locales/es/translation.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@
552552
"totalUsers": "Usuarios totales",
553553
"fundsUsage": "Uso de fondos de la época {{epoch}} ",
554554
"epochTotal": "Época {{epoch}} Total",
555-
"leftover": "Movido a E {{epochNumber}}",
555+
"leftover": "Transferido a la siguiente época",
556+
"stakingMatchedReservedForV2": "Reservado para el MF de v2",
556557
"staking": "Bloqueado",
557558
"communityFund": "Fondo Comunitario",
558559
"ppf": "PPF",
@@ -737,4 +738,4 @@
737738
"title": "Asignación manual"
738739
}
739740
}
740-
}
741+
}

0 commit comments

Comments
 (0)