Description
Multi-outcome markets can resolve to several winning outcomes and split the pool, but this path needs more explicit coverage. In contracts/predictify-hybrid/src/resolution.rs, ResolvedOutcomeSummary carries num_winning_outcomes (the "tie split divisor") and compute_winning_total_for_market aggregates the winning stake across winning_outcomes. There is an existing tie_resolution_tests module enabled in lib.rs, but the payout-split arithmetic for N-way ties should be verified end to end. This issue extends those tests.
Requirements and context
- Resolution code:
ResolvedOutcomeSummary and num_winning_outcomes (resolution.rs:518), compute_winning_total_for_market (resolution.rs:541), and the resolve_market_with_ties entrypoint path.
- Payout division for ties must split the distributable pool by the number of winning outcomes/winners; verify the divisor is applied correctly and that rounding/remainder is handled deterministically.
- The existing module
contracts/predictify-hybrid/src/tie_resolution_tests.rs is wired in (lib.rs:133); extend it rather than creating a new one.
- Non-functional: tests must be deterministic and cover both balanced and skewed stake distributions across the tied outcomes.
- Confirm that a single-winner market still pays the full pool (no off-by-one in the divisor).
Acceptance criteria
Suggested execution
1. Fork the repo and create a branch — git checkout -b feature/multi-outcome-tie-tests.
2. Implement changes — none in production code unless a rounding ambiguity requires a minimal, documented fix in contracts/predictify-hybrid/src/resolution.rs.
3. Write/extend tests — extend contracts/predictify-hybrid/src/tie_resolution_tests.rs (Soroban testutils).
4. Test and commit
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test -p predictify-hybrid
Example commit message
test: cover multi-outcome tie payout splitting in resolve_market_with_ties
Guidelines
Target ≥90% coverage of the tie payout paths. Cross-reference and, if needed, update docs/designs/outcome_selection.md and API_DOCUMENTATION.md (Resolution Management) to document the rounding rule. Timeframe: 96 hours.
Description
Multi-outcome markets can resolve to several winning outcomes and split the pool, but this path needs more explicit coverage. In
contracts/predictify-hybrid/src/resolution.rs,ResolvedOutcomeSummarycarriesnum_winning_outcomes(the "tie split divisor") andcompute_winning_total_for_marketaggregates the winning stake acrosswinning_outcomes. There is an existingtie_resolution_testsmodule enabled inlib.rs, but the payout-split arithmetic for N-way ties should be verified end to end. This issue extends those tests.Requirements and context
ResolvedOutcomeSummaryandnum_winning_outcomes(resolution.rs:518),compute_winning_total_for_market(resolution.rs:541), and theresolve_market_with_tiesentrypoint path.contracts/predictify-hybrid/src/tie_resolution_tests.rsis wired in (lib.rs:133); extend it rather than creating a new one.Acceptance criteria
num_winning_outcomes.cargo fmt,cargo clippy, andcargo testpass.Suggested execution
1. Fork the repo and create a branch —
git checkout -b feature/multi-outcome-tie-tests.2. Implement changes — none in production code unless a rounding ambiguity requires a minimal, documented fix in
contracts/predictify-hybrid/src/resolution.rs.3. Write/extend tests — extend
contracts/predictify-hybrid/src/tie_resolution_tests.rs(Soroban testutils).4. Test and commit
cargo fmt --all -- --check cargo clippy --all-targets --all-features -- -D warnings cargo test -p predictify-hybridExample commit message
Guidelines
Target ≥90% coverage of the tie payout paths. Cross-reference and, if needed, update
docs/designs/outcome_selection.mdandAPI_DOCUMENTATION.md(Resolution Management) to document the rounding rule. Timeframe: 96 hours.