Before you begin
- Complete the Quickstart. The examples use its settings and
send()helper. - The wallet that holds the RT sends the transaction. The payout goes to that wallet.
- Redeem after
exerciseDeadline. Before the deadline, the receipt contract burns only the RT that the exercise payment covers, and the rest of the RT stays in the wallet.
1
Find a position with a payout
A position has a payout when
redeemable is not null. Choose a position of this wallet with phase post_deadline.considerationNow estimates the exercise payment that the RT can collect now. collateralAfterDeadline estimates the collateral payout. It is null until phase is post_deadline. Both are in raw units, after the redemption fee in feeBps.The estimates are not reserved. Other RT holders of the same instrument redeem from the same pool, first come, first served.
2
Redeem the receipt tokens
Call
redeem(amount) on the receipt contract. The address is the receipt field of the instrument. Use the wallet’s current RT balance as amount.3
Verify the result
After Bebop indexes the redemption, the position has For a call,
status redeemed and rtBalance "0". The totals in redemption show the amounts that the wallet received.redeemedConsideration is in USDC and redeemedCollateral is in the underlying. For a put, the two are the other way around.