diff --git a/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap index b48bc474..719a1d85 100644 --- a/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap @@ -1 +1 @@ -247511 +247511 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerBytecodeSize.snap b/.forge-snapshots/BinPoolManagerBytecodeSize.snap index 1572975a..f4afe765 100644 --- a/.forge-snapshots/BinPoolManagerBytecodeSize.snap +++ b/.forge-snapshots/BinPoolManagerBytecodeSize.snap @@ -1 +1 @@ -24762 +24759 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerBytecodeSize.snap b/.forge-snapshots/CLPoolManagerBytecodeSize.snap index 6981f87e..4cbe3896 100644 --- a/.forge-snapshots/CLPoolManagerBytecodeSize.snap +++ b/.forge-snapshots/CLPoolManagerBytecodeSize.snap @@ -1 +1 @@ -24839 \ No newline at end of file +24829 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#initializeWithoutHooks.snap b/.forge-snapshots/CLPoolManagerTest#initializeWithoutHooks.snap index d43a864a..e65bdc36 100644 --- a/.forge-snapshots/CLPoolManagerTest#initializeWithoutHooks.snap +++ b/.forge-snapshots/CLPoolManagerTest#initializeWithoutHooks.snap @@ -1 +1 @@ -149801 \ No newline at end of file +149782 \ No newline at end of file diff --git a/test/pool-bin/libraries/BinHelper.t.sol b/test/pool-bin/libraries/BinHelper.t.sol index 5b8cad2f..b13f109b 100644 --- a/test/pool-bin/libraries/BinHelper.t.sol +++ b/test/pool-bin/libraries/BinHelper.t.sol @@ -59,6 +59,22 @@ contract BinHelperTest is BinTestHelper { } } + // run test via: forge test --match-test testLiquidityPOC -vvv + function testLiquidityPOC() external { + uint24 binId = 8_393_426; + uint16 binStep = 10; + uint256 price = PriceHelper.getPriceFromId(binId, binStep); + assertEq(price, 41997625866672948725687173685150666229626); + console2.log("price: ", price); + + uint128 amtX = 1e18; + uint128 amtY = 2e18; + bytes32 amounts = amtX.encode(amtY); + uint256 liquidity = BinHelper.getLiquidity(amounts, price); + console2.log("liquidity :", liquidity); + assertEq(liquidity, 42678190600514825652613922900014202652538000000000000000000); + } + function testFuzz_getSharesAndEffectiveAmountsIn( uint128 binReserveX, uint128 binReserveY,