4.6 Redemption and Payout
Winning Outcome Redemption:
After market resolution, holders of winning outcome shares can redeem 1:1:
User holds: 1000 winning outcome shares
Market resolved: Outcome Index 3 wins
Redemption:
├─> Burn 1000 outcome_3 shares
├─> Receive 1000 USDC (1:1 ratio)
└─> Transaction complete
Losing outcomes:
├─> outcome_0, outcome_1, outcome_2, outcome_4+ shares
└─> Worth 0 USDC (not redeemable)Implementation Pseudocode:
pub fn claim_winnings(
ctx: Context<ClaimWinnings>,
) -> Result<()> {
let market = &ctx.accounts.market;
let user_shares = &ctx.accounts.user_outcome_account;
// Verify market resolved
require!(market.resolved, ErrorCode::MarketNotResolved);
// Get winning outcome
let winning_outcome = market.winning_outcome.unwrap();
// Burn user's winning shares
let shares_to_burn = user_shares.amount;
// Transfer 1:1 collateral from vault
let payout_amount = shares_to_burn; // 1 share = 1 USDC
// Execute burn and transfer
// ...
Ok(())
}Last updated

