Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions govtool/backend/sql/get-network-total-stake.sql
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ AlwaysNoConfidenceVotingPower AS (
ORDER BY epoch_no DESC LIMIT 1), 0) AS amount
)
SELECT
COALESCE(TotalStakeControlledByActiveDReps.total, 0) + COALESCE(AlwaysNoConfidenceVotingPower.amount, 0) AS total_stake_controlled_by_active_dreps,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is the double counting?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assumption is that the TotalStakeControlledByActiveDReps already includes it as its coming from drep_distr covering all drep hashes already

COALESCE(TotalStakeControlledByActiveDReps.total, 0) AS total_stake_controlled_by_active_dreps,
COALESCE(TotalStakeControlledBySPOs.total, 0) AS total_stake_controlled_by_spos,
AlwaysAbstainVotingPower.amount AS always_abstain_voting_power,
AlwaysNoConfidenceVotingPower.amount AS always_no_confidence_voting_power
FROM TotalStakeControlledByActiveDReps
LEFT JOIN TotalStakeControlledBySPOs ON TRUE
LEFT JOIN AlwaysAbstainVotingPower ON TRUE
LEFT JOIN AlwaysNoConfidenceVotingPower ON TRUE
LEFT JOIN AlwaysNoConfidenceVotingPower ON TRUE
Loading