Liquidity management hook on Polygon
Uniswap v4 Hook Contract 0xd1268a97a26b70534177a07eea9427c9cd192888 on Polygon · Liquidity management
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
This hook runs a multi-asset share vault on a Uniswap v4 pool that gates liquidity and rebalances the basket during swaps, with fee terms set by the owner; the direction in which trades pay more or less cannot be determined from the decoded bytecode.
How it works step by step
- Acts as a multi-asset vault hook for a Uniswap v4 pool: holds a basket of assets (assetCount, asset(i), addAsset, removeAsset) and issues a share token (totalSupply, balanceOf, mint/burn of shares).
- Tracks net asset value (nav, totalValue, holdings) and prices shares from it, with a cap and minimum deposit.
- Controls liquidity through beforeAddLiquidity and beforeRemoveLiquidity, which gate who may add or remove liquidity against the vault.
- Uses beforeSwap with beforeSwapReturnDelta, so the hook can take or give currency via return deltas to rebalance the basket (rebalance, rebalanceAll, setWeights).
- Supports redemption in kind (redeemInKind, previewRedeem, previewRedeemToCash) and fee-based mint/redeem pricing (mintFeeBps, redeemFeeBps, dynamic-fee tag).
- Includes a pause switch, per-address freeze/burnFrozen, and a manager role, plus rescue functions for stuck tokens.
- Swap behaviour
- beforeSwap is implemented and can return a delta, so swaps through the pool may have currency taken or supplied by the hook to rebalance assets; which trades pay more or less is not determinable from the decoded bytecode.
- Liquidity behaviour
- beforeAddLiquidity and beforeRemoveLiquidity are implemented and gate liquidity changes against vault accounting; afterAddLiquidity and afterRemoveLiquidity exist in the selector set but are not enabled as permissions.
- Fee behaviour
- Fees are dynamic in the sense of mint and redeem fee bps (mintFeeBps, redeemFeeBps with MIN/MAX bounds, set via setParams). Swap fee logic is not clearly determinable; the pool may use a dynamic fee set by the hook.
- Owner & admin controls
- Owner (Ownable with two-step transfer: transferOwnership, acceptOwnership, renounceOwnership) can set parameters (setParams), manage assets and feeds (addAsset, removeAsset, setFeed, setPaths), set weights, freeze addresses, toggle managers, pause (setPaused), and rescue tokens (rescueToken, rescueAll). Managers can trigger rebalances. The contract is not behind a proxy based on the observed selectors.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta
beforeInitialize: pool initialization checks and setup. beforeAddLiquidity: gates liquidity additions. beforeSwap: may apply rebalancing and return deltas. beforeSwapReturnDelta: lets the hook take or give currency during swaps.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner key can change fees and weights, freeze holders, pause the vault, rescue tokens and set oracle feeds, which can directly affect user value and redemption outcomes.
Risk to user funds: The hook holds basket assets and can move them through swaps, rebalances and rescues; users depend on the owner and managers not acting maliciously and on feed accuracy.
Security findings
- [high] Hook can move currency via return deltas: beforeSwapReturnDelta is enabled and beforeSwap is non-view, so the hook can take or supply tokens on swaps and rebalances; a malicious or buggy configuration could extract pool value.
- [high] Owner and manager can rebalance and reweight: setWeights, rebalance, rebalanceAll, setPaths and setFeed let privileged roles change how the basket is traded and priced, which can shift value between LPs and the vault.
- [medium] Owner can rescue tokens and freeze users: rescueAll and rescueToken can move tokens held by the contract, and setFrozen/burnFrozen can block or burn a specific holder's shares.
- [medium] Pausable with cap and fee parameters: setPaused can halt operations, and setParams sets fee bounds and minimum deposit; the owner can change these at will.
- [medium] Oracle and feed dependency: Pricing relies on configured feeds (setFeed, StalePrice error), so stale or manipulated feeds would misprice shares.
Contract details
- Verified source
- No
- Bytecode size
- 23,258 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, erc20, liquidity-management, moves-currency, ownable, pausable, return-delta, self-unlock
Pools using Liquidity management hook
- vTRADE / USDT0 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today