Skip to content

Commit

Permalink
Merge pull request #3 from near-daos/bugfix/vote_rate_nane
Browse files Browse the repository at this point in the history
Fixed vote rate growth calculation
  • Loading branch information
andkom authored Jan 17, 2022
2 parents efd11f3 + f8e9d1b commit b9b20eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/api/src/governance/governance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export class GovernanceService {
}),
]);

const voteRate = getRate(proposalsApprovedCount, proposalsCount);

return {
proposals: {
count: proposalsCount,
Expand All @@ -104,10 +106,10 @@ export class GovernanceService {
members: proposalsMemberCount,
},
voteRate: {
count: getRate(proposalsApprovedCount, proposalsCount),
count: voteRate,
growth: getGrowth(
proposalsApprovedCount / proposalsCount,
dayAgoProposalsApprovedCount / dayAgoProposalsCount,
voteRate,
getRate(dayAgoProposalsApprovedCount, dayAgoProposalsCount),
),
},
};
Expand Down

0 comments on commit b9b20eb

Please sign in to comment.