API reference v1.0
Introduction
periphery
tokenomics
AlgebraIncentiveFarming

AlgebraIncentiveFarming

AlgebraIncentiveFarming

Algebra incentive (time-limited) farming

Variables

uint256 maxIncentiveStartLeadTime immutable

The max amount of seconds into the future the incentive startTime can be set

uint256 maxIncentiveDuration immutable

The max duration of an incentive in seconds

mapping(uint256 => mapping(bytes32 => struct AlgebraIncentiveFarming.Farm)) farms

Returns information about a farmd liquidity NFT

Developer note: farms[tokenId][incentiveHash] => Farm

Functions

constructor

AlgebraFarming

constructor(contract IAlgebraPoolDeployer,contract INonfungiblePositionManager,uint256,uint256) public

NameTypeDescription
_deployercontract IAlgebraPoolDeployerpool deployer contract address
_nonfungiblePositionManagercontract INonfungiblePositionManagerthe NFT position manager contract address
_maxIncentiveStartLeadTimeuint256the max duration of an incentive in seconds
_maxIncentiveDurationuint256the max amount of seconds into the future the incentive startTime can be set

createIncentive

onlyIncentiveMaker

createIncentive(struct IIncentiveKey.IncentiveKey,struct IAlgebraFarming.Tiers,struct IAlgebraIncentiveFarming.IncentiveParams) external

NameTypeDescription
keystruct IIncentiveKey.IncentiveKey
tiersstruct IAlgebraFarming.Tiers
paramsstruct IAlgebraIncentiveFarming.IncentiveParams

Returns:

NameTypeDescription
virtualPooladdress

addRewards

onlyIncentiveMaker

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

NameTypeDescription
keystruct IIncentiveKey.IncentiveKey
rewarduint256
bonusRewarduint256

decreaseRewardsAmount

onlyIncentiveMaker

decreaseRewardsAmount(struct IIncentiveKey.IncentiveKey,uint256,uint256) external

NameTypeDescription
keystruct IIncentiveKey.IncentiveKey
rewarduint256
bonusRewarduint256

detachIncentive

onlyIncentiveMaker

detachIncentive(struct IIncentiveKey.IncentiveKey) external

Detach incentive from the pool

NameTypeDescription
keystruct IIncentiveKey.IncentiveKeyThe key of the incentive

attachIncentive

onlyIncentiveMaker

attachIncentive(struct IIncentiveKey.IncentiveKey) external

Attach incentive to the pool

NameTypeDescription
keystruct IIncentiveKey.IncentiveKeyThe key of the incentive

enterFarming

onlyFarmingCenter

enterFarming(struct IIncentiveKey.IncentiveKey,uint256,uint256) external

enter farming for Algebra LP token

NameTypeDescription
keystruct IIncentiveKey.IncentiveKeyThe key of the incentive for which to enterFarming the NFT
tokenIduint256The ID of the token to exitFarming
tokensLockeduint256The amount of tokens locked for boost

exitFarming

onlyFarmingCenter

exitFarming(struct IIncentiveKey.IncentiveKey,uint256,address) external

exitFarmings for Algebra LP token

NameTypeDescription
keystruct IIncentiveKey.IncentiveKeyThe key of the incentive for which to exitFarming the NFT
tokenIduint256The ID of the token to exitFarming
_owneraddressOwner of the token

getRewardInfo

getRewardInfo(struct IIncentiveKey.IncentiveKey,uint256) view external

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

NameTypeDescription
keystruct IIncentiveKey.IncentiveKeyThe key of the incentive
tokenIduint256The ID of the token

Returns:

NameTypeDescription
rewarduint256
bonusRewarduint256