OLM Factories

Factory contracts for easy deployment of OLM contracts

Introduction

The OLM Factory contracts allows anyone to deploy new OLM contracts without compiling and deploying them manually. When deployed, the owner of the OLM is set to the caller.

There are two factories for the two OLM implementations: Manual Strike (MOLMFactory) and Oracle Strike (OOLMFactory).

  • Manual Strike: Owners must manually update the strike price to change it over time.

  • Oracle Strike: Strike price is automatically updated based on an oracle and discount. A minimum strike price can be set on the Oracle Strike version to prevent it from going too low.

Deployment

Setting up an OLM requires three steps.

  1. Deploy an OLM contract from a factory.

  2. Fund the OLM contract with payoutTokens to pay rewards with (via a simple ERC20 transfer). Owners must monitor the balance of payoutTokens in the contract to ensure that users can claim their rewards.

  3. Initialize the OLM contract, including inputting the remaining options and staking parameters.

Step one of this process is accomplished by interacting with one of these factory contracts.

MOLMFactory

Git Source

Factory for deploying Manual Strike OLM contracts

State Variables

optionTeller

Option Teller to be used by OLM contracts

IFixedStrikeOptionTeller public immutable optionTeller;

Functions

deploy

Deploy a new Manual Strike OLM contract with the caller as the owner

function deploy(ERC20 stakedToken_, ERC20 payoutToken_) external returns (ManualStrikeOLM);

Parameters

NameTypeDescription

stakedToken_

ERC20

ERC20 token that will be staked to earn rewards

payoutToken_

ERC20

ERC20 token that stakers will receive call options for

Returns

NameTypeDescription

molm

ManualStrikeOLM

Address of the new OLM contract

OOLMFactory

Git Source

Factory for deploying Oracle Strike OLM contracts

State Variables

optionTeller

Option Teller to be used by OLM contracts

IFixedStrikeOptionTeller public immutable optionTeller;

Functions

deploy

Deploy a new Oracle Strike OLM contract with the caller as the owner

function deploy(ERC20 stakedToken_, ERC20 payoutToken_) external returns (OracleStrikeOLM);

Parameters

NameTypeDescription

stakedToken_

ERC20

ERC20 token that will be staked to earn rewards

payoutToken_

ERC20

ERC20 token that stakers will receive call options for

Returns

NameTypeDescription

oolm

OracleStrikeOLM

Address of the new OLM contract