Redeeming Positions
Before this is possible, the payout vector must be set by the oracle:
function reportPayouts (bytes32 questionId, uint[] calldata payouts)external
Called by the oracle for reporting results of conditions. Will set the payout vector for the condition with the ID keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount)), where oracle is the message sender, questionId is one of the parameters of this function, and outcomeSlotCount is the length of the payouts parameter, which contains the payoutNumerators for each outcome slot of the condition.
Parameters:
- questionId – The question ID the oracle is answering for
- payouts – The oracle’s answer
This will emit the following event:
event ConditionResolution (bytes32 indexed conditionId, address indexed oracle, bytes32 indexed questionId, uint outcomeSlotCount, uint[] payoutNumerators)
Then positions containing this condition can be redeemed via:
function redeemPositions (IERC20 collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint[] calldata indexSets)external
This will trigger the following event:
event PayoutRedemption (address indexed redeemer, IERC20 indexed collateralToken, bytes32 indexed parentCollectionId, bytes32 conditionId, uint[] indexSets, uint payout)
Also look at this chart: