Fixed Strike Option Teller
Contract that creates and manages the lifecycle of oTokens with a fixed strike price
Overview
Option Teller contracts handle the deployment, creation, and exercise of option tokens. oTokens are ERC20 tokens that represent the right to buy (call) or sell (put) a fixed amount of an asset (payout token) for an amount of another asset (quote token) between two timestamps (eligible and expiry). oTokens are denominated in units of the payout token and are created at a 1:1 ratio for the amount of payout tokens to buy or sell. The amount of quote tokens required to exercise (call) or collateralize (put) an oToken is called the strike price. Strike prices are denominated in units of the quote token.
The Fixed Strike Option Teller implementation creates option tokens that have a fixed strike price that is set at the time of creation.
Deploy and Creating oTokens
In order to create oTokens, an issuer must deploy the specific token configuration on the teller, and then provide collateral to the teller to create option tokens. The collateral is required to guarantee that the oTokens can be exercised. The collateral required depends on the option type.
For call options, the collateral required is an amount of payout tokens equivalent to the amount of option tokens being minted.
For put options, the collateral required is an amount of quote tokens equivalent to the amount of option tokens being minted multiplied by the strike price.
As the name "option" suggests, the holder of an option token has the right, but not the obligation, to exercise the oToken within the eligible time window. If the oToken is not exercised, the designated "receiver" of the oToken exercise proceeds can reclaim the collateral after the expiry timestamp. If an oToken is exercised, the holder receives the collateral and the receiver receives the exercise proceeds.
FixedStrikeOptionTeller
State Variables
protocolFee
Fee paid to protocol when options are exercised in basis points (3 decimal places).
FEE_DECIMALS
Base value used to scale fees. 1e5 = 100%
optionTokenImplementation
FixedStrikeOptionToken reference implementation (deployed on creation to clone from)
minOptionDuration
Minimum duration an option must be eligible to exercise (in seconds)
fees
Fees earned by protocol, by token
optionTokens
Fixed strike option tokens (hash of parameters to address)
collateralClaimed
Whether the receiver of an option token has reclaimed the collateral
User Functions
deploy
Deploy a new ERC20 fixed strike option token and return its address
If an option token already exists for the parameters, it returns that address
Parameters
Returns
create
Deposit an ERC20 token and mint an ERC20 fixed strike option token
Parameters
exercise
Exercise an ERC20 fixed strike option token. Provide required quote tokens and receive amount of payout tokens.
Amount of quote tokens required to exercise is return from the exerciseCost() function
Parameters
reclaim
Reclaim collateral from expired option tokens
Parameters
View Functions
exerciseCost
Get the cost to exercise an amount of fixed strike option tokens
Parameters
Returns
getOptionToken
Get the FixedStrikeOptionToken contract corresponding to the params, reverts if no token exists
Parameters
Returns
getOptionTokenHash
Get the hash ID of the fixed strike option token with these parameters
Parameters
Returns
Admin Functions
setMinOptionDuration
Set minimum duration to exercise option
Absolute minimum is 1 day (86400 seconds) due to timestamp rounding of eligible and expiry parameters
Parameters
setProtocolFee
Set protocol fee
Parameters
claimFees
Claim fees accrued by protocol in the input tokens and sends them to the provided address
Parameters