Skip to content

[#031][feat] Implement stake-weighted quorum for community consensus - #170

Merged
dultimateade merged 1 commit into
dultimateade:mainfrom
Faithy5:feat/031-stake-weighted-quorum
Sep 29, 2026
Merged

dultimateade merged 1 commit into
dultimateade:mainfrom
Faithy5:feat/031-stake-weighted-quorum

Conversation

@Faithy5

@Faithy5 Faithy5 commented Sep 29, 2026

Copy link
Copy Markdown

Replace unique-voter address counting with stake-weighted voting in:

  • MarketAnalytics::calculate_community_consensus (markets.rs)
  • DisputeAnalytics::calculate_community_consensus (disputes.rs)
  • VotingUtils::get_voting_stats (voting.rs)
  • MarketAnalyticsManager::get_voting_analytics (market_analytics.rs)

Previously a whale could be outvoted by many low-stake addresses because the quorum check counted unique voter addresses. Now each vote is weighted by the voter's stake amount, so economic exposure drives consensus.

Tests added:

  • test_stake_weighted_quorum_whale_beats_crowd
  • test_stake_weighted_quorum_equal_stake_different_counts
  • test_stake_weighted_quorum_empty_market
  • test_stake_weighted_quorum_single_voter
  • test_get_voting_stats_stake_weighted_distribution
  • test_get_voting_stats_empty_market

Closes #31

… consensus

Replace unique-voter address counting with stake-weighted voting in:
- MarketAnalytics::calculate_community_consensus (markets.rs)
- DisputeAnalytics::calculate_community_consensus (disputes.rs)
- VotingUtils::get_voting_stats (voting.rs)
- MarketAnalyticsManager::get_voting_analytics (market_analytics.rs)

Previously a whale could be outvoted by many low-stake addresses because
the quorum check counted unique voter addresses. Now each vote is weighted
by the voter's stake amount, so economic exposure drives consensus.

Tests added:
- test_stake_weighted_quorum_whale_beats_crowd
- test_stake_weighted_quorum_equal_stake_different_counts
- test_stake_weighted_quorum_empty_market
- test_stake_weighted_quorum_single_voter
- test_get_voting_stats_stake_weighted_distribution
- test_get_voting_stats_empty_market

Closes dultimateade#31
@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@Faithy5 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dultimateade
dultimateade merged commit feaafd3 into dultimateade:main Sep 29, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#031][feat] Issue #031

2 participants