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 hookA custom hook. It pays extra to liquidity providers and controls who adds liquidity.
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 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. bool donated; try manager.donate(key, params.zeroForOne ? 0 : tax, params.zeroForOne ? tax : 0, "") returns (BalanceDelta) { donated = true; } catch {} if (!donated) return (IHooks.afterSwap.selector, 0); emit MevTaxDonated(PoolId.unwrap(key.toId()), sender, params.zeroForOne, amountOut, tax); return (IHooks.afterSwap.selector, int128(uint128(tax))); }Rules for adding liquidity
It decides who can add 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[tx.origin]) revert NotLiquidityOrigin(sender, tx.origin); return IHooks.beforeAddLiquidity.selector; }
Who controls it: The code itself can’t be changed. The hook developer can change: liquidity adder. The manager can call: after swap.
Based on the hook’s published code.
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.
Hook history
Nothing recorded 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.