DynamicLimitHook
EthereumDynamicLimitHook is a Uniswap v4 hook on Ethereum. Brand new: its first pool went live today. Active: 499 trades in the last week, and 1 new pool this week.
- Contract name
- DynamicLimitHook
How this hook works
Bot protectionA bot protection hook. It limits trading to stop bots, only lets approved callers create pools and holds trading back until it is opened.
Limits on trading
It limits trading, for example a max buy or wallet size or a wait between trades, to stop bots grabbing the supply before real traders.
The code that does this (afterSwap):function afterSwap(address, PoolKey calldata, SwapParams calldata, int256 delta, bytes calldata) external onlyPoolManager returns (bytes4, int128) { if (!tradingEnabled) revert TradingNotEnabled(); int256 usdcDelta = usdcIsCurrency0 ? delta >> 128 : int256(int128(delta)); uint256 limit = limitUsd; if (usdcDelta < 0) { // USDC in -> buying dlSTR uint256 total = _boughtUsdThisTx + uint256(-usdcDelta); if (total > limit) revert MaxBuyExceeded(total, limit); _boughtUsdThisTx = total; } else if (usdcDelta > 0) { // USDC out -> selling dlSTR uint256 total = _soldUsdThisTx + uint256(usdcDelta); if (total > limit) revert MaxSellExceeded(total, limit); _soldUsdThisTx = total; } return (this.afterSwap.selector, 0); }Only approved callers create pools
New pools with this hook can only be created by approved callers, for example its own factory or launcher.
The code that does this (beforeInitialize):function beforeInitialize(address sender, PoolKey calldata key, uint160) external view onlyPoolManager returns (bytes4) { if (sender != owner) revert NotOwner(); (address c0, address c1) = usdcIsCurrency0 ? (usdc, token) : (token, usdc); if (key.currency0 != c0 || key.currency1 != c1) revert WrongPool(); return this.beforeInitialize.selector; }No trading before the start
Trades are refused until trading has been opened.
The code that does this (afterSwap):function afterSwap(address, PoolKey calldata, SwapParams calldata, int256 delta, bytes calldata) external onlyPoolManager returns (bytes4, int128) { if (!tradingEnabled) revert TradingNotEnabled(); int256 usdcDelta = usdcIsCurrency0 ? delta >> 128 : int256(int128(delta)); uint256 limit = limitUsd; if (usdcDelta < 0) { // USDC in -> buying dlSTR uint256 total = _boughtUsdThisTx + uint256(-usdcDelta); if (total > limit) revert MaxBuyExceeded(total, limit); _boughtUsdThisTx = total; } else if (usdcDelta > 0) { // USDC out -> selling dlSTR uint256 total = _soldUsdThisTx + uint256(usdcDelta); if (total > limit) revert MaxSellExceeded(total, limit); _soldUsdThisTx = total; } return (this.afterSwap.selector, 0); }
Who controls it: The hook developer can change the trading limits and when trading opens. The code cannot be changed.
Based on the hook’s published code.What do these labels mean?
Safety report
Before you build on it. Automated checks, not an auditsetLimitsetLimitWhat it can do
Its code executes inside each trade in pools that use it.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Opened trading 1 time
Settings changes: set the limit (5 times).
Counted from what the hook recorded on-chain across all its pools, for every action in its published code, plus token transfers in and out of it.