Skip to content

[Bug] REGRESSION, Can't create pools with dynamic fees and hooks anymore #7935

@mikeghen

Description

@mikeghen

📱 Interface Affected

Which application are you experiencing issues with?


🧩 App Version

  • Version (if known):
  • Production build
  • Development build

💻 System / Environment Info

Please provide details about your environment:

  • Browser (name + version): Chrome
  • OS / Platform (e.g. iOS 17, Windows 11, Android 14):
  • Device (e.g. iPhone 14 Pro, Pixel 7, MacBook Pro 2023):
  • Wallet used (e.g. Uniswap Wallet, MetaMask, Rainbow): Metamask
  • Network (e.g. Ethereum Mainnet, Arbitrum, Base, etc.): Base

🔁 Steps to Reproduce

  1. Go to add a new pool on Base with details:

token1: WBTC. 0x0555E30da8f98308EdB960aa94C0Db47230d2B9c
token2: DCA: 0xb1599CDE32181f48f89683d3C5Db5C5D2C7C93cc
Hook: 0xBc5F29A583a8d3ec76e03372659e01a22feE3A80
Fees: Dynamic

  1. Try to set dynamic fee for the pool.

✅ Expected Behavior

Let me set dynamic fees for this pool.


❌ Actual Behavior

Can't set dynamic fees anymore


📸 Screenshots or Screen Recording

Image

Click on more options, gives no dynamic fee option:
Image


🧾 Additional Context

@plondon This looks like another regression from recent changes. I'll look for a better work around for the issue in the UI maybe some of the links from the other issue about creating liquidity pools.

I created a pool manually with Solidity and then tryed to add liquidity in the frontend by filling in the form, didn't work. The pool creation worked fine though:

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.22;

/**
 * @title CreateDCAWBTCPool
 * @notice Script to create a Uniswap V4 liquidity pool for DCA and WBTC tokens
 * @dev Usage:
 *   forge script script/CreateDCAWBTCPool.sol:CreateDCAWBTCPool --rpc-url <RPC_URL> --broadcast
 * 
 * Required Environment Variables:
 *   - POOL_MANAGER_ADDRESS: Address of the Uniswap V4 Pool Manager
 *   - HOOK_ADDRESS: Address of the deployed SuperDCAGauge hook
 * 
 * Optional Environment Variables:
 *   - DEPLOYER_PRIVATE_KEY: Private key for deployment (defaults to anvil test key)
 *   - WBTC_ADDRESS: WBTC token address (defaults to mainnet WBTC: 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599)
 *   - INITIAL_SQRT_PRICE_X96: Initial pool price as sqrtPriceX96 (defaults to 1 WBTC = 1,000,000 DCA)
 * 
 * Example (Base WBTC-DCA pool deployment)
 *   export POOL_MANAGER_ADDRESS=0x498581fF718922c3f8e6A244956aF099B2652b2b
 *   export HOOK_ADDRESS=0xBc5F29A583a8d3ec76e03372659e01a22feE3A80
 *   export WBTC_ADDRESS=0x0555e30da8f98308edb960aa94c0db47230d2b9c
 *   forge script script/CreateDCAWBTCPool.sol:CreateDCAWBTCPool --rpc-url $BASE_RPC_URL --broadcast
 */

import {Script} from "forge-std/Script.sol";
import {SuperDCAGauge} from "../src/SuperDCAGauge.sol";
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol";
import {Currency} from "@uniswap/v4-core/src/types/Currency.sol";
import {IHooks} from "@uniswap/v4-core/src/interfaces/IHooks.sol";
import {LPFeeLibrary} from "@uniswap/v4-core/src/libraries/LPFeeLibrary.sol";
import {console2} from "forge-std/Test.sol";

contract CreateDCAWBTCPool is Script {
    uint256 deployerPrivateKey;
    address poolManagerAddress;
    address hookAddress;
    address wbtcAddress;
    uint160 initialSqrtPriceX96;

    // DCA Token is constant across all Superchain networks
    address public constant DCA_TOKEN = 0xb1599CDE32181f48f89683d3C5Db5C5D2C7C93cc;

    function setUp() public {
        deployerPrivateKey = vm.envOr(
            "DEPLOYER_PRIVATE_KEY", uint256(0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80)
        );
        
        poolManagerAddress = vm.envAddress("POOL_MANAGER_ADDRESS");
        if (poolManagerAddress == address(0)) {
            revert("POOL_MANAGER_ADDRESS environment variable not set.");
        }
        
        hookAddress = vm.envAddress("HOOK_ADDRESS");
        if (hookAddress == address(0)) {
            revert("HOOK_ADDRESS environment variable not set.");
        }
        
        wbtcAddress = vm.envOr("WBTC_ADDRESS", 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599); // Default to mainnet WBTC
        if (wbtcAddress == address(0)) {
            revert("WBTC_ADDRESS environment variable not set.");
        }
        
        // Default initial price: Read off slot 0 of another pool.
        initialSqrtPriceX96 = 3767241712749534125677730192756442473;
    }

    function run() public {
        vm.startBroadcast(deployerPrivateKey);

        IPoolManager poolManager = IPoolManager(poolManagerAddress);
        SuperDCAGauge hook = SuperDCAGauge(payable(hookAddress));

        console2.log("Pool Manager:", address(poolManager));
        console2.log("Hook Address:", address(hook));
        console2.log("DCA Token:", DCA_TOKEN);
        console2.log("WBTC Token:", wbtcAddress);
        console2.log("Initial Sqrt Price X96:", initialSqrtPriceX96);

        // Create pool key for DCA/WBTC pool
        // Currency0 should be the smaller address
        PoolKey memory dcaWbtcPoolKey = PoolKey({
            currency0: DCA_TOKEN < wbtcAddress ? Currency.wrap(DCA_TOKEN) : Currency.wrap(wbtcAddress),
            currency1: DCA_TOKEN < wbtcAddress ? Currency.wrap(wbtcAddress) : Currency.wrap(DCA_TOKEN),
            fee: LPFeeLibrary.DYNAMIC_FEE_FLAG,
            tickSpacing: 10,
            hooks: IHooks(hook)
        });

        console2.log("Currency0:", Currency.unwrap(dcaWbtcPoolKey.currency0));
        console2.log("Currency1:", Currency.unwrap(dcaWbtcPoolKey.currency1));
        console2.log("Fee:", dcaWbtcPoolKey.fee);
        console2.log("Tick Spacing:", dcaWbtcPoolKey.tickSpacing);

        console2.log("Initializing DCA/WBTC pool...");
        int24 tick = poolManager.initialize(dcaWbtcPoolKey, initialSqrtPriceX96);
        console2.log("Pool initialized successfully!");
        console2.log("Initial tick:", tick);

        vm.stopBroadcast();
    }
} 

⚠️ Please redact or avoid sharing sensitive data such as private keys, seed phrases, or personally identifying info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions