Omniscia Steer Protocol Audit
FlatPosition3 Manual Review Findings
FlatPosition3 Manual Review Findings
FP3-01M: Improper Rounding of Nearest Tick
| Type | Severity | Location |
|---|---|---|
| Mathematical Operations | ![]() | FlatPosition3.sol:L28 |
Description:
The FlatPosition3::calculatePosition function will improperly round negative ticks toward 0, resulting in liquidity deployment that is slightly out-of-range.
Impact:
Simplified, the current system is meant to deploy liquidity around the current tick (i.e. for tick spacing 1 and active tick 2.5, the system deploys liquidity to the [1,3] range).
Due to how negative number rounding works, the system would deploy liquidity incorrectly for the negative counterpart of 2.5 (i.e. for -2.5, the system will presently deploy liquidity to [-3, -1] instead of [-4, -2]).
Example:
28int24 nearestTickMultiple = (currentTick / tickSpacing) * tickSpacing;29int24 lowerTick = nearestTickMultiple - tickSpacing;30int24 upperTick = nearestTickMultiple + tickSpacing;Recommendation:
We advise the nearest tick multiple to be calculated whilst rounding toward negative infinity, ensuring that the liquidity deployment performed is optimal.
Alleviation:
The code was updated to round toward the nearest tick properly, alleviating this exhibit.
