# IAlgebraEternalFarming

Algebra Eternal Farming Interface Allows farming nonfungible liquidity tokens in exchange for reward tokens without locking NFT for incentive time

## Events

### RewardsRatesChanged

`RewardsRatesChanged(uint128,uint128,bytes32)`

Event emitted when reward rates were changed

| Name            | Type    | Description                                          |
| --------------- | ------- | ---------------------------------------------------- |
| rewardRate      | uint128 | The new rate of main token distribution per sec      |
| bonusRewardRate | uint128 | The new rate of bonus token distribution per sec     |
| incentiveId     | bytes32 | The ID of the incentive for which rates were changed |

### RewardsCollected

`RewardsCollected(uint256,bytes32,uint256,uint256)`

Event emitted when rewards were added

| Name              | Type    | Description                                              |
| ----------------- | ------- | -------------------------------------------------------- |
| tokenId           | uint256 | The ID of the token for which rewards were collected     |
| incentiveId       | bytes32 | The ID of the incentive for which rewards were collected |
| rewardAmount      | uint256 | Collected amount of reward                               |
| bonusRewardAmount | uint256 | Collected amount of bonus reward                         |

### EternalFarmingCreated

`EternalFarmingCreated(contract IERC20Minimal,contract IERC20Minimal,contract IAlgebraPool,address,uint256,uint256,uint256,uint256,struct IAlgebraFarming.Tiers,address)`

Event emitted when a liquidity mining incentive has been created

| Name             | Type                         | Description                                                          |
| ---------------- | ---------------------------- | -------------------------------------------------------------------- |
| rewardToken      | contract IERC20Minimal       | The token being distributed as a reward                              |
| bonusRewardToken | contract IERC20Minimal       | The token being distributed as a bonus reward                        |
| pool             | contract IAlgebraPool        | The Algebra pool                                                     |
| virtualPool      | address                      | The virtual pool address                                             |
| startTime        | uint256                      | The time when the incentive program begins                           |
| endTime          | uint256                      | The time when rewards stop accruing                                  |
| reward           | uint256                      | The amount of reward tokens to be distributed                        |
| bonusReward      | uint256                      | The amount of bonus reward tokens to be distributed                  |
| tiers            | struct IAlgebraFarming.Tiers | The amounts of locked token for liquidity multipliers                |
| multiplierToken  | address                      | The address of token which can be locked to get liquidity multiplier |

## Functions

### farms

`farms(uint256,bytes32)` view external

Returns information about a farmd liquidity NFT

| Name        | Type    | Description                                          |
| ----------- | ------- | ---------------------------------------------------- |
| tokenId     | uint256 | The ID of the farmd token                            |
| incentiveId | bytes32 | The ID of the incentive for which the token is farmd |

**Returns:**

| Name               | Type    | Description |
| ------------------ | ------- | ----------- |
| liquidity          | uint128 |             |
| tickLower          | int24   |             |
| tickUpper          | int24   |             |
| innerRewardGrowth0 | uint256 |             |
| innerRewardGrowth1 | uint256 |             |

### createEternalFarming

`createEternalFarming(struct IIncentiveKey.IncentiveKey,uint256,uint256,uint128,uint128,address,struct IAlgebraFarming.Tiers)` external

Creates a new liquidity mining incentive program

| Name            | Type                              | Description                                                          |
| --------------- | --------------------------------- | -------------------------------------------------------------------- |
| key             | struct IIncentiveKey.IncentiveKey | Details of the incentive to create                                   |
| reward          | uint256                           | The amount of reward tokens to be distributed                        |
| bonusReward     | uint256                           | The amount of bonus reward tokens to be distributed                  |
| rewardRate      | uint128                           | The rate of reward distribution per second                           |
| bonusRewardRate | uint128                           | The rate of bonus reward distribution per second                     |
| multiplierToken | address                           | The address of token which can be locked to get liquidity multiplier |
| tiers           | struct IAlgebraFarming.Tiers      | The amounts of locked token for liquidity multipliers                |

**Returns:**

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| virtualPool | address |             |

### addRewards

`addRewards(struct IIncentiveKey.IncentiveKey,uint256,uint256)` external

| Name              | Type                              | Description |
| ----------------- | --------------------------------- | ----------- |
| key               | struct IIncentiveKey.IncentiveKey |             |
| rewardAmount      | uint256                           |             |
| bonusRewardAmount | uint256                           |             |

### setRates

`setRates(struct IIncentiveKey.IncentiveKey,uint128,uint128)` external

| Name            | Type                              | Description |
| --------------- | --------------------------------- | ----------- |
| key             | struct IIncentiveKey.IncentiveKey |             |
| rewardRate      | uint128                           |             |
| bonusRewardRate | uint128                           |             |

### collectRewards

`collectRewards(struct IIncentiveKey.IncentiveKey,uint256,address)` external

| Name    | Type                              | Description |
| ------- | --------------------------------- | ----------- |
| key     | struct IIncentiveKey.IncentiveKey |             |
| tokenId | uint256                           |             |
| \_owner | address                           |             |

**Returns:**

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| reward      | uint256 |             |
| bonusReward | uint256 |             |

***


---

# 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://docs.algebra.finance/algebra-integral-documentation/algebra-v1-technical-reference/contracts/api-reference-v1.0/v1.0-tokenomics/ialgebraeternalfarming.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.
