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

# How options settle

> How the option and receipt tokens, the collateral, and the premium move when a user opens, closes, rolls, and redeems a position.

A user who sells an option on Bebop gives a market maker the right to buy or sell the underlying at the strike. The user locks collateral to back that right and receives a premium for it. This page explains how the tokens move, and why some results depend on chain state that the quote does not control.

## Two tokens for each option

Each instrument is a pair of ERC-20 tokens from the [Greek Factory](https://docs.greek.fi/#options-as-erc20-tokens):

* The **option token (OT)** carries the right to exercise. Its address identifies the instrument in every API call.
* The **receipt token (RT)** is the claim on the collateral behind the OT. The receipt contract holds that collateral.

Both tokens start with zero supply. Greek mints an equal amount of OT and RT only when a trade settles.

A call locks the underlying (WETH or cbBTC). A put locks USDC. For this reason, amounts are in collateral units: a call is sized in the underlying, and a put is sized in USDC. A put on 1 WETH at a 2,500 strike is 2,500 USDC of OT, not 1 OT.

## Open: sell-to-open

1. The user requests a quote. Bebop sends the request to every eligible maker, and the highest valid signed premium wins.
2. The user sends the quote transaction to the Bebop settlement contract.
3. Settlement takes OT from the user's wallet. The wallet holds no OT, so the Greek Factory mints the OT and RT. It pulls the collateral from the user into the receipt contract.
4. The OT goes to the maker. The RT stays with the user. The maker pays the premium to the user.

All of this happens in one transaction. If any part fails, nothing moves. For a 1 WETH call with a 65 USDC premium, the user ends with 1 RT and 65 USDC more, and 1 WETH less.

This is why an open needs two different authorizations. The ERC-20 allowance lets the Greek Factory pull the collateral. The Greek Factory permission lets the settlement contract transfer OT for the user and mint it when the wallet has none. The permission is not limited to an amount or to one instrument.

## Close: buy-to-close

A close is a purchase: the user pays a premium to get OT back. Bebop requests the close quote only from the makers that filled the opens of the position.

When the OT arrives in the user's wallet, Greek burns it together with the user's RT and returns the collateral. The `BURN` permission on the Greek Factory lets this happen in the same transaction.

The signed order guarantees only the exchange of the premium for the OT. It does not guarantee the burn. Greek burns the smaller of the incoming OT and the wallet's RT balance. If the user moves RT after the quote, the user can receive OT and get back less collateral. Bebop checks the RT balance when it quotes, but it cannot hold that balance until the transaction runs.

Bebop counts an open for a close only when the open is confirmed, about 30 seconds after it is mined. Before that, a chain reorganization can remove the open, and a close quote for it would have no position to close.

## Roll

A roll closes the full position and opens a new instrument in one transaction. The close legs come first. The returned collateral then backs the new OT, so a covered call roll needs no extra underlying, only USDC for the buy-back. The roll needs both the open and the close authorizations.

## Positions

Bebop records one position for each wallet and instrument. A second open of the same instrument from the same wallet adds to the same position, even when a different maker fills it. The position is a record of Bebop trades. RT that the user moves or receives outside Bebop does not change it.

## Expiry, exercise, and redemption

The options are European. The OT holder can exercise only in the exercise window, which starts at `expiration` and ends at `exerciseDeadline`. The OT holder, normally the maker, decides whether to exercise. Bebop does not exercise for anyone.

Bebop quotes opens and closes until 30 seconds before `expiration`. After that, the user keeps the RT until the user redeems it with the receipt contract:

* If the maker exercised, the receipt contract holds the exercise payment: USDC at the strike for a call, the underlying for a put.
* After `exerciseDeadline`, the receipt contract also pays out the collateral that nobody exercised.

Redemption is first come, first served across all RT holders of the instrument, not pro rata. Each redemption takes from the exercise payment first, then from the remaining collateral after the deadline. Different wallets can therefore receive a different mix of the two tokens.

## Related

* [Quickstart](https://docs.bebop.xyz/options-api/quickstart.md)
* [Close a position](https://docs.bebop.xyz/options-api/guides/close-a-position.md)
* [Roll a position](https://docs.bebop.xyz/options-api/guides/roll-a-position.md)
* [Redeem after expiry](https://docs.bebop.xyz/options-api/guides/redeem-after-expiry.md)
* [Reference](https://docs.bebop.xyz/options-api/reference.md)


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