IStrategy

Git Source

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

NameTypeDescription
_minWethToMintuint256The 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

NameTypeDescription
_maxWethToMintuint256The 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

NameTypeDescription
_percentWethToMintuint256What 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

NameTypeDescription
_lowerBurnDiffint24The 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

NameTypeDescription
_upperBurnDiffint24The 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

NameTypeDescription
_volatilitySafeRangeMinuint256_volatilitySafeRangeMin

VOLATILITY_SAFE_RANGE_MAX

The bottom of the safe range for volatility

function VOLATILITY_SAFE_RANGE_MAX() external view returns (uint256 _volatilitySafeRangeMax);

Returns

NameTypeDescription
_volatilitySafeRangeMaxuint256_volatilitySafeRangeMax

getPositionToMint

Returns the next position to mint

function getPositionToMint(IStrategy.LockManagerState calldata _lockManagerState)
    external
    view
    returns (IStrategy.LiquidityPosition memory _positionToMint);

Returns

NameTypeDescription
_positionToMintLiquidityPosition.IStrategyThe 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

NameTypeDescription
_positionPosition.IStrategyThe position to burn, without liquidity
_positionLiquidityuint128The liquidity in the position
_lockManagerStateLockManagerState.IStrategy

Returns

NameTypeDescription
_positionToBurnLiquidityPosition.IStrategyThe 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;
}