Settlement

How markets resolve through wave function collapse and how to claim winnings.

Settlement Window

Each market has a settlement window defined at creation. During this period, trading is active and proposals can be added. Once the window expires, the market enters the SETTLING state and collapse can be triggered.

Triggering Collapse

Anyone can call collapse(marketId) once the settlement window has expired. The function:

  1. Reads predicted metric values from each proposal
  2. Identifies the proposal with the highest predicted value
  3. Verifies the gap between first and second exceeds the collapse threshold
  4. Settles the winner and reverts all losers
  5. Fires the execution hook (if configured by the market creator)

If the confidence delta does not exceed the threshold, the collapse call will revert. More trading is needed to establish a clear winner.

What Happens at Collapse

Winning Proposal

  • Settles normally -- positions are finalized
  • Proposer gets their stake back
  • Execution hook fires (e.g., treasury transfer, strategy switch)

Losing Proposals

  • Fully reverted -- trades become no-ops
  • Untraded positions return principal to depositors
  • Proposer stakes are slashed and added to the collateral pool

Claiming Winnings

After collapse, traders who held positions in the winning proposal can claim their share. Payouts are proportional to position size within the winning proposal. Visit the market detail page after collapse to see your claimable amount and execute the claim transaction.

Execution Hooks

Market creators can optionally configure an execution hook -- a contract that is called when collapse occurs. This enables automated actions like:

  • Transferring treasury funds based on the winning strategy
  • Switching protocol parameters
  • Triggering downstream governance actions