AntiMevTaxHook
RobinhoodAntiMevTaxHook is a Uniswap v4 hook on Robinhood Chain. Runs code on every swap. Can take tokens from swaps. Gates who can add liquidity.
- Contract name
- AntiMevTaxHook
How this hook works
Custom pricingA custom pricing hook. It sets its own prices, pays extra to liquidity providers and controls who adds or removes liquidity.
Sets its own prices
It can change how much traders get out of a trade, using its own pricing instead of Uniswap’s normal formula.
Pays extra to liquidity providers
It sends extra rewards straight into the pool for liquidity providers.
The code that does this (handleAfterSwap):function _handleAfterSwap( address sender, PoolKey calldata key, SwapParams calldata params, BalanceDelta delta ) private returns (bytes4, int128) { uint256 busy; assembly ("memory-safe") { busy := tload(T_BUSY) } if (busy != 0) return (IHooks.afterSwap.selector, 0); (uint256 amountOut, uint256 tax) = _recordAndMeasureTax(key, params, delta); if (tax == 0) return (IHooks.afterSwap.selector, 0); // donate debits this hook and the returned delta credits it back, so the // tax ends up in feeGrowthGlobal and the hook's own balance stays zero. assembly ("memory-safe") { tstore(T_BUSY, 1) } bool donated; try manager.donate(key, params.zeroForOne ? 0 : tax, params.zeroForOne ? tax : 0, "") returns (BalanceDelta) { donated = true; } catch {} assembly ("memory-safe") { tstore(T_BUSY, 0) } if (!donated) return (IHooks.afterSwap.selector, 0); // …Rules for adding or removing liquidity
It decides who can add or remove liquidity, or when.
The code that does this (beforeAddLiquidity):function beforeAddLiquidity(address sender, PoolKey calldata, ModifyLiquidityParams calldata, bytes calldata) external view onlyManager returns (bytes4) { if (!liquidityAdder[sender]) revert NotLiquidityAdder(sender); return IHooks.beforeAddLiquidity.selector; }
Who controls it: The code itself can’t be changed. The hook developer can change: liquidity adder, before add liquidity, after swap.
Based on the hook’s published code.
Hook history
- Liquidity adder set 1 time
Only recent activity is shown: this hook’s past history hasn’t been read yet.
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. Still reading older history, so totals will grow.
What 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 checks every deposit before it goes in.