feat: implement multi-outcome markets with 3 or more outcomes#285
Merged
greatest0fallt1me merged 8 commits intoPredictify-org:masterfrom Jan 31, 2026
Merged
Conversation
Contributor
Author
|
@greatest0fallt1me please help review and merge in |
…ent features with multi-outcome markets
Contributor
Author
|
@greatest0fallt1me pls merge |
Contributor
|
@Tola-byte pls resolve the conflicts |
Contributor
Author
|
okay thank you @greatest0fallt1me , please can this be closed so the points reflects on drip?, and complimentary points will greatly be appreciated sire🙌🙌 |
Contributor
Author
|
@greatest0fallt1me can this be closed please so I get my points before the wave ends please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Description
📋 Basic Information
Type of Change
Please select the type of change this PR introduces:
Related Issues
Priority Level
📝 Detailed Description
What does this PR do?
This PR extends the prediction market contract to support markets with 3 or more outcomes (N outcomes), including proper handling of tie scenarios where multiple outcomes can win simultaneously. The implementation maintains full backward compatibility with existing binary (yes/no) markets while adding comprehensive support for:
Additionally, this PR merges upstream changes including:
Why is this change needed?
The current implementation only supports binary markets (yes/no). Many real-world prediction markets require multiple outcomes:
This feature significantly expands the use cases for the prediction market platform and makes it more competitive with other prediction market solutions.
How was this tested?
Comprehensive test suite with 468 tests, all passing:
Test Coverage:
Test Results:
Manual Testing:
Alternative Solutions Considered
🏗️ Smart Contract Specific
Contract Changes
Please check all that apply:
Oracle Integration
Market Resolution Logic
Key Changes:
determine_final_result→determine_winning_outcomes: Now returnsVec<String>to support multiple winnersresolve_market_manual: Updated to convert single outcome to vector formatresolve_market_with_ties: New function for explicit multi-winner resolutionSecurity Considerations
Security Measures:
🧪 Testing
Test Coverage
Test Results
Manual Testing Steps
📚 Documentation
Documentation Updates
Documentation Added:
create_market,place_bet,resolve_market_with_ties,calculate_bet_payoutBreaking Changes
Breaking Changes:
Migration Guide:
create_marketfunction with 3+ outcomes🔍 Code Quality
Code Review Checklist
Performance Impact
Security Review
Security Highlights:
🚀 Deployment & Integration
Deployment Notes
Integration Points
Integration Notes:
resolve_market_with_tiesfunction available for admin usewinning_outcomesfield in Market struct (replaceswinning_outcome)get_winning_outcome()for backward compatibility,is_winning_outcome()for checking📊 Impact Assessment
User Impact
resolve_market_with_ties,calculate_bet_payoutexposed). Can create markets with any number of outcomes (2+).resolve_market_with_tiesfunction. All existing admin functions continue to work.Business Impact
✅ Final Checklist
Pre-Submission
Review Readiness
📸 Screenshots (if applicable)
N/A - Smart contract changes, no UI
🔗 Additional Resources
💬 Notes for Reviewers
Please pay special attention to:
distribute_payoutsandcalculate_bet_payout- ensure proportional splitting is correct for tie scenariosdetermine_winning_outcomesfunction inmarkets.rs- tie detection and resolution logicQuestions for reviewers:
🔄 Merged Upstream Changes
This PR also includes the following upstream features merged from
Predictify-org/predictify-contracts:Batch Bet Placement (PR feat: implement batch bet placement in a single transaction #283)
Platform Statistics and Analytics (PR feat: implement platform statistics and analytics tracking #282)
All conflicts have been resolved and both features work seamlessly with the multi-outcome implementation.
Thank you for your contribution to Predictify! 🚀