Skip to main content
NegRiskAdapter enables multi-outcome prediction markets on top of ConditionalTokens. It is paired with NegRiskCtfExchange.

Why separate from binary

A standard binary market is a single condition with two outcome slots (YES and NO). A neg-risk market with NN mutually exclusive outcomes consists of NN binary YES/NO conditions grouped under a single marketId (the negRiskMarketId). Because exactly one outcome can win, NO on every outcome is worth (N−1)(N - 1) USDC, and NO on any subset of outcomes is economically equivalent to YES on all other outcomes plus USDC. convertPositions performs that exchange atomically on-chain without requiring the trader to execute multiple separate trades.

Market setup

Question ii is initialized as its own binary condition with NegRiskAdapter as its oracle and:
During prepareMarket, the adapter clones a dedicated WrappedCollateral (WCOL) contract for the market. Read condition IDs with conditionIds(marketId, i) and YES/NO token IDs with getTokenIds(marketId, i).

convertPositions

Bit ii of indexSet selects outcome ii:
  • The caller burns amount NO tokens for every selected outcome.
  • The caller receives amount YES tokens for every unselected outcome.
  • The caller receives (k−1)×amount(k - 1) \times \text{amount} USDC, where kk is the number of selected outcomes.
Example: In a 4-outcome market, holding 1 NO on outcomes 1, 2, and 3 (indexSet 0b1110, k=3k = 3): convertPositions burns NO_1 + NO_2 + NO_3 and mints 1 YES_0 plus 2×1=22 \times 1 = 2 USDC into the vault. Conversion is blocked and reverts if:
  • The market has already resolved (determined == true -> MarketAlreadyDetermined).
  • The market is voided (MarketIsVoided).
  • A void is currently queued on the market (MarketVoidQueued).

Via the API

Partners typically call conversion through the vault’s dual-signed flow:
  1. Request backend signature: POST /api/vault/convert-signature with { marketId, indexSet, amount }.
  2. Owner signature: Sign the EIP-712 ConvertPositions typed data:
    Note: The negRiskAdapter address is an immutable on the vault and is not part of the signed struct.
  3. On-chain submit: Call vault.convertPositions(marketId, indexSet, amount, salt, deadline, ownerSig, backendSig).

Resolution & void mechanics

Each outcome condition is resolved through NegRiskOracle (see Settlement flow):
  • Single winner: The oracle calls reportOutcome(marketId, winnerIndex). The adapter reports [1, 0] (YES) for the winning outcome and [0, 1] (NO) for every sibling outcome.
  • Fair-price resolution: The oracle calls reportOutcomeWithFairPrices(marketId, yesPayouts, noPayouts) with one YES and one NO value per question.
  • Two-phase voiding:
    1. The oracle calls queueVoid(marketId), emitting VoidQueued and freezing convertPositions (MarketVoidQueued).
    2. The oracle calls voidMarket(marketId), reporting [1, 1] payouts to every question.
    3. Protection against unbacked WCOL: If conversions have already occurred on that market (hasConversions == true), calling voidMarket reverts with CannotVoidAfterConversions(). The market must be resolved via fair prices (reportOutcomeWithFairPrices) or explicit payouts.
Redeem resolved positions via vault.redeemPositionsNegRisk(marketId, questionIndex, amount) or through Auto-redeem.

Events

Source

NegRiskAdapter: 0x3BE93B8e19b73e1b21B65adFFEF4ef248715D21B (testnet);
NegRiskCtfExchange: 0x2eB97912c333963a21410Af1eF7E9a0aAB7631bf (testnet).