fix: getLiquidityParams: int256 overflow on large VWAP values (#622)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5deb1eab0c
commit
7007e593da
2 changed files with 76 additions and 0 deletions
|
|
@ -414,6 +414,7 @@ contract Optimizer is Initializable, UUPSUpgradeable, IOptimizer {
|
|||
// ---- Slot 2: pricePosition (also needs VWAP) ----
|
||||
if (vwapTracker != address(0)) {
|
||||
uint256 vwapX96 = IVWAPTracker(vwapTracker).getVWAP();
|
||||
require(vwapX96 <= uint256(type(int256).max), "VWAP exceeds int256 range");
|
||||
if (vwapX96 > 0) {
|
||||
// Convert pool tick to KRK-price space: higher tick = more expensive KRK.
|
||||
// Uniswap convention: tick ↑ → token1 more expensive relative to token0.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue