@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / RedeemParams

Interface: RedeemParams

Defined in: packages/sdk/src/trade.ts:1404

Inputs to Trader.redeem — burn winning outcome tokens for collateral on a resolved/voided market (module-routed redemption).

Properties

marketId

marketId: `0x${string}`

Defined in: packages/sdk/src/trade.ts:1410

bytes32 marketId the module keys the redemption on (settlement-extraction v2: redemption is module-routed — the module pulls the caller's winning tokens, finalizes-if-needed, and redeems through the BinarySettlement singleton).


amount

amount: bigint

Defined in: packages/sdk/src/trade.ts:1412

Outcome-token amount to burn for collateral.


outcomeIdx?

optional outcomeIdx?: 0 | 1

Defined in: packages/sdk/src/trade.ts:1426

Outcome leg to redeem (0 = YES, 1 = NO). When omitted, the SDK first confirms market.isResolved(), then derives the leg from the finalized one-hot payout vector. This needs market; otherwise pass outcomeIdx explicitly. Settlement v3 stores a payout vector — winningOutcome() was removed and reverts on the deployed contract.

The lookup is RESOLUTION-ONLY. An unresolved market throws instead of guessing from an unfinished vector. A voided market has no winner — both legs are redeemable — so redeem throws InvalidInputError rather than picking one. Pass the leg you hold, or use RedeemManyParams with one entry per leg to claim both in one transaction.


market?

optional market?: `0x${string}`

Defined in: packages/sdk/src/trade.ts:1432

BinaryMarket address — only needed to auto-look-up outcomeIdx / outcomeToken when those are omitted. The outcomeIdx lookup reads the terminal flags first, then the finalized payout vector and denominator.


operatorId?

optional operatorId?: number

Defined in: packages/sdk/src/trade.ts:1434

Routing operator id (uint32) for attribution; 0 = none (default).


venueId?

optional venueId?: `0x${string}`

Defined in: packages/sdk/src/trade.ts:1436

Routing venue id (bytes32 hex); 32-byte zero = none (default).


outcomeToken?

optional outcomeToken?: `0x${string}`

Defined in: packages/sdk/src/trade.ts:1441

Outcome-token singleton the winning position lives on (for the operator grant). Looked up via market.outcomeToken() when omitted.


module?

optional module?: `0x${string}`

Defined in: packages/sdk/src/trade.ts:1446

BinaryMarketsModule address; resolved from config.addresses.binaryModule when omitted. Throws if neither is set.


autoApprove?

optional autoApprove?: boolean

Defined in: packages/sdk/src/trade.ts:1448

Ensure the module is an operator on the outcome-token singleton (default true).


gas?

optional gas?: bigint

Defined in: packages/sdk/src/trade.ts:1454

Gas ceiling for this tx.

Default

TraderConfig.gas (10,000,000)