> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bebop.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Redeem after expiry

> Collect the collateral or the exercise payment for receipt tokens that you held through expiry.

This guide shows how to redeem the receipt tokens (RT) of a position that you held to expiry. At the end, the wallet has burned its RT and received the payout: the exercise payment, the remaining collateral, or both.

Redemption is a direct call to the receipt contract. It has no Bebop quote and no Bebop endpoint, and it needs no approval.

## Before you begin

* Complete the [Quickstart](https://docs.bebop.xyz/options-api/quickstart.md). 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`.

```python theme={null}
positions = httpx.get(f"{API}/positions", headers=HEADERS, params={"limit": 200}).json()["positions"]
position = next(
    p for p in positions
    if p["takerAddress"].lower() == account.address.lower()
    and p["phase"] == "post_deadline"
    and p["redeemable"] is not None
)
redeemable = position["redeemable"]
print(position["phase"], redeemable["rtBalance"], redeemable["considerationNow"], redeemable["collateralAfterDeadline"])
```

`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`.

> [!NOTE]
>
> 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`.

```python theme={null}
RECEIPT_ABI = [
    {"name": "redeem", "type": "function", "stateMutability": "nonpayable",
     "inputs": [{"name": "amount", "type": "uint256"}], "outputs": []},
]

instrument = httpx.get(f"{API}/instruments", params={"instrument": position["instrument"]}).json()["instruments"][0]
receipt = w3.eth.contract(Web3.to_checksum_address(instrument["receipt"]), abi=RECEIPT_ABI)
send(receipt.functions.redeem(int(redeemable["rtBalance"])).build_transaction({"from": account.address}))
```

**3. Verify the result**

After Bebop indexes the redemption, the position has `status` `redeemed` and `rtBalance` `"0"`. The totals in `redemption` show the amounts that the wallet received.

```python theme={null}
position = httpx.get(f"{API}/positions/{position['positionId']}", headers=HEADERS).json()
print(position["status"], position["redemption"])
```

For a call, `redeemedConsideration` is in USDC and `redeemedCollateral` is in the underlying. For a put, the two are the other way around.

## Related

* [How options settle](https://docs.bebop.xyz/options-api/how-options-settle.md#expiry-exercise-and-redemption)
* [Position reference](https://docs.bebop.xyz/options-api/reference.md#list-positions)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.