CivicHook
RobinhoodCivicHook is a Uniswap v4 hook on Robinhood Chain. Brand new: its first pool went live today. Active: 82 trades in the last week, and 1 new pool this week.
- Contract name
- CivicHook
How this hook works
Custom pricingA custom pricing hook. It sets its own prices, manages its own liquidity and buys back the token.
Sets its own prices
It can fill trades itself, at its own price, instead of using Uniswap’s normal formula.
The code that does this (buy):function _buy(address sender, PoolKey calldata key, uint256 amountIn, uint160 limit) private returns (BeforeSwapDelta) { uint256 fee = amountIn * feeBps / BPS; uint256 net = amountIn - fee; BalanceDelta d = poolManager.swap(key, SwapParams({zeroForOne: true, amountSpecified: -net.toInt256(), sqrtPriceLimitX96: limit}), ""); if (uint256(uint128(-d.amount0())) != net) revert PriceLimitReached(); uint256 out = uint256(uint128(d.amount1())); _accrueFee(fee); emit Trade(sender, true, net, out, fee, 0); return toBeforeSwapDelta(amountIn.toInt128(), -(out.toInt128())); }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 (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { (uint8 op, bytes memory args) = abi.decode(data, (uint8, bytes)); PoolKey memory key = poolKey(); if (op == OP_DEEPEN) { (uint256 ethMax, uint256 semioMax) = abi.decode(args, (uint256, uint256)); (uint160 sqrtPriceX96,,,) = poolManager.getSlot0(key.toId()); int24 lower = TickMath.minUsableTick(TICK_SPACING); int24 upper = TickMath.maxUsableTick(TICK_SPACING); uint128 liquidity = LiquidityAmounts.getLiquidityForAmounts( sqrtPriceX96, TickMath.getSqrtPriceAtTick(lower), TickMath.getSqrtPriceAtTick(upper), ethMax, semioMax ); (BalanceDelta d,) = poolManager.modifyLiquidity( key, ModifyLiquidityParams(lower, upper, uint256(liquidity).toInt256(), 0), "" ); uint256 ethUsed = uint256(uint128(-d.amount0())); uint256 semioUsed = uint256(uint128(-d.amount1())); if (ethUsed > 0) poolManager.settle{value: ethUsed}(); if (semioUsed > 0) { poolManager.sync(key.currency1); semio.safeTransfer(address(poolManager), semioUsed); poolManager.settle(); } return abi.encode(liquidity, ethUsed, semioUsed); } if (op == OP_RECIRCULATE) { uint256 amount = abi.decode(args, (uint256)); BalanceDelta d = poolManager.swap( key, SwapParams({zeroForOne: true, amountSpecified: -amount.toInt256(), sqrtPriceLimitX96: TickMath.MIN_SQRT_PRICE + 1}), "" ); uint256 paid = uint256(uint128(-d.amount0())); // …Buys back the token
It uses what it collects to buy the token back.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { (uint8 op, bytes memory args) = abi.decode(data, (uint8, bytes)); PoolKey memory key = poolKey(); if (op == OP_DEEPEN) { (uint256 ethMax, uint256 semioMax) = abi.decode(args, (uint256, uint256)); (uint160 sqrtPriceX96,,,) = poolManager.getSlot0(key.toId()); int24 lower = TickMath.minUsableTick(TICK_SPACING); int24 upper = TickMath.maxUsableTick(TICK_SPACING); uint128 liquidity = LiquidityAmounts.getLiquidityForAmounts( sqrtPriceX96, TickMath.getSqrtPriceAtTick(lower), TickMath.getSqrtPriceAtTick(upper), ethMax, semioMax ); (BalanceDelta d,) = poolManager.modifyLiquidity( key, ModifyLiquidityParams(lower, upper, uint256(liquidity).toInt256(), 0), "" ); uint256 ethUsed = uint256(uint128(-d.amount0())); uint256 semioUsed = uint256(uint128(-d.amount1())); if (ethUsed > 0) poolManager.settle{value: ethUsed}(); if (semioUsed > 0) { poolManager.sync(key.currency1); semio.safeTransfer(address(poolManager), semioUsed); poolManager.settle(); } return abi.encode(liquidity, ethUsed, semioUsed); } if (op == OP_RECIRCULATE) { uint256 amount = abi.decode(args, (uint256)); BalanceDelta d = poolManager.swap( key, SwapParams({zeroForOne: true, amountSpecified: -amount.toInt256(), sqrtPriceLimitX96: TickMath.MIN_SQRT_PRICE + 1}), "" ); uint256 paid = uint256(uint128(-d.amount0())); // …Keeps a price record
It records the pool’s price over time, so other apps can read a fair average price.
The code that does this (beforeSwap):function _beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata) internal override returns (bytes4, BeforeSwapDelta, uint24) { if (params.amountSpecified >= 0) revert ExactInputOnly(); // SEMIO bought at the wall in an earlier trade goes to the treasury first, so every trade is priced // against the true floor. _deliverPending(key); _observe(); uint256 amountIn = uint256(-params.amountSpecified); BeforeSwapDelta delta = params.zeroForOne ? _buy(sender, key, amountIn, params.sqrtPriceLimitX96) : _sell(sender, key, amountIn, params.sqrtPriceLimitX96); return (BaseHook.beforeSwap.selector, delta, 0); }Liquidity can’t be added directly
Nobody can add liquidity to its pools through Uniswap directly. Liquidity only comes in through the hook’s own code.
Only the hook creates its pools
Nobody can create a pool with this hook directly. Pools are only created through the hook’s own code.
Anyone can trigger payouts
Anyone can send the collected fees on to where they go, so nobody has to wait on the hook developer.
The code that does this (sweep):function sweep() external nonReentrant { uint256 fees = pendingFees; uint256 bought = pendingSemio; if (fees == 0 && bought == 0) return; pendingFees = 0; pendingSemio = 0; poolManager.unlock(abi.encode(OP_SWEEP, abi.encode(fees, bought))); if (fees > 0) treasury.depositIncome{value: fees}(); emit Swept(fees, bought); }
Who controls it: The hook developer can change the settings of its pools and who else can run it. The hook developer can also change: params. The hook developer can also call: open pool, recirculate. Control can be passed on or given up. 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 auditrecirculatesetParamssetParamsWhat 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.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Handled a trade 42 times
Latest transactions
- 0x5df7e7e3…d8834f block 118,461,164
- 0xdb1ab4af…3bb249 block 118,386,684
- 0x9c242f78…1b0b51 block 118,359,589
- 0x22b346a0…043411 block 118,357,217
- 0x56f429cc…126059 block 118,243,237
- 0x6240e937…b77724 block 118,226,085
- 0xe3d8c42f…0843d6 block 118,211,760
- 0x5aafc5b6…3224c1 block 118,175,693
- 0x4bf6859f…6e446e block 118,158,757
- 0x7c8b8bf3…d98b3e block 118,147,481
- Sent on what it had collected 3 times
Latest transactions
- 0x9611e2c4…358bb9 block 118,362,309
- 0xb5c0a73c…975df6 block 118,212,105
- 0x23b35986…7bd7b2 block 117,772,399
- Deepened 2 times
Latest transactions
- 0x34c39280…baedfd block 117,903,753
- 0x0a844e18…8acffb block 117,731,160
- Opened a pool 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.