seq) on every state event.
Do not decode event logs using upstream or third-party Polymarket ABIs, as the event signatures differ (see Events).
Key concepts
- Condition — An
(oracle, questionId, outcomeSlotCount)tuple identified by: - Collection — Disjoint sets of outcome slots under a condition.
- Position — An ERC-1155 balance of a specific outcome slot within a condition, backed by collateral:
- Redemption — Once the oracle reports payouts, winning outcome tokens are burned in exchange for collateral.
Prepare a condition
ConditionPreparation.
Redeem winning positions
Redeeming your positions
On PredictStreet, outcome tokens sit in your Vault, not in your EOA.ConditionalTokens.redeemPositions pays out only to the caller (msg.sender); calling it directly from your EOA burns nothing and pays nothing.
Redemption is executed through one of the following paths:
-
Automatic (default): Auto-redeem is active for all accounts. Within a few minutes of final market status, the platform’s
AutoRedeemBackfillServiceenqueues eligible positions, andmatch-submitterexecutesVault.redeemPositionsin multicall batches (MulticallExecutor.aggregate3), paying the gas for you. It redeems:- Full refunds on voided markets (no minimum floor; dust under 0.001 shares skipped).
- Winnings on resolved markets that total at least 1 USDC per market.
- Smaller balances stay in your account for manual claim. Configure via
GET/PUT /api/me/auto-redeem.
-
Gasless API —
POST /api/me/positions/redeem:- Call with
{ "marketId": "...", "outcomeIndex": 0 }(vault:writeorpositions:write). - API-key callers must provide
auth: { deadline, v, r, s }signing an EIP-712RedeemAuthorization(address owner, string marketId, uint8 outcomeIndex, uint256 deadline)under domain{ name: "PredictStreetRedeem", version: "1", chainId }. - Returns
{ jobId, status }. PollGET /api/me/positions/redeem/{jobId}until confirmed. - Note:
POST /api/me/redemptionsreturns503 redeem_not_yet_enabled.
Generation 2:positions:writealso grants redeem, and the body takes an optionalvault. See Redeem. - Call with
-
On-chain, from the vault-owner EOA:
- Binary markets:
vault.redeemPositions(conditionId, indexSets). - Neg-risk markets:
vault.redeemPositionsNegRisk(marketId, questionIndex, amount). - Callable by
vaultOwneror backend; credits payout directly toledgerERC20[collateral]within the vault.
- Binary markets:
available balance in GET /api/me/balances.
Events
All state-changing events emit a global, monotonicseq counter as their first argument:
seq counter increments monotonically across all five events. chain-watcher verifies seq == lastSeq + 1 to ensure zero gaps in event indexing.
Differences from upstream
- Monotonic sequence counters (
seq): Every event starts withuint64 seqfor gap detection and deterministic cross-contract ordering. - Return value:
redeemPositionsreturnsuint256 totalPayout. - Event indexing:
PayoutRedemptionindexesconditionIdinstead ofparentCollectionId. - Base contract: Implemented using OpenZeppelin ERC-1155 with transient storage sequence flushing (
_flushSeq).
Source
0x66Ed938E9Dec9A1df6033d66560d5fe6117EE744 on
Blockscout
(testnet).