IStrategy
Functions
MIN_WETH_TO_MINT
The minimum amount of WETH that can be minted into a new position
Remember safe deployment for min width is 1 ETH these amounts are already considering the 1/2 minting
function MIN_WETH_TO_MINT() external view returns (uint256 _minWethToMint);
Returns
Name | Type | Description |
---|---|---|
_minWethToMint | uint256 | The minimum amount of WETH that can be minted into a new position |
MAX_WETH_TO_MINT
The maximum amount of WETH that can be minted into a new position
function MAX_WETH_TO_MINT() external view returns (uint256 _maxWethToMint);
Returns
Name | Type | Description |
---|---|---|
_maxWethToMint | uint256 | The maximum amount of WETH that can be minted into a new position |
PERCENT_WETH_TO_MINT
50% of idle WETH per mint is used
function PERCENT_WETH_TO_MINT() external view returns (uint256 _percentWethToMint);
Returns
Name | Type | Description |
---|---|---|
_percentWethToMint | uint256 | What percentage of idle WETH to use for minting |
LOWER_BURN_DIFF
How far to the right from the current tick a position should be in order to be burned
function LOWER_BURN_DIFF() external view returns (int24 _lowerBurnDiff);
Returns
Name | Type | Description |
---|---|---|
_lowerBurnDiff | int24 | The tick difference |
UPPER_BURN_DIFF
How far to the left from the current tick a position should be in order to be burned
function UPPER_BURN_DIFF() external view returns (int24 _upperBurnDiff);
Returns
Name | Type | Description |
---|---|---|
_upperBurnDiff | int24 | The tick difference |
VOLATILITY_SAFE_RANGE_MIN
The top of the safe range for volatility
function VOLATILITY_SAFE_RANGE_MIN() external view returns (uint256 _volatilitySafeRangeMin);
Returns
Name | Type | Description |
---|---|---|
_volatilitySafeRangeMin | uint256 | _volatilitySafeRangeMin |
VOLATILITY_SAFE_RANGE_MAX
The bottom of the safe range for volatility
function VOLATILITY_SAFE_RANGE_MAX() external view returns (uint256 _volatilitySafeRangeMax);
Returns
Name | Type | Description |
---|---|---|
_volatilitySafeRangeMax | uint256 | _volatilitySafeRangeMax |
getPositionToMint
Returns the next position to mint
function getPositionToMint(IStrategy.LockManagerState calldata _lockManagerState)
external
view
returns (IStrategy.LiquidityPosition memory _positionToMint);
Returns
Name | Type | Description |
---|---|---|
_positionToMint | LiquidityPosition.IStrategy | The position |
getPositionToBurn
Returns the next position to burn
function getPositionToBurn(
IStrategy.Position calldata _position,
uint128 _positionLiquidity,
IStrategy.LockManagerState calldata _lockManagerState
) external view returns (IStrategy.LiquidityPosition memory _positionToBurn);
Parameters
Name | Type | Description |
---|---|---|
_position | Position.IStrategy | The position to burn, without liquidity |
_positionLiquidity | uint128 | The liquidity in the position |
_lockManagerState | LockManagerState.IStrategy |
Returns
Name | Type | Description |
---|---|---|
_positionToBurn | LiquidityPosition.IStrategy | The position to burn, with liquidity |
Errors
Strategy_PoolManipulated
Thrown when the price oracle detects a manipulation
error Strategy_PoolManipulated();
Strategy_NotEnoughWeth
Thrown when minting a position requires more WETH than available in the lock manager
error Strategy_NotEnoughWeth();
Strategy_NotFarEnoughToLeft
Thrown when the position to burn is too close to the current tick
error Strategy_NotFarEnoughToLeft();
Strategy_NotFarEnoughToRight
Thrown when the position to burn is too close to the current tick
error Strategy_NotFarEnoughToRight();
Structs
LockManagerState
Lock manager variables needed for the strategy
struct LockManagerState {
IPoolManager poolManager;
IUniswapV3Pool pool;
uint256 availableWeth;
bool isWethToken0;
int24 tickSpacing;
}
Position
UniswapV3 pool position
struct Position {
int24 lowerTick;
int24 upperTick;
}
LiquidityPosition
UniswapV3 pool position with the amount of liquidity
struct LiquidityPosition {
int24 lowerTick;
int24 upperTick;
uint128 liquidity;
}