API reference v1.0
Introduction
periphery
tokenomics
AlgebraEternalFarming

AlgebraEternalFarming

AlgebraEternalFarming

Algebra eternal (v2-like) farming

Variables

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

Returns information about a farmd liquidity NFT

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

Functions

constructor

AlgebraFarming

constructor(contract IAlgebraPoolDeployer,contract INonfungiblePositionManager) public

NameTypeDescription
_deployercontract IAlgebraPoolDeployerpool deployer contract address
_nonfungiblePositionManagercontract INonfungiblePositionManagerthe NFT position manager contract address

createEternalFarming

onlyIncentiveMaker

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

Creates a new liquidity mining incentive program

NameTypeDescription
keystruct IIncentiveKey.IncentiveKeyDetails of the incentive to create
rewarduint256The amount of reward tokens to be distributed
bonusRewarduint256The amount of bonus reward tokens to be distributed
rewardRateuint128The rate of reward distribution per second
bonusRewardRateuint128The rate of bonus reward distribution per second
multiplierTokenaddressThe address of token which can be locked to get liquidity multiplier
tiersstruct IAlgebraFarming.TiersThe amounts of locked token for liquidity multipliers

Returns:

NameTypeDescription
virtualPooladdress

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

addRewards

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

NameTypeDescription
keystruct IIncentiveKey.IncentiveKey
rewardAmountuint256
bonusRewardAmountuint256

setRates

onlyIncentiveMaker

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

NameTypeDescription
keystruct IIncentiveKey.IncentiveKey
rewardRateuint128
bonusRewardRateuint128

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

reward amounts can be outdated, actual amounts could be obtained via static call of `collectRewards` in FarmingCenter

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

Returns:

NameTypeDescription
rewarduint256
bonusRewarduint256

collectRewards

onlyFarmingCenter

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

reward amounts should be updated before calling this method

NameTypeDescription
keystruct IIncentiveKey.IncentiveKey
tokenIduint256
_owneraddress

Returns:

NameTypeDescription
rewarduint256
bonusRewarduint256