Skip to content

Add disputes.rs collusion detector flagging stake co-movement across disputers #680

Description

@greatest0fallt1me

Description

Coordinated disputers who file with nearly equal stakes at nearly the same ledger are likely colluding. Add a lightweight heuristic in disputes.rs that flags such patterns (configurable stake-delta and time-delta thresholds) and emits a SuspectedCollusionFlag event for off-chain review, without auto-slashing.

Requirements and Context

  • Rolling window of recent disputes per market
  • Pairwise comparison bounded to last K entries (default K=8)
  • No automatic punitive action — flag only
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b feature/dispute-collusion-detector
  2. Implement changes
    • contracts/predictify-hybrid/src/disputes.rs
    • contracts/predictify-hybrid/src/tests/dispute_collusion_tests.rs
  3. Test and commit
    • cargo test -p predictify-hybrid collusion_detector
    • Cover edge cases
    • Include test output and notes in the PR

Example commit message

feat: flag suspected collusion via stake co-movement heuristic

Acceptance Criteria

  • Threshold-driven flag fires on co-movement
  • No state changes beyond emitting the flag event
  • Test exercises both flag-fires and flag-suppressed cases

Guidelines

  • No unwrap() in production paths
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaign taskMAYBE REWARDEDMay be rewarded under the GrantFox campaignOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programenhancementNew feature or improvementrustRust implementationsecuritySecurity hardeningsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions