Selling & Buying Existing Puts
Owners may sell their existing puts into the market, and Writers may buy back their positions to absolve their obligation and short position
For Long positions, they may sell their existing open puts into the market. They do so by making them intentionally tradeable (bool set to true) and then offering them for a price.
This is done with the setPrice method. Owners may reset the price anytime they wish for open options, and can also use this method to cancel their trade (but still maintain ownership of the put), by simply setting the tradeable bool to false.
This function itself does not actually sell the option, it merely makes it available for sale. As such there is a separate function for people to purchase an Open put that is in the market - buyOpenOption.
This method runs through a few checks, but similar to the buy / sell new options, it checks that the details of the put that is intended to be purchased actually match what is stored on the smart contract. Once complete the new buyer delivers cash to the former put long, and then the new buyer is assigned their position as put.long.
The buyOpenOption has a unique function whereby it checks if the buyer is actually the short position of the put already. In this case, they current put short can be released of their obligation and position - and the total purchase held in escrow are returned back to the short. In this case the put is closed out because there is no more long or short position, and no more cash held in escrow to cover the obligation.
There are two other nuanced functions used to transfer ownership of puts in the market.
Suppose that you are a put short position, and you would like to get out of your short position. If the put owner offers the put up for sale, then you can buy it back with the above buyOpenOption function, but what if they want to keep their option? If there is another put (either newAsk or secondary sale "open ask") that matches all of the parameters of your current short position, then you can buy that option and safely exit your short position.
The function is called buyOptionFromAsk
When executing this method, it will require that the options parameters match up exactly, with the exception of the price (as you will pay whatever the current ask wants to charge). Calling this method will effectively switch positions such that the ask short is assigned your short position, and then their ask is closed out. You will pay the ask.long the premium price to close out this position, and then get your cash out of escrow. With puts (unlike calls), the function offers a slight benefit because your total purchase is held in escrow, it uses those existing funds to pay off the ask.long their premium, and then returns the leftover total purchase back to the put short. This allows more flexibility to exit a position without having additional cash, utilizing the existing cash you hold in escrow.
Conversely lets suppose you are a put owner of an open position, and you see on the order book a new bid (in this case must be a new bid). You can sell your current long position to this new bidder, and they will switch spots with you. You would no longer own the put, but you would receive the premium for selling the put to the new bidder.
This method is called sellOpenOptionToNewBid
Copy link