Omniscia Steer Protocol Audit

LiquidityManagerHelper Manual Review Findings

LiquidityManagerHelper Manual Review Findings

LMH-01M: Insecure Calculations of Average Tick

TypeSeverityLocation
Mathematical OperationsLiquidityManagerHelper.sol:
I-1: L65
I-2: L69

Description:

The referenced operations in the average tick calculation are performed using checked arithmetic incorrectly.

Impact:

The LiquidityManagerHelper::uniV4Volatility will revert for abnormal cumulative tick deltas contrary to what its implementation implies.

Example:

src/helpers/LiquidityManagerHelper.sol
63// Call observe on the Oracle Hook to get tickCumulatives
64(int56[] memory tickCumulatives,) = oracleHook.observe(poolKey, secondsAgos);
65int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0];
66int24 twapTick = int24(tickCumulativesDelta / int56(uint56(twapInterval)));
67// Round to negative infinity for negative values
68if (tickCumulativesDelta < 0 && (tickCumulativesDelta % int56(uint56(twapInterval)) != 0)) {
69 twapTick--;
70}

Recommendation:

We advise unchecked arithmetic to be employed in these calculations, ensuring that the average tick is properly calculated regardless of whether the cumulative tick values have overflown.

Alleviation:

The relevant statements were updated by wrapping them in an unchecked code block and thus ensuring they are executed securely, alleviating this exhibit.