Merge outcome tokens
Merging reverses a previous split by burning complementary outcome tokens and minting the underlying collateral. Use this whenever you want to exit a position before resolution or recycle liquidity for another market.Workflow
- Ensure you hold both sides of the market (
indexSet 1andindexSet 2for binaries). - Approve the ConditionalTokens contract to spend the ERC-1155 balances you plan to merge.
- Call
mergePositions(collateralToken, conditionId, partition, amount)using the same partition array you used for the split.
amountcan be less than your total holdings, making partial unwinds straightforward.- The contract emits
PositionsMerged, letting indexers and your backend rebuild portfolio state.
Best practices on Amoy
- Watch the
blockNumberreturned by your subgraph when syncing merges. Amoy occasionally re-orgs, and replaying events keeps warehouses accurate. - If you provided liquidity via an FPMM, withdraw from the pool before merging, otherwise part of your collateral remains locked.
- Consider leaving a minimal balance on Amoy to keep testing loops fast—Forkast’s relayer can top-up the rest when promoting to production.