GuUniswapV4Hook on Arbitrum
Uniswap v4 Hook Contract 0x300b9d513b65e8b56eb52699e606a29eb2a91acc on Arbitrum · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $1.87K
- All-time volume
- $361.18K
- Pools using this hook
- 30
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 2,274
What it does
A singleton Uniswap v4 hook for GuCoin/reserve-token pools that applies an adaptive, volatility-based swap fee, a sliding per-direction fee factor, and splits collected fees between burning GuCoin, the pool fee receiver and the protocol owner.
How it works step by step
- Forces the pool to use a dynamic fee: the hook's LP fee override is a fixed 1% (LP_BASE_FEE = 10,000 ppm) applied to protocol-owned position NFTs on every swap.
- Computes an adaptive fee from a volatility oracle (Camelot/Algebra-style AdaptiveFee with a Timepoint ring buffer of 65,536 entries) when dynamicFeeEnabled is true, otherwise uses baseFee.
- Applies a sliding fee factor per direction (zeroToOne and oneToZero) that moves with the tick change since the last recorded timepoint, scaled by priceChangeFactor.
- Takes an additional hook fee in the swap's unspecified or input currency via poolManager.take and returns it as a hook delta, then distributes it.
- Blocks swaps unless the GuCoin token reports isLPd() is true, and optionally consults an external security registry that can disable a pool or put it into burn-only mode.
- Swap behaviour
- beforeSwap requires the GuCoin to be LPd, checks the security registry, updates fee factors and the oracle timepoint, and for exact-input swaps takes a fee of amountSpecified * fee / 1,000,000 as a hook delta. afterSwap handles exact-output swaps by taking a fee on the input amount, and reverts with UnsupportedExactOutputFee if the fee is at or above 100%.
- Liquidity behaviour
- beforeAddLiquidity is gated by the security registry (DISABLED reverts, BURN_ONLY reverts). beforeRemoveLiquidity is gated only by the DISABLED status. No fee or delta is taken on liquidity operations.
- Fee behaviour
- Fees are dynamic: a volatility-based adaptive fee (or baseFee if disabled) is multiplied by a sliding factor per direction, clamped between 1 and 65,535 ppm-units. The hook also takes a separate fee delta on swaps. For GuCoin fees, communityFeeRatio percent is burned via IGuCoinHookView.burn and the remainder goes to feeReceiver. For reserve-token fees, protocolFeeRatio percent goes to the factory owner and the remainder to feeReceiver.
- Owner & admin controls
- The factory owner (read from GU_FACTORY.owner(), checked on every call, so ownership transfer on the factory transfers control) can set protocolFeeRatio up to 100%, assign a per-pool security registry, change the fee configuration (alpha, beta, gamma, baseFee, validated by AdaptiveFee), toggle dynamic and sliding fees, change priceChangeFactor and set baseFee for any registered pool. The hook itself is not a proxy and no upgrade or pause function is present in the ABI. registerPool is restricted to the GU liquidity manager and sets initial fee parameters. prepayTimepointsStorageSlots is callable by anyone and only writes placeholder timestamps to uninitialized slots.
Enabled Uniswap v4 callbacks
afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
afterInitialize seeds the volatility oracle timepoint for the pool. beforeAddLiquidity and beforeRemoveLiquidity enforce the security registry status. beforeSwap sets the dynamic fee override, takes the exact-input fee and writes oracle state. afterSwap takes the exact-output fee. beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take tokens from swaps via deltas.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The factory owner can set arbitrary fee parameters, the protocol fee split, the security registry per pool and the sliding and dynamic fee toggles, so a compromised or malicious owner key can raise fees to the maximum, disable any pool via the registry, and redirect protocol fee receipts by changing the ratio. There is no timelock or pause visible in the source.
Risk to user funds: The hook takes swap fees from user input through hook deltas and holds no persistent token balance, forwarding fees to the feeReceiver, the burn function and the factory owner. It cannot directly seize LP principal from the pool, but its fee logic, owner-set parameters and registry can block swaps or liquidity actions, and the owner can increase the fee taken from every trade.
Security findings
- [high] Owner can set the fee to the maximum: changeFeeConfiguration and setBaseFee are owner-only and accept any value that passes AdaptiveFee.validateFeeConfiguration (for baseFee) or a uint16 (for setBaseFee). The owner can raise swap fees on any pool, up to the clamp of 65,535 units, and this applies to every swap immediately.
- [medium] Swaps and liquidity can be blocked by an external registry: The per-pool securityRegistry, settable by the factory owner, can make a pool DISABLED (reverting all swaps and liquidity adds and removes) or BURN_ONLY (reverting swaps and adds). Trust in the registry and in whoever sets it is required.
- [medium] Hook takes tokens via return deltas: The hook has beforeSwapReturnDelta and afterSwapReturnDelta permissions and calls poolManager.take on swaps, so it removes user funds from the pool as fees. Fee distribution depends on token and config balances; the hook must not fail or leak funds during distribution.
- [medium] Swaps gated on an external isLPd flag: beforeSwap reverts with NotLPd unless IGuCoinHookView(guCoin).isLPd() returns true. The GuCoin token controls this, so the token owner can halt swaps for that pool.
- [info] Owner dependency via the factory: The owner is read from the factory on every privileged call and on every reserve-token fee payout. Transferring ownership at the factory immediately moves control of fee parameters and protocol fee receipts.
Contract details
- Verified source
- Yes (GuUniswapV4Hook)
- Compiler
- solc 0.8.20+commit.a1b79de6
- Bytecode size
- 14,835 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, oracle, return-delta, rewards
Pools using GuUniswapV4Hook
- ARB / GU (Dynamic fee) — 24h volume $0, TVL $1.06K, 0 swaps today
- ALIGNED / ARB (Dynamic fee) — 24h volume $0, TVL $279, 0 swaps today
- ARB / GUBERTO (Dynamic fee) — 24h volume $0, TVL $394, 0 swaps today
- ARB / yARBulke (Dynamic fee) — 24h volume $0, TVL $136, 0 swaps today
- ARB / ARBT (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- ARB / SIZECHAD (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- APEPE / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- MITT / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- ARB / DINOROAR (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- TRUM / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- ARB / WallStreetBets (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- ARB / MILES (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- ARB / BRA (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- 1美元 / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- NOLA / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- GUCAT / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- ARB / NOLA (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- KITTY / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- WORLD / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- 42161 / ARB (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today