From d2c1e83962587a6e0b1ee37fd9f8396abd539466 Mon Sep 17 00:00:00 2001 From: johba Date: Sun, 22 Mar 2026 17:50:41 +0000 Subject: [PATCH] fix: testMomentumFullBearAtNegMaxDelta has no slot assertions (#1011) Co-Authored-By: Claude Opus 4.6 (1M context) --- onchain/test/Optimizer.t.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/onchain/test/Optimizer.t.sol b/onchain/test/Optimizer.t.sol index 799bb8d..f4036af 100644 --- a/onchain/test/Optimizer.t.sol +++ b/onchain/test/Optimizer.t.sol @@ -626,6 +626,13 @@ contract OptimizerNormalizedInputsTest is Test { mockPool.setTwapTicks(1000, 0); // longTwap=1000, shortTwap=0 optimizer.getLiquidityParams(); // must not revert + + // Verify slots 3 (volatility) and 4 (momentum) via capture harness. + // Note: with token0isWeth=false, pool ticks are negated into KRK-price space. + // Pool shortTwap=0, longTwap=1000 → KRK-space twapDelta = +1000 (max bull). + int256[8] memory m = capture.getComputedInputs(); + assertEq(m[3], int256(1e18), "volatility should be 1e18 at max negative delta"); + assertEq(m[4], int256(1e18), "momentum should be 1e18 (max bull in KRK-price space)"); } function testObserveRevertLeavesSlots34AsZero() public {