Assessment reports>Beefy UniswapV3>Discussion>Positions might jump due to tick spacing

Positions might change more than expected due to tick spacing

Positions can only be initialized at ticks divisible by tickSpacing, which is a value set by Uniswap. In the StrategyPassiveManagerUniswap contract, when setting positions, the current tick is thus rounded down to the next value divisible by tickSpacing to obtain the midpoint of the position:

/// @dev Calc base ticks depending on base threshold and tickspacing
function baseTicks(
    int24 currentTick,
    int24 baseThreshold,
    int24 tickSpacing
) internal pure returns (int24 tickLower, int24 tickUpper) {
    int24 tickFloor = floor(currentTick, tickSpacing);

    tickLower = tickFloor - baseThreshold;
    tickUpper = tickFloor + baseThreshold;
}

This means that the tick moving across a number divisible by tickSpacing can cause the position to move a full tickSpacing, which may be much larger than the tick change. For example, with tickSpacing being 10 and the position previously having been set at a tick of 19, the tick increasing by only 1 to 20, will cause the position range to move up by 10.

This effect should be taken in mind when considering the settings for _onlyCalmPeriods.

Zellic © 2024Back to top ↑