PodPut
PodPut is a contract that should inherit PodOption and override the 4 main functions: mint
, unmint
, exercise
and withdraw.
Methods
mint
This function is meant to be called by strike token holders wanting to write option tokens.
Locks some amount of the strike asset and writes option tokens. The issued amount ratio is 1 option token for strikePrice
units of strike asset. It presumes the caller has already called IERC20.approve()
on the strike token contract to move caller funds.
This function can only be called during tradeWindow
period depending on the exercise type.
For European: before exerciseWindow
.
For American: anytime before expiration.
unmint
Unlocks some amount of the strike token by burning option tokens. This mechanism ensures that users can only redeem tokens they've previously lock into this contract
American options where exercise can happen anytme before the expiration, the caller may receive a mix of the underlying asset
and strike asset
.
This function can only be called during tradeWindow
period depending on the exercise type.
For European: before exerciseWindow
.
For American: anytime before expiration.
exercise
Allow put token holders to use them to sell some amountOfOptions
units of the underlying asset
for the amountOfOption * strike price
units of the strike token. It presumes the caller has already called IERC20.approve()
on the underlying token
contract to move caller funds.
During the process:
The
amountOfOptions * strikePrice
units ofstrike asset
are transferred to the callerThe
amountOfOptions
option tokens are burned.The
amountOfOptions
units ofunderlying asset
are transferred intothis contract as a payment for the
strike asset
.
This function can only be called duringexpirationWindow
period depending on the exercise type.
For European: after trade window and before expiration. For American: anytime before expiration.
withdraw
Withdraws the locked amount of strike asset
after expiration by burning options.
The Strike Asset is NOT withdrawn on a first-come-first-serve basis. Meaning that, if there is not enough strike asset
left because the series has been exercised, The mix of underlying tokens
and strike asset
are distributed proportionally to the sellers.
This function can only be called during withdrawWindow
which is after expiration.
Last updated