# OLM Factories

### Introduction

The OLM Factory contracts allows anyone to deploy new[ OLM ](https://dev.bondprotocol.finance/smart-contracts/option-system/options-liquidity-mining-olm)contracts without compiling and deploying them manually. When deployed, the owner of the OLM is set to the caller.&#x20;

There are two factories for the two OLM implementations: Manual Strike ([MOLMFactory](#molmfactory)) and Oracle Strike ([OOLMFactory](#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.&#x20;

### 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.&#x20;
3. [Initialize](https://dev.bondprotocol.finance/smart-contracts/option-system/options-liquidity-mining-olm) 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](https://github.com/Bond-Protocol/option-contracts/blob/master/src/fixed-strike/liquidity-mining/OLMFactory.sol)

Factory for deploying Manual Strike OLM contracts

### State Variables

#### optionTeller

Option Teller to be used by OLM contracts

```solidity
IFixedStrikeOptionTeller public immutable optionTeller;
```

### Functions

#### deploy

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

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

**Parameters**

| Name           | Type    | Description                                            |
| -------------- | ------- | ------------------------------------------------------ |
| `stakedToken_` | `ERC20` | ERC20 token that will be staked to earn rewards        |
| `payoutToken_` | `ERC20` | ERC20 token that stakers will receive call options for |

**Returns**

| Name   | Type              | Description                     |
| ------ | ----------------- | ------------------------------- |
| `molm` | `ManualStrikeOLM` | Address of the new OLM contract |

## OOLMFactory

[Git Source](https://github.com/Bond-Protocol/option-contracts/blob/master/src/fixed-strike/liquidity-mining/OLMFactory.sol)

Factory for deploying Oracle Strike OLM contracts

### State Variables

#### optionTeller

Option Teller to be used by OLM contracts

```solidity
IFixedStrikeOptionTeller public immutable optionTeller;
```

### Functions

#### deploy

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

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

**Parameters**

| Name           | Type    | Description                                            |
| -------------- | ------- | ------------------------------------------------------ |
| `stakedToken_` | `ERC20` | ERC20 token that will be staked to earn rewards        |
| `payoutToken_` | `ERC20` | ERC20 token that stakers will receive call options for |

**Returns**

| Name   | Type              | Description                     |
| ------ | ----------------- | ------------------------------- |
| `oolm` | `OracleStrikeOLM` | Address of the new OLM contract |
