Two tokens for each option
Each instrument is a pair of ERC-20 tokens from the Greek Factory:- 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.
Open: sell-to-open
- The user requests a quote. Bebop sends the request to every eligible maker, and the highest valid signed premium wins.
- The user sends the quote transaction to the Bebop settlement contract.
- 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.
- The OT goes to the maker. The RT stays with the user. The maker pays the premium to the user.
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. TheBURN 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 atexpiration 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.