diff --git a/onchain/src/LiquidityManager.sol b/onchain/src/LiquidityManager.sol index 6d209d9..c317246 100644 --- a/onchain/src/LiquidityManager.sol +++ b/onchain/src/LiquidityManager.sol @@ -61,6 +61,7 @@ contract LiquidityManager { IUniswapV3Pool private immutable pool; bool private immutable token0isWeth; PoolKey private poolKey; + address private recenterAccess; // the 3 positions this contract is managing enum Stage { FLOOR, ANCHOR, DISCOVERY } @@ -152,6 +153,14 @@ contract LiquidityManager { harb.setMinStakeSupplyFraction(mssf_); } + function setRecenterAccess(address addr) external onlyFeeDestination { + recenterAccess = addr; + } + + function revokeRecenterAccess() external onlyFeeDestination { + recenterAccess = address(0); + } + receive() external payable { } @@ -443,6 +452,9 @@ contract LiquidityManager { /// @notice Adjusts liquidity positions in response to an increase or decrease in the Harberg token's price. /// @dev This function should be called when significant price movement is detected. It recalibrates the liquidity ranges to align with the new market conditions. function recenter() external { + if (recenterAccess != address(0)) { + require(msg.sender == recenterAccess, "access denied"); + } // Fetch the current tick from the Uniswap V3 pool (, int24 currentTick, , , , , ) = pool.slot0(); // check slippage with oracle