Prediction market trade modal with mint / swap / merge / redeem functionality#13435
Open
Prediction market trade modal with mint / swap / merge / redeem functionality#13435
Conversation
masvelio
approved these changes
Feb 25, 2026
Rotorsoft
approved these changes
Feb 25, 2026
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.
Link to Issue
Closes: #13375
Description of Changes
Screen.Recording.2026-02-24.at.11.49.22.PM.mov
Summary
Implements the Prediction Market Trade Modal for minting, swapping, merging, and redeeming PASS/FAIL outcome tokens, aligned with the Futarchy protocol contracts (BinaryVault, FutarchyRouter, UniswapV3Strategy) and the reference logic in
app.js/ FutarchyGovernor.Contract integration (
predictionMarketTrade.ts)vault.mint(marketId, amount, collateralAddress).router.getStrategy(marketId)→ approve sell token (PASS or FAIL) to strategy →strategy.executeSwap(buyPass, amountIn, minOut). Correct token selection: sell FAIL when buying PASS, sell PASS when buying FAIL.vault.merge(marketId, amount).vault.redeem(marketId, amount)(after market is resolved).getPredictionMarketBalancesFromChain,getCollateralBalanceAndSymbol,getVaultCollateralBalance,parseTokenAmount,applySlippage,formatTokenDisplay(used in UI).Modal UI (
PredictionMarketTradeModal.tsx+ SCSS)0x6A76…43eA) and copy button on the same line as “PASS BALANCE” / “FAIL BALANCE”; compact styling.Balance and decimals handling
Thread card (
ThreadPredictionMarketCard.tsx)Other
end_time,strategy_address,governor_addressadded where used.Test Plan
Prerequisites
1. Open modal and header
end_timeis present.2. PASS/FAIL balance cards
0x6A76…43eA) and copy icon on the same line as “PASS BALANCE” / “FAIL BALANCE”.3. Mint
4. Swap
5. Merge
6. Redeem
7. Edge cases and copy
8. Manual contract check (optional)
balanceOf(user)matches modal after mint/swap/merge.Deployment Plan
Other Considerations
strategy_addressandgovernor_addressin the market payload.