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
- Fork the repo and create a branch
git checkout -b feature/dispute-collusion-detector
- Implement changes
contracts/predictify-hybrid/src/disputes.rs
contracts/predictify-hybrid/src/tests/dispute_collusion_tests.rs
- 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
Guidelines
- No
unwrap() in production paths
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
Coordinated disputers who file with nearly equal stakes at nearly the same ledger are likely colluding. Add a lightweight heuristic in
disputes.rsthat flags such patterns (configurable stake-delta and time-delta thresholds) and emits aSuspectedCollusionFlagevent for off-chain review, without auto-slashing.Requirements and Context
Suggested Execution
contracts/predictify-hybrid/src/disputes.rscontracts/predictify-hybrid/src/tests/dispute_collusion_tests.rscargo test -p predictify-hybrid collusion_detectorExample commit message
Acceptance Criteria
Guidelines
unwrap()in production paths