Fixed Strike Option Teller
Contract that creates and manages the lifecycle of oTokens with a fixed strike price
Contract that creates and manages the lifecycle of oTokens with a fixed strike price
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.
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.
Fee paid to protocol when options are exercised in basis points (3 decimal places).
Base value used to scale fees. 1e5 = 100%
FixedStrikeOptionToken reference implementation (deployed on creation to clone from)
Minimum duration an option must be eligible to exercise (in seconds)
Fees earned by protocol, by token
Fixed strike option tokens (hash of parameters to address)
Whether the receiver of an option token has reclaimed the collateral
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
payoutToken_
ERC20
ERC20 token that the purchaser will receive on execution
quoteToken_
ERC20
ERC20 token used that the purchaser will need to provide on execution
eligible_
uint48
Timestamp at which the option token can first be executed (gets rounded down to nearest day)
expiry_
uint48
Timestamp at which the option token can no longer be executed (gets rounded down to nearest day)
receiver_
address
Address that will receive the proceeds when option tokens are exercised. Also the address that can claim collateral from unexercised options.
call_
bool
Whether the option token is a call (true) or a put (false)
strikePrice_
uint256
Strike price of the option token (in units of quoteToken per payoutToken)
Returns
oToken
FixedStrikeOptionToken
Address of the ERC20 fixed strike option token being created
Deposit an ERC20 token and mint an ERC20 fixed strike option token
Parameters
optionToken_
FixedStrikeOptionToken
Fixed strike option token to mint
amount_
uint256
Amount of option tokens to mint (also the number of payout tokens required to be deposited)
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
optionToken_
FixedStrikeOptionToken
Fixed strike option token to exercise
amount_
uint256
Amount of option tokens to exercise (also the number of payout tokens to receive)
Reclaim collateral from expired option tokens
Parameters
optionToken_
FixedStrikeOptionToken
Fixed strike option token to reclaim collateral from
Get the cost to exercise an amount of fixed strike option tokens
Parameters
optionToken_
FixedStrikeOptionToken
Fixed strike option token to exercise
amount_
uint256
Amount of option tokens to exercise
Returns
token_
ERC20
Token required to exercise (quoteToken for call, payoutToken for put)
cost_
uint256
Amount of token_
required to exercise
Get the FixedStrikeOptionToken contract corresponding to the params, reverts if no token exists
Parameters
payoutToken_
ERC20
ERC20 token that the purchaser will receive on execution
quoteToken_
ERC20
ERC20 token used that the purchaser will need to provide on execution
eligible_
uint48
Timestamp at which the option token can first be executed (gets rounded to nearest day)
expiry_
uint48
Timestamp at which the option token can no longer be executed (gets rounded to nearest day)
receiver_
address
Address that will receive the proceeds when option tokens are exercised. Also the address that can claim collateral from unexercised options.
call_
bool
Whether the option token is a call (true) or a put (false)
strikePrice_
uint256
Strike price of the option token (in units of quoteToken per payoutToken)
Returns
`optionToken`
FixedStrikeOptionToken
FixedStrikeOptionToken contract address
Get the hash ID of the fixed strike option token with these parameters
Parameters
payoutToken_
ERC20
ERC20 token that the purchaser will receive on execution
quoteToken_
ERC20
ERC20 token used that the purchaser will need to provide on execution
eligible_
uint48
Timestamp at which the option token can first be executed (gets rounded to nearest day)
expiry_
uint48
Timestamp at which the option token can no longer be executed (gets rounded to nearest day)
receiver_
address
Address that will receive the proceeds when option tokens are exercised. Also the address that can claim collateral from unexercised options.
call_
bool
Whether the option token is a call (true) or a put (false)
strikePrice_
uint256
Strike price of the option token (in units of quoteToken per payoutToken)
Returns
optionHash
bytes32
Hash ID of the fixed strike option token with these parameters
Set minimum duration to exercise option
Absolute minimum is 1 day (86400 seconds) due to timestamp rounding of eligible and expiry parameters
Parameters
duration_
uint48
Minimum duration in seconds
Set protocol fee
Parameters
fee_
uint48
Protocol fee in basis points (3 decimal places)
Claim fees accrued by protocol in the input tokens and sends them to the provided address
Parameters
tokens_
ERC20[]
Array of tokens to claim fees for
to_
address
Address to send fees to