Skip to main content
PredictStreet handles two distinct settlement lifecycles:
  1. Trade settlement — how matched orders execute on-chain, transfer tokens between vaults, and confirm balances.
  2. Market settlement — how real-world outcomes are proposed, challenged, and finalised, unlocking token redemptions.

Trade settlement lifecycle (fills & orders)

Trade settlement operates continuously during active market trading:
  1. Off-chain match: Orders signed by vault owners (EIP-712 typed signatures with signatureType = 1 VAULT) match on price and size in the matching-core engine.
  2. Batch submission: The platform’s match-submitter service gathers matched trades and submits them to CTFExchange (for binary markets) or NegRiskCtfExchange (for neg-risk markets) via matchOrders or batchMatchOrders.
  3. On-chain execution:
    • The exchange verifies maker/taker signatures against VaultFactory.vaultOf(signer).
    • Transfers outcome tokens and collateral directly between the participant vaults.
    • Deducts each leg’s quadratic fee (fee = k × P × (1−P) × outcomeTokens).
    • Emits OrderFilled and OrdersMatched events with monotonically increasing seq counters. If an individual trade within a batch fails (e.g. expired TTL or already filled), batchMatchOrders emits MatchFailed and continues settling the remaining batch.
  4. Chain confirmation: The chain-watcher service indexes confirmed blocks, verifies contiguous event sequence numbers (seq), and publishes chain.fill_settled events over NATS JetStream.
  5. Balance projection: exchange-service consumes chain.fill_settled to:
    • Drain the buyer’s locked collateral (chain_fill_settled_buyer_drain).
    • Credit the seller’s available USDC balance (chain_fill_settled_seller_credit).
    • Release the seller’s locked position tokens (chain_fill_settled_sell_release).
    • Transition the internal trade state from matched / settlement_pending to settled.

Market settlement — propose → challenge → finalize

Once the underlying real-world event concludes, market resolution begins. Binary and neg-risk markets follow the same propose → challenge → finalize pattern on their respective oracle contracts.

Step 1 — Oracle source check

The market is configured with one or more data sources when listed. When configured source(s) yield an unambiguous outcome, the market becomes ready to propose. When data is unavailable, contradictory, or lacks a strict majority across configured sources, the market moves to DELAYED. See Void & delayed.

Step 2 — On-chain proposal

Binary markets:
Neg-risk markets:
For crypto markets with locked sources and zero challenge window, the oracle can call atomic settlement via proposeAndFinalize(questionId) or proposeAndFinalizeBatch(questionIds).

Step 3 — Challenge window

The challenger approves the oracle for the bond (10 USDC on testnet), which the oracle pulls with transferFrom. The bond is fixed at proposal time (bondSnapshot). Only the first challenge is accepted. When challenged:
  • Market status transitions to DISPUTED.
  • The oracle triggers oraclePauseMarket on the exchanges registered on that oracle, halting trading on that condition.
  • See Challenges.

Step 4a — No challenge, finalise

Permissionless: anyone may call it once challengeDeadline has passed without a challenge. Internally calls ConditionalTokens.reportPayouts, unlocking position redemptions.

Step 4b — Challenge, re-verify

Once challenged, resolveChallengeConfirm and resolveChallengeOverride can only be executed after the challenge window deadline has elapsed (_requireChallenged enforces block.timestamp > challengeDeadline); voidMarket has no deadline gate. The platform reviews the evidence and resolves the dispute:
On neg-risk markets, disputes are resolved through NegRiskOracle using resolveChallengeConfirm(marketId), resolveChallengeOverride(marketId, winnerIndex), resolveChallengeOverrideWithFairPrices(marketId, yesPayouts, noPayouts), or two-phase void (queueVoidMarket followed by voidMarket).

Neg-risk markets

Neg-risk markets group multiple binary questions under a single negRiskMarketId. Differences:
  1. Keyed by the group: Calls take negRiskMarketId: proposeOutcome(negRiskMarketId, winnerIndex), challengeOutcome(negRiskMarketId), finalizeOutcome(negRiskMarketId).
  2. Atomic group resolution: On finalisation, the winning question pays YES ([1, 0]) and every sibling pays NO ([0, 1]) in one transaction. In exceptional cases the platform proposes fair-price splits (proposeOutcomeWithFairPrices).
  3. Two-phase void: Voiding requires queueVoidMarket (freezing conversions with MarketVoidQueued), followed by voidMarket. Standard void ([1, 1] on every question) reverts with CannotVoidAfterConversions if any trader has executed convertPositions.
  4. Redemption: Goes through the vault like any other market — see Redemption.

Crypto markets

Crypto markets settle as binary markets under Oracle:
  • Rule-based evidence: Outcomes derive from Chainlink Data Streams feeds (CoinGecko for dominance/market-cap products, Hyperliquid for ANT-USD and OPENAI-USD) evaluated against immutable rules set at listing (targetPrice, direction, deadlineAt).
  • Touch products: THRESHOLD_BY_DEADLINE and THRESHOLD_DURING_MONTH lock YES on first touch, settling after the observation period ends.
  • Fast crypto windows: 15-minute Up/Down windows evaluate within 1–2 minutes of closing. When armed for the fast path, markets use a verified zero-second challenge window and settle via proposeAndFinalize.
Do not hardcode settlement delays. Read resolution.proposedAt and resolution.challengeWindowClosesAt from the market REST payload — this timestamp is the exact moment finalize becomes legal on-chain.

What you observe as a partner


Redemption

Outcome tokens are held in your vault, so redemption always executes through the vault contract. Calling ConditionalTokens.redeemPositions directly from an EOA burns nothing and pays nothing.

Auto-redeem

Auto-redeem is active by default for all accounts. Once a market reaches RESOLVED or VOIDED, the platform automatically redeems held outcome tokens, pays the gas, and credits the USDC payout to your vault: How auto-redeem operates under the hood:
  • AutoRedeemBackfillService in core-api scans eligible positions on markets that reached their final status in the last 24 hours every minute, and on all finished markets every 15 minutes, processing oldest resolved markets first (RND-2728).
  • Enqueued jobs are dispatched to match-submitter’s BatchOrchestratorService, which batches up to 32 redemptions into single atomic multicalls via MulticallExecutor.aggregate3 executing Vault.redeemPositions or Vault.redeemPositionsNegRisk.
  • Paused or moratorium accounts are automatically skipped until restrictions are lifted.
Manage auto-redeem preferences via GET /api/me/auto-redeem (portfolio:read) and PUT /api/me/auto-redeem with { "enabled": true | false } (vault:write or positions:write, maximum 10 changes per 24 hours). The PUT answers 409 account_provisioning while the account is still being set up and 401 account_closed for a closed account (403 account_unavailable on a multi_wallet key). Calls refused after authentication, such as the 409, count toward the 10 (RND-3723).

Claiming yourself

If auto-redeem is turned off, or for winnings below 1 USDC, claim positions manually:
  1. Gasless API — POST /api/me/positions/redeem
    • Body: { "marketId": "...", "outcomeIndex": 0 }.
    • API-key callers require vault:write (or positions:write) scope and must include an owner-signed RedeemAuthorization payload in auth.
    • Returns { "jobId": "...", "status": "pending" }. Poll GET /api/me/positions/redeem/{jobId} until status is confirmed.
    • Note: POST /api/me/redemptions returns 503 redeem_not_yet_enabled (reserved for future signature-gated co-signed redemption).
    Generation 2: positions:write also grants redeem, and the body takes an optional vault. See Redeem.
  2. Self-submitted on-chain
    • Binary markets: Vault owner calls Vault.redeemPositions(conditionId, indexSets).
    • Neg-risk markets: Vault owner calls Vault.redeemPositionsNegRisk(marketId, questionIndex, amount).
    • Note: On-chain vault redemptions are gated to msg.sender == vaultOwner || factory.isBackend(msg.sender). Payouts are credited directly to ledgerERC20[collateral] within the vault.
Every redemption credits the USDC payout to your vault’s available balance in GET /api/me/balances. No further claim step is required.