YieldHook
RobinhoodYieldHook is a Uniswap v4 hook on Robinhood Chain. Brand new: its first pool went live today.
- Contract name
- YieldHook
How this hook works
Trading taxA trading tax hook. It takes a tax on trades, charges more right after launch and limits trading to stop bots.
Takes a tax on trades
On top of the normal pool fee, it keeps part of each trade as a tax. Buys and sells can be charged differently. The tax can be changed. The tax is paid out in the same trade.
The code that does this (beforeSwap):function beforeSwap(address sender, PoolKey calldata, IPoolManager.SwapParams calldata params, bytes calldata) external onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) { _requireOpen(); if (!_specifiedIsEth(params)) { return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); } // Its tax would need a gross-up the surge can't integrate. if (!params.zeroForOne) revert ExactOutputSell(); uint256 rate = _buyTaxBpsOf(sender); uint256 fee = _abs(params.amountSpecified) * rate / _TAX_DENOMINATOR; if (fee == 0) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(fee.toInt128(), 0), 0); }Higher at launch
The tax starts higher right after launch and comes down over time, which makes it costly for bots to buy first.
The code that does this (buyTaxBps):function _buyTaxBps(uint256 start) private view returns (uint256) { if (block.timestamp <= start) return _LAUNCH_BUY_TAX_BPS; uint256 elapsed = block.timestamp - start; uint256 base = _fees.buyBps; if (elapsed >= _BUY_TAX_DECAY) return base; // `2% + 88% × (1 - t / 6h)²`, held at the base so `_payBuyTax` never underflows. // `left <= 6 hours`, so `8800 * left * left` can't overflow. unchecked { uint256 left = _BUY_TAX_DECAY - elapsed; uint256 curve = _BUY_TAX_FLOOR_BPS + (_LAUNCH_BUY_TAX_BPS - _BUY_TAX_FLOOR_BPS) * left * left / (_BUY_TAX_DECAY * _BUY_TAX_DECAY); return FixedPointMathLib.max(base, curve); } }Limits on trading
It limits trading, for example a max buy or wallet size or a wait between trades, to stop bots grabbing the supply before real traders.
The code that does this (sellTaxBps):function sellTaxBps() public view returns (uint256) { (uint256 netSold, uint256 refEth) = sellPressure(); Fees memory f = _fees; uint256 grace = refEth * _SURGE_GRACE_BPS / _TAX_DENOMINATOR; uint256 surge = netSold > grace ? (netSold - grace) * _TAX_DENOMINATOR / refEth : 0; return f.sellBps + FixedPointMathLib.min(surge, f.maxSellBps - f.sellBps); }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, IPoolManager.ModifyLiquidityParams calldata, bytes calldata ) external view onlyPoolManager returns (bytes4) { if (sender != registry.get(Keys.POS_MANAGER)) { revert NotPosManager(); } return IHooks.beforeAddLiquidity.selector; }No trading before the start
Trades are refused until trading has been opened.
The code that does this (requireOpen):function _requireOpen() private { if (_launchTime != 0) return; uint64 start = registry.launchTime(); if (block.timestamp < start) revert NotStarted(); _launchTime = start; }Simple trades only
Trades must state the amount going in, not the amount coming out.
The code that does this (beforeSwap):function beforeSwap(address sender, PoolKey calldata, IPoolManager.SwapParams calldata params, bytes calldata) external onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) { _requireOpen(); if (!_specifiedIsEth(params)) { return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); } // Its tax would need a gross-up the surge can't integrate. if (!params.zeroForOne) revert ExactOutputSell(); uint256 rate = _buyTaxBpsOf(sender); uint256 fee = _abs(params.amountSpecified) * rate / _TAX_DENOMINATOR; if (fee == 0) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(fee.toInt128(), 0), 0); }
Who controls it: The hook developer can change the fee and who pays no fee. 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 auditsetFeessetExemptionssetFeesWhat 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 before liquidity is removed, so it can delay or refuse LP exits.
It checks every deposit before it goes in.
It runs when a pool is created, often to lock in that pool’s settings.
It runs when someone donates tokens to the pool’s LPs.
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.