Algebra main farming contract
Developer note: Manages farmings and performs entry, exit and other actions.
modifier isOwner(uint256 tokenId)
internal
Name | Type | Description |
---|---|---|
The eternal farming contract
The nonfungible position manager with which this farming contract is compatible
The Algebra poolDeployer contract
Developer note: saves addresses of virtual pools for pool
Developer note: deposits[tokenId] => incentiveId
constructor(contract IAlgebraEternalFarming _eternalFarming, contract INonfungiblePositionManager _nonfungiblePositionManager) public
public
function enterFarming(struct IncentiveKey key, uint256 tokenId) external
external
Enters in incentive (time-limited or eternal farming) with NFT-position token Developer note: token must be deposited in FarmingCenter
function exitFarming(struct IncentiveKey key, uint256 tokenId) external
external
Exits from incentive (time-limited or eternal farming) with NFT-position token
function applyLiquidityDelta(uint256 tokenId, int256 liquidityDelta) external
external
Report a change of liquidity in position
function increaseLiquidity(uint256 tokenId, uint256 liquidityDelta) external
external
function decreaseLiquidity(uint256 tokenId, uint256 liquidityDelta) external returns (bool success)
external
Returns:
function burnPosition(uint256 tokenId) external returns (bool success)
external
Report a burn of position token
Returns:
function collectRewards(struct IncentiveKey key, uint256 tokenId) external returns (uint256 reward, uint256 bonusReward)
external
Used to collect reward from eternal farming. Then reward can be claimed.
Returns:
function claimReward(contract IERC20Minimal rewardToken, address to, uint256 amountRequested) external returns (uint256 reward)
external
Used to claim and send rewards from farming(s) Developer note: can be used via static call to get current rewards for user
Returns:
function connectVirtualPool(contract IAlgebraPool pool, address newVirtualPool) external
external
Updates activeIncentive in AlgebraPool Developer note: only farming can do it
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
tokenId
uint256
_eternalFarming
contract IAlgebraEternalFarming
_nonfungiblePositionManager
contract INonfungiblePositionManager
key
struct IncentiveKey
The incentive event key
tokenId
uint256
The id of position NFT
key
struct IncentiveKey
The incentive event key
tokenId
uint256
The id of position NFT
tokenId
uint256
The ID of the token for which liquidity is being added
liquidityDelta
int256
The amount of added liquidity
tokenId
uint256
liquidityDelta
uint256
tokenId
uint256
liquidityDelta
uint256
success
bool
tokenId
uint256
The ID of the token which is being burned
success
bool
key
struct IncentiveKey
The incentive event key
tokenId
uint256
The id of position NFT
reward
uint256
The amount of collected reward
bonusReward
uint256
The amount of collected bonus reward
rewardToken
contract IERC20Minimal
The token that is a reward
to
address
The address to be rewarded
amountRequested
uint256
Amount to claim in eternal farming
reward
uint256
The summary amount of claimed rewards
pool
contract IAlgebraPool
The AlgebraPool for which farming was created
newVirtualPool
address