Exercising Calls
For call owners, they may exercise their open calls before expiration date
There are two methods that an owner (and only the Long / owner) of a call can exercise their option right. They can use a standard exercise method and deliver the total purchase cash (as defined by token amount * strike) and receive out of escrow the tokens, or they may choose to cash close and receive just the profits from exercising. The Cash Close method can only be called if the option is in the money (spot price > strike) and can be executed without fail. The physical delivery exercise method can always be called regardless of whether the call is in the money or not.
Physical Delivery uses the exercise method. The owner simply inputs their owned call index and lets the smart contract pull their cash - deliver to the call short and then receives out of escrow the tokens.
The second method is the cashClose method, which leverages an AMM liquidity pool direct connection to swap tokens into cash to payoff the call short and then deliver profits to the call long. For the cashClose method, the owner can choose to take their profits in either the payment currency or the tokens. The reason for this is, once the tokens have been swapped into total purchase cash (and paid off the call short), there are still excess tokens in escrow (profits). These profits can either be swapped into cash and delivered, or (for slight gas savings), the call long can simply accept the tokens still held in escrow as their profits.
To estimate the necessary amounts, the smart contract uses internal uniswap libraries (getAmountOut and getAmountIn) and an internal swap method to calculate the minimum required number of tokens to flash swap into the total purchase amount.
Copy link