IAlgebraFarming

Algebra Farming Interface

Allows farming nonfungible liquidity tokens in exchange for reward tokens

Events

IncentiveDeactivated

event IncentiveDeactivated(contract IERC20Minimal rewardToken, contract IERC20Minimal bonusRewardToken, contract IAlgebraPool pool, address virtualPool, uint256 startTime, uint256 endTime)

Event emitted when a liquidity mining incentive has been stopped from the outside

FarmEntered

event FarmEntered(uint256 tokenId, bytes32 incentiveId, uint128 liquidity, uint256 tokensLocked)

Event emitted when a Algebra LP token has been farmd

FarmEnded

event FarmEnded(uint256 tokenId, bytes32 incentiveId, address rewardAddress, address bonusRewardToken, address owner, uint256 reward, uint256 bonusReward)

Event emitted when a Algebra LP token has been exitFarmingd

IncentiveMaker

event IncentiveMaker(address incentiveMaker)

Emitted when the incentive maker is changed

Owner

event Owner(address owner)

Emitted when owner is changed

FarmingCenter

event FarmingCenter(address farmingCenter)

Emitted when the farming center is changed

RewardsAdded

event RewardsAdded(uint256 rewardAmount, uint256 bonusRewardAmount, bytes32 incentiveId)

Event emitted when rewards were added

RewardAmountsDecreased

event RewardAmountsDecreased(uint256 reward, uint256 bonusReward, bytes32 incentiveId)

RewardClaimed

event RewardClaimed(address to, uint256 reward, address rewardAddress, address owner)

Event emitted when a reward token has been claimed

EmergencyWithdraw

event EmergencyWithdraw(bool newStatus)

Emitted when status of `isEmergencyWithdrawActivated` changes

Functions

nonfungiblePositionManager

function nonfungiblePositionManager() external view returns (contract INonfungiblePositionManager) view external

The nonfungible position manager with which this farming contract is compatible

Returns:

deployer

function deployer() external returns (contract IAlgebraPoolDeployer) external

The pool deployer

Returns:

isEmergencyWithdrawActivated

function isEmergencyWithdrawActivated() external view returns (bool) view external

Users can withdraw liquidity without any checks if active.

Returns:

setIncentiveMaker

function setIncentiveMaker(address _incentiveMaker) external external

Updates the incentive maker

setOwner

function setOwner(address owner) external external

Updates the owner address

incentives

function incentives(bytes32 incentiveId) external view returns (uint256 totalReward, uint256 bonusReward, address virtualPoolAddress, uint24 minimalPositionWidth, uint224 totalLiquidity, address multiplierToken, bool deactivated, struct IAlgebraFarming.Tiers tiers) view external

Represents a farming incentive

Returns:

deactivateIncentive

function deactivateIncentive(struct IIncentiveKey.IncentiveKey key) external external

Detach incentive from the pool and deactivate it

addRewards

function addRewards(struct IIncentiveKey.IncentiveKey key, uint256 rewardAmount, uint256 bonusRewardAmount) external external

decreaseRewardsAmount

function decreaseRewardsAmount(struct IIncentiveKey.IncentiveKey key, uint256 rewardAmount, uint256 bonusRewardAmount) external external

rewards

function rewards(address owner, contract IERC20Minimal rewardToken) external view returns (uint256 rewardsOwed) view external

Returns amounts of reward tokens owed to a given address according to the last time all farms were updated

Returns:

setFarmingCenterAddress

function setFarmingCenterAddress(address _farmingCenter) external external

Updates farming center address

setEmergencyWithdrawStatus

function setEmergencyWithdrawStatus(bool newStatus) external external

Changes `isEmergencyWithdrawActivated`. Users can withdraw liquidity without any checks if activated. User cannot enter to farmings if activated. Must only be used in emergency situations. Farmings may be unusable after activation. Developer note: only owner

enterFarming

function enterFarming(struct IIncentiveKey.IncentiveKey key, uint256 tokenId, uint256 tokensLocked) external external

enter farming for Algebra LP token

exitFarming

function exitFarming(struct IIncentiveKey.IncentiveKey key, uint256 tokenId, address _owner) external external

exitFarmings for Algebra LP token

claimReward

function claimReward(contract IERC20Minimal rewardToken, address to, uint256 amountRequested) external returns (uint256 reward) external

Transfers `amountRequested` of accrued `rewardToken` rewards from the contract to the recipient `to`

Returns:

claimRewardFrom

function claimRewardFrom(contract IERC20Minimal rewardToken, address from, address to, uint256 amountRequested) external returns (uint256 reward) external

Transfers `amountRequested` of accrued `rewardToken` rewards from the contract to the recipient `to` only for FarmingCenter

Returns:

getRewardInfo

function getRewardInfo(struct IIncentiveKey.IncentiveKey key, uint256 tokenId) external returns (uint256 reward, uint256 bonusReward) external

Calculates the reward amount that will be received for the given farm

Returns: