DiemStakerHook
BaseDiemStakerHook is a Uniswap v4 hook on Base. Live for 1 day. Busy: 942 trades in the last week, and 1 new pool this week.
- Contract name
- DiemStakerHook
How this hook works
Trading taxA trading tax hook. It takes 2% of every trade, manages its own liquidity and needs signed approvals.
Takes 2% of every trade
On top of the normal pool fee, it takes 2% of each trade. The rate is written into the code. The fee builds up in the hook until it is collected.
The code that does this (beforeSwap):function _beforeSwap(address, PoolKey calldata, SwapParams calldata params, bytes calldata) internal override returns (bytes4, BeforeSwapDelta, uint24) { if (_specifiedIs0(params) != tokenIs0) { int256 s = params.amountSpecified; uint256 fee = (s < 0 ? uint256(-s) : uint256(s)) * FEE_BPS / 10_000; if (fee > 0) { _takeFee(fee); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(fee.toInt128(), 0), 0); } } return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); }Manages its own liquidity
It adds and removes liquidity itself, so it can own part or all of the pool.
The code that does this (addLaunchLiquidity):function _addLaunchLiquidity() internal { uint256 amount = token.balanceOf(address(this)); int24 lower; int24 upper; uint128 liquidity; if (tokenIs0) { lower = -START_TICK; upper = TickMath.maxUsableTick(TICK_SPACING); liquidity = LiquidityAmounts.getLiquidityForAmount0( TickMath.getSqrtPriceAtTick(lower), TickMath.getSqrtPriceAtTick(upper), amount ); } else { lower = TickMath.minUsableTick(TICK_SPACING); upper = START_TICK; liquidity = LiquidityAmounts.getLiquidityForAmount1( TickMath.getSqrtPriceAtTick(lower), TickMath.getSqrtPriceAtTick(upper), amount ); } (BalanceDelta delta,) = poolManager.modifyLiquidity( poolKey, ModifyLiquidityParams(lower, upper, int256(uint256(liquidity)), 0), "" ); int128 owed = tokenIs0 ? delta.amount0() : delta.amount1(); poolManager.sync(Currency.wrap(address(token))); token.transfer(address(poolManager), uint256(uint128(-owed))); poolManager.settle(); emit Launched(liquidity); }Needs a signed approval
Some actions need a message signed by an approved address.
The code that does this (isValidSignature):function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4) { (address signer, ECDSA.RecoverError err,) = ECDSA.tryRecover(hash, signature); if (err == ECDSA.RecoverError.NoError && signer != address(0) && signer == agentSigner) { return IERC1271.isValidSignature.selector; } return 0xffffffff; }Locks tokens or liquidity
Some tokens or liquidity are locked for a set time and can’t be taken out before then.
The code that does this (unlockedDiem):function unlockedDiem() external view returns (uint256 amount) { for (uint256 i = nextLot; i < lots.length && block.timestamp >= unlockTime(i); i++) { amount += lots[i].amount; } }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, uint160) internal view override returns (bytes4) { require(sender == address(this), "only launch"); return IHooks.beforeInitialize.selector; }
Who controls it: The hook developer can change when trading opens and who else can run it. The hook developer can also change: owner. The hook developer can also call: initiate diem unstake, claim and restake vvv, initiate vvv unstake. The hook developer can withdraw funds held by the hook. 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 auditWhat it can do
Its code executes inside each trade in pools that use it.
It can take or add tokens during a swap. Fees, burns and custom curves work this way, and so do scams.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Took its fee from a trade 942 times
Latest transactions
- 0xc24eee13…099459 block 61,623,559
- 0x28d9a31d…cc8c89 block 61,623,559
- 0x742edc49…462548 block 61,579,606
- 0xec9817eb…d9287b block 61,569,562
- 0x81155250…2fddfd block 61,569,562
- 0xff37cff1…d6245b block 61,569,562
- 0x0b63e126…7d504b block 61,569,507
- 0xc2a607eb…237cd6 block 61,498,879
- 0x9e319538…c4ced9 block 61,498,593
- 0x90ef63d6…8e3357 block 61,498,592
- A holder staked tokens 7 times
Latest transactions
- 0x10657a09…e3ccb1 block 61,561,233
- 0xb4588395…fb8187 block 61,416,267
- 0x75b5662a…a1a178 block 61,400,536
- 0xc391dd46…6b934b block 61,346,493
- 0xf160d3c6…771c45 block 61,273,663
- 0x3c8bae37…254b9f block 61,203,234
- 0x78ee7eae…85841a block 61,095,233
- Handled trade money (this hook holds the pool’s funds) 7 times
Latest transactions
- 0x10657a09…e3ccb1 block 61,561,233 · 0.0207 DIEM
- 0xb4588395…fb8187 block 61,416,267 · 0.0117 DIEM
- 0x75b5662a…a1a178 block 61,400,536 · 0.0418 DIEM
- 0xc391dd46…6b934b block 61,346,493 · 0.0886 DIEM
- 0xf160d3c6…771c45 block 61,273,663 · 0.0692 DIEM
- 0x3c8bae37…254b9f block 61,203,234 · 0.498 DIEM
- 0x78ee7eae…85841a block 61,095,233 · 0.822 DIEM
- Launched a new token 1 time
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.