API reference v1.0
Introduction
periphery
tokenomics
IAlgebraFarming

IAlgebraFarming

IAlgebraFarming

Algebra Farming Interface Allows farming nonfungible liquidity tokens in exchange for reward tokens

Events

IncentiveDetached

IncentiveDetached(contract IERC20Minimal,contract IERC20Minimal,contract IAlgebraPool,address,uint256,uint256)

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

NameTypeDescription
rewardTokencontract IERC20MinimalThe token being distributed as a reward
bonusRewardTokencontract IERC20MinimalThe token being distributed as a bonus reward
poolcontract IAlgebraPoolThe Algebra pool
virtualPooladdressThe detached virtual pool address
startTimeuint256The time when the incentive program begins
endTimeuint256The time when rewards stop accruing

IncentiveAttached

IncentiveAttached(contract IERC20Minimal,contract IERC20Minimal,contract IAlgebraPool,address,uint256,uint256)

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

NameTypeDescription
rewardTokencontract IERC20MinimalThe token being distributed as a reward
bonusRewardTokencontract IERC20MinimalThe token being distributed as a bonus reward
poolcontract IAlgebraPoolThe Algebra pool
virtualPooladdressThe attached virtual pool address
startTimeuint256The time when the incentive program begins
endTimeuint256The time when rewards stop accruing

FarmEntered

FarmEntered(uint256,bytes32,uint128,uint256)

Event emitted when a Algebra LP token has been farmd

NameTypeDescription
tokenIduint256The unique identifier of an Algebra LP token
incentiveIdbytes32The incentive in which the token is farming
liquidityuint128The amount of liquidity farmd
tokensLockeduint256The amount of tokens locked for multiplier

FarmEnded

FarmEnded(uint256,bytes32,address,address,address,uint256,uint256)

Event emitted when a Algebra LP token has been exitFarmingd

NameTypeDescription
tokenIduint256The unique identifier of an Algebra LP token
incentiveIdbytes32The incentive in which the token is farming
rewardAddressaddressThe token being distributed as a reward
bonusRewardTokenaddressThe token being distributed as a bonus reward
owneraddressThe address where claimed rewards were sent to
rewarduint256The amount of reward tokens to be distributed
bonusRewarduint256The amount of bonus reward tokens to be distributed

IncentiveMaker

IncentiveMaker(address)

Emitted when the incentive maker is changed

NameTypeDescription
incentiveMakeraddressThe incentive maker after the address was changed

FarmingCenter

FarmingCenter(address)

Emitted when the farming center is changed

NameTypeDescription
farmingCenteraddressThe farming center after the address was changed

RewardsAdded

RewardsAdded(uint256,uint256,bytes32)

Event emitted when rewards were added

NameTypeDescription
rewardAmountuint256The additional amount of main token
bonusRewardAmountuint256The additional amount of bonus token
incentiveIdbytes32The ID of the incentive for which rewards were added

RewardClaimed

RewardClaimed(address,uint256,address,address)

Event emitted when a reward token has been claimed

NameTypeDescription
toaddressThe address where claimed rewards were sent to
rewarduint256The amount of reward tokens claimed
rewardAddressaddressThe token reward address
owneraddressThe address where claimed rewards were sent to

Functions

nonfungiblePositionManager

nonfungiblePositionManager() view external

The nonfungible position manager with which this farming contract is compatible

Returns:

NameTypeDescription
[0]contract INonfungiblePositionManager

farmingCenter

farmingCenter() view external

The farming Center

Returns:

NameTypeDescription
[0]contract IFarmingCenter

deployer

deployer() external

The pool deployer

Returns:

NameTypeDescription
[0]contract IAlgebraPoolDeployer

setIncentiveMaker

setIncentiveMaker(address) external

Updates the incentive maker

NameTypeDescription
_incentiveMakeraddressThe new incentive maker address

incentives

incentives(bytes32) view external

Represents a farming incentive

NameTypeDescription
incentiveIdbytes32The ID of the incentive computed from its parameters

Returns:

NameTypeDescription
totalRewarduint256
bonusRewarduint256
virtualPoolAddressaddress
totalLiquidityuint224
multiplierTokenaddress
tiersstruct IAlgebraFarming.Tiers

detachIncentive

detachIncentive(struct IIncentiveKey.IncentiveKey) external

Detach incentive from the pool

NameTypeDescription
keystruct IIncentiveKey.IncentiveKeyThe key of the incentive

attachIncentive

attachIncentive(struct IIncentiveKey.IncentiveKey) external

Attach incentive to the pool

NameTypeDescription
keystruct IIncentiveKey.IncentiveKeyThe key of the incentive

rewards

rewards(address,contract IERC20Minimal) view external

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

NameTypeDescription
owneraddressThe owner for which the rewards owed are checked
rewardTokencontract IERC20MinimalThe token for which to check rewards

Returns:

NameTypeDescription
rewardsOweduint256

setFarmingCenterAddress

setFarmingCenterAddress(address) external

Updates farming center address

NameTypeDescription
_farmingCenteraddressThe new farming center contract address

enterFarming

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

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

claimReward

claimReward(contract IERC20Minimal,address,uint256) external

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

NameTypeDescription
rewardTokencontract IERC20MinimalThe token being distributed as a reward
toaddressThe address where claimed rewards will be sent to
amountRequesteduint256The amount of reward tokens to claim. Claims entire reward amount if set to 0.

Returns:

NameTypeDescription
rewarduint256

claimRewardFrom

claimRewardFrom(contract IERC20Minimal,address,address,uint256) external

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

NameTypeDescription
rewardTokencontract IERC20MinimalThe token being distributed as a reward
fromaddressThe address of position owner
toaddressThe address where claimed rewards will be sent to
amountRequesteduint256The amount of reward tokens to claim. Claims entire reward amount if set to 0.

Returns:

NameTypeDescription
rewarduint256

getRewardInfo

getRewardInfo(struct IIncentiveKey.IncentiveKey,uint256) 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