# Deploying and Configuring a Kodiak Farm

## Deploying and Configuring a Kodiak Farm

This guide will walk you through the process of deploying a new Kodiak Farm contract and configuring it to distribute rewards for staked tokens.

### Overview

Kodiak Farm is a DeFi staking solution that allows users to earn rewards by staking their tokens. As a farm creator, you can customize various parameters to determine how rewards are distributed, including reward rates, lock periods, and multipliers.

### Prerequisites

Before deploying a Kodiak Farm, ensure you have:

* An Ethereum-compatible wallet (like MetaMask) connected to the appropriate network
* The contract address of the token users will stake (LP token)
* The contract address of the token(s) you will distribute as rewards
* Sufficient reward tokens to fund the farm
* ETH/native tokens for transaction fees

### Deploying a Kodiak Farm Contract

#### Step 1: Access the Farm Deployment Interface

Navigate to the ["Create Farm" ](https://app.kodiak.finance/#/liquidity/farms?chain=berachain_mainnet)page in the Kodiak app.

<figure><img src="/files/bdpLdRpjDUqbGIwwNIm6" alt=""><figcaption></figcaption></figure>

Step 2: Enter Staking Token Details

1. **Staking Token Address**: Enter the LP token address (beginning with "0x...") that users will stake to earn rewards.

   > **Note**: This is typically a liquidity pool (LP) token or Kodiak Island token, but can be any ERC-20 compatible token.

#### Step 3: Configure Reward Token Settings

In the "Reward Token" section:

1. **Reward Token Address**: Either select a token from the dropdown menu or enter the contract address of your reward token.
2. **Reward Manager Address**: Enter the address that will have permission to manage reward distributions. This address will have special privileges to adjust reward parameters.

   > **Important**: The reward manager will have significant control over the reward token, being able to adjust reward rates and withdraw tokens. In most cases, this should be an address you control, or a team multi-sig.
3. **Monthly Reward Amount**: Specify the total amount of tokens to be distributed as rewards each month.

   > **Calculation**: The system will automatically calculate the per-second distribution rate based on this amount.
4. To add multiple reward tokens, click the "+ Add Reward Token" button in the top-right corner of the section.

<figure><img src="/files/0A0JlH2NPw5f77zaTIFL" alt=""><figcaption></figcaption></figure>

#### Step 4: Initialize Deployment

Click the "Deploy Farm" button at the bottom of the page to proceed to the deploying farm.

### Configuring Farm Parameters

After deploying the farm contract, you'll need to configure it before users can begin staking. The farm status will initially show as "Not Started".

<figure><img src="/files/fML2YAMBH5dWz6V5MXP8" alt=""><figcaption></figcaption></figure>

#### Step 1: Review Farm Configuration (Step 1/2)

The configuration page displays "Step 1/2" in the top-right corner, indicating this is the first of two configuration steps.

#### Step 2: Verify Reward Token Configuration

1. **Custom Token**: Confirm the reward token address is correct (e.g., 0x1319d21A0eC48F847C15823fc3e8bC7f5aae9ca2).
2. **Reward Rate**: Review the reward distribution rate. The interface displays this as:
   * Raw rate (e.g., 9999999.99999999999072)
   * Human-readable equivalent (e.g., 3.85802469/sec)

<figure><img src="/files/4Q3KlQtkJRyOClSsPI6Z" alt=""><figcaption></figcaption></figure>

1. **Reward Manager**: Verify the reward manager address is correct (e.g., 0x4f5F9dB14E195484cf7790fD3946CF6e66A166B0).

#### Step 3: Set Staking Token Cap

The staking token cap determines the maximum amount of tokens that can be staked in your farm.

<figure><img src="/files/MOhllui7o6t37cBu6Rwb" alt=""><figcaption></figcaption></figure>

> **Important**: Enter `-1` to set an unlimited cap (maximum uint256 value). This allows unlimited staking in your farm.

#### Step 4: Configure Reward Multipliers and Lock Periods

1. **Maximum Multiplier**: Use the slider to set the maximum reward multiplier (e.g., 3x). This value determines how much additional rewards users can earn by staking for longer periods.

<figure><img src="/files/NlyIRwPLCz9HmG2lzQHj" alt=""><figcaption></figcaption></figure>

1. **Minimum Lock Time**: Set the minimum required staking period in days. Users must stake for at least this duration before they can withdraw.

   * Set to `0 day(s)` if you don't want to enforce a minimum staking period
   * Higher values increase commitment but may deter some users

   <figure><img src="/files/Rgs7z6CiY5nMVqrmNZPG" alt=""><figcaption></figcaption></figure>
2. **Lock Time for Max Multiplier**: Set the staking duration (in days) required to receive the maximum reward multiplier.

   * In the example shown, users need to stake for 30 days to receive the 3x multiplier
   * Shorter lock periods will receive proportionally smaller multipliers

   <figure><img src="/files/EjZH4CVG3CnwYvRBB1nf" alt=""><figcaption></figcaption></figure>
3. **Rewards Duration**: Set the total period (in days) during which farming rewards will be distributed.

   * This determines how long your farm will be active
   * Ensure you have sufficient reward tokens to cover this entire period

   <figure><img src="/files/8coVsJDeQwGWrS9tUeaf" alt=""><figcaption></figcaption></figure>

#### Step 5: Review and Finalize Configuration

1. To reset all parameters to default values, click the "Reset" button.
2. When you're satisfied with all settings, click the "Review Changes" button to proceed to the final confirmation step.

### Starting the Farm

After completing the configuration, you'll need to start the farm to activate it.

#### Step 1: Final Review

Review all parameters one final time to ensure they're set correctly.

#### Step 2: Ensure Sufficient Reward Tokens

Before starting the farm, make sure:

* Your wallet or the contract has sufficient reward tokens to cover the entire rewards duration
* You have enough Bera to pay for the transaction fee

> **Critical**: If the contract or wallet doesn't have enough reward tokens, the farm cannot be started.

#### Step 3: Activate the Farm

Click the "Start Farm" button to activate your farm.

<figure><img src="/files/UjENNIHDVyKxeDCOtGnj" alt=""><figcaption></figcaption></figure>

After successful activation, the farm status will change from "Not Started" to "Active".

### Troubleshooting Common Issues

#### Farm Won't Start

* **Problem**: Clicking "Start Farm" doesn't activate the farm
* **Solution**: Verify you have sufficient reward tokens. Check both your wallet balance and any allowances granted to the farm contract.

#### Incorrect Parameters

* **Problem**: Parameters appear incorrect after configuration
* **Solution**: Use the "Reset" button during configuration and set them again. Double-check all values before finalizing.

#### Transaction Failures

* **Problem**: Transactions fail during deployment or configuration
* **Solution**: Ensure you have sufficient ETH/native tokens for gas. Verify all addresses are correctly formatted and valid on the network.

### Conclusion

Congratulations! You've successfully deployed and configured a Kodiak Farm. Users can now stake their tokens and earn rewards based on your configured parameters.

For additional assistance or feature requests, please contact the Kodiak Finance support team via [Discord](https://discord.gg/kodiak)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.kodiak.finance/user-guide/deploying-and-configuring-a-kodiak-farm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
