Claim Market

Purpose

The Claim function allows participants who bet on the correct outcome to withdraw their winnings after the market is resolved.

Workflow

  1. Eligibility Check:

  • The function verifies if the user participated in the market and selected the winning outcome.

  • It ensures the market is in a Resolved state.

  1. Reward Calculation:

  • Calculates the user’s reward based on their share of the winning pool.

  • Includes the original collateral and any profits earned.

  1. Payout Distribution:

  • Transfers the calculated reward to the user’s wallet.

  • Marks the user’s claim as complete to prevent double claiming.

  1. State Update:

  • Updates the user’s participation record to indicate the reward has been claimed.

Key Features

  • Fair Distribution: Ensures users receive rewards proportional to their stake in the winning outcome.

  • Prevention of Double Claims: Tracks claim status to avoid duplicate payouts.

Last updated