CamelotV3Farm
Inherits: E721Farm, OperableDeposit, ClaimableFee
Author: Sperax Foundation.
This contract is the implementation of the Camelot V3 farm.
State Variables
tickLowerAllowed
tickUpperAllowed
camelotPool
camelotV3Factory
camelotUtils
nfpmUtils
MIN_TICK
MAX_TICK
Functions
initialize
Initializer function of this farm.
Parameters
Name | Type | Description |
---|---|---|
|
| A struct having all the input params. |
increaseDeposit
Allow user to increase liquidity for a deposit.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the deposit to be increased. |
|
| Desired amount of tokens to be increased. |
|
| Minimum amount of tokens to be added as liquidity. |
decreaseDeposit
Withdraw liquidity partially from an existing deposit.
Parameters
Name | Type | Description |
---|---|---|
|
| Deposit index for the user. |
|
| Amount to be withdrawn. |
|
| Minimum amount of tokens to be received. |
getTokenAmounts
Function to be called by Demeter Rewarder to get tokens and amounts associated with the farm's liquidity.
Returns
Name | Type | Description |
---|---|---|
|
| tokens An array of token addresses. |
|
| amounts An array of token amounts. |
_claimPoolFee
Claim pool fee implementation from ClaimableFee
feature.
Parameters
Name | Type | Description |
---|---|---|
|
| Deposit ID of the deposit in the farm. |
_getLiquidity
Validate the position for the pool and get Liquidity.
The position must adhere to the price ranges.
Only allow specific pool token to be staked.
Parameters
Name | Type | Description |
---|---|---|
|
| The tokenId of the position. |
Returns
Name | Type | Description |
---|---|---|
|
| The liquidity of the position. |
_validateTickRange
Validate the ticks (upper and lower).
Get the info of the required token.
Check if the token belongs to correct pool.
Check if the token adheres to the tick range.
The ticks must be within the max range and must be multiple of tickSpacing.
Parameters
Name | Type | Description |
---|---|---|
|
| The lower tick of the range. |
|
| The upper tick of the range. |