MetricMajorsHook
BSCMetricMajorsHook is a Uniswap v4 hook on BSC. Brand new: its first pool went live today.
- Contract name
- MetricMajorsHook
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, stops liquidity being added directly and creates its pools itself.
Takes a cut of every trade
On top of the normal pool fee, it keeps a share of each trade. It can never be above 0.05%. The fee is paid out in the same trade.
The code that does this (swap):function _swap(address sender, PoolKey calldata key, bool zeroForOne, int256 amountSpecified) internal returns (int256 beforeSwapDelta) { SwapCtx memory c; c.poolId = _toId(key); LinkedPool memory lp = _activePool(c.poolId); if (_tload(T_EXPECTED_POOL) != 0) revert Reentrancy(); (c.exactIn, c.specifiedAbs, c.metricAbs) = _amounts(amountSpecified); c.inCur = zeroForOne ? key.currency0 : key.currency1; c.outCur = zeroForOne ? key.currency1 : key.currency0; _requireMetricLive(lp.pool, zeroForOne != lp.flipped); if (c.exactIn) { // Metric is paid with `take` from the PoolManager, so the input must already be there (settle-first // routers) or be covered by its reserves. Same outcome as without this check, only cheaper. uint256 available = IERC20(c.inCur).balanceOf(poolManager); if (available < c.specifiedAbs) revert InsufficientSettlementInventory(c.inCur, c.specifiedAbs, available); } c.protocolFee = _protocolFee(c.poolId, zeroForOne); (c.inputPaid, c.grossOut) = _fillOnMetric(lp, zeroForOne != lp.flipped, c); (int128 specifiedDelta, int128 unspecifiedDelta, uint256 fee) = _userAmounts(c.exactIn, c.specifiedAbs, c.metricAbs, c.inputPaid, c.grossOut); if (fee != 0) { IPoolManager(poolManager).mint(feeRecipient, uint256(uint160(c.outCur)), fee); emit HookFeeCollected(c.poolId, c.outCur, feeRecipient, fee); } unspecifiedDelta = _chargeProtocolFee(c, unspecifiedDelta); // …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.
Trading can be paused
The hook can stop all trading in its pools until it is switched back on.
The code that does this (link):function _link(address pool, uint160 sqrtPriceX96) private { if (pool == address(0) || pool.code.length == 0) revert ExternalPoolNotFound(); (address token0, address token1, address adm) = _checkMetricPool(pool); if (!_allowedPair(token0, token1)) revert TokenNotAllowed(); bytes32 existing = canonicalPoolId[pool]; if (existing != bytes32(0)) revert PairAlreadyHasCanonicalPool(existing); poolExpectedAdmin[pool] = adm; uint8 r = _metricReason(pool); if (r == 5) revert MetricPoolPaused(_pauseLevel(pool)); if (r == 6) revert MetricNoLiquidity(); if (lastTickSpacing == MAX_TICK_SPACING) revert TooManyPools(); int24 tickSpacing = ++lastTickSpacing; bool flipped = token0 > token1; PoolKey memory key = PoolKey({ currency0: flipped ? token1 : token0, currency1: flipped ? token0 : token1, fee: 0, tickSpacing: tickSpacing, hooks: address(this) }); bytes32 poolId = keccak256(abi.encode(key)); canonicalPoolId[pool] = poolId; linkedPool[poolId] = LinkedPool({pool: pool, flipped: flipped}); _poolKeys[poolId] = key; initializedPoolIds.push(poolId); emit MetricPoolLinked(poolId, pool, tickSpacing); // v4-core does not call a pool's hook when the hook itself is the caller (Hooks.noSelfCall), so this // initialize skips beforeInitialize; the registration event is emitted here instead. // …
Who controls it: Nobody. The hook has no admin functions, and 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 auditMetricOmmPoolFactory: nothing there can change how trades go.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.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Linked the metric pool 12 times
- Registered an aggregator pool 12 times
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.