BscUsdfAggregator
BSCHookBscUsdfAggregator is a Uniswap v4 hook on BSC. Brand new: its first pool went live today.
- Contract name
- BscUsdfAggregator
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, stops liquidity being added directly and only lets approved callers create pools.
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 code that does this (conductSwap):function _conductSwap(Currency output, Currency inputCurrency, SwapParams calldata params, PoolId id) internal override returns (uint256 net, uint256 input, bool) { _check(id); if (!params.zeroForOne) revert ReverseDirectionNotSupported(); if (params.amountSpecified >= 0) revert ExactOutputNotSupported(); input = uint256(-params.amountSpecified); if (input == 0 || input > MAX_AMOUNT) revert InvalidAmount(); uint256 expectedGross = _quoteGross(input); if (expectedGross == 0 || expectedGross > MAX_AMOUNT) revert InvalidAmount(); poolManager.take(inputCurrency, address(this), input); uint256 balBefore = USDF.balanceOf(address(this)); MINTER.deposit(input); uint256 gross = USDF.balanceOf(address(this)) - balBefore; if (gross != expectedGross) revert OutputMismatch(); poolManager.sync(output); USDF.safeTransfer(address(poolManager), gross); if (poolManager.settle() != gross) revert OutputMismatch(); uint256 fee = Math.mulDiv(gross, feePips, PIPS); net = gross - fee; if (net == 0) revert InvalidAmount(); // …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 approved callers create pools
New pools with this hook can only be created by approved callers, for example its own factory or launcher.
The code that does this (beforeInitialize):function _beforeInitialize(address sender, PoolKey calldata key, uint160 price) internal override returns (bytes4) { _check(key.toId()); return super._beforeInitialize(sender, key, price); }Trading can be paused
The hook can stop all trading in its pools until it is switched back on.
The code that does this (quoteGross):function _quoteGross(uint256 amountIn) private view returns (uint256 gross) { if (MINTER.paused() || !MINTER.USDTDepositEnabled()) revert MintingPaused(); uint256 comm = MINTER.commissionRate(); if (comm >= COMMISSION_DENOM) revert MintingPaused(); // Matches USDFEarn._mintUSDF(): amountIn * (1e4 - commissionRate) / 1e4 gross = Math.mulDiv(amountIn, COMMISSION_DENOM - comm, COMMISSION_DENOM); if (USDF.totalSupply() + gross > MINTER.USDFMaxSupply()) revert CapExceeded(); }Simple trades only
Trades must state the amount going in, not the amount coming out.
The code that does this (rawQuote):function _rawQuote(bool zeroForOne, int256 specified, PoolId id) internal view override returns (uint256) { _check(id); if (!zeroForOne) revert ReverseDirectionNotSupported(); if (specified >= 0) revert ExactOutputNotSupported(); uint256 amountIn = uint256(-specified); if (amountIn == 0 || amountIn > MAX_AMOUNT) revert InvalidAmount(); uint256 gross = _quoteGross(amountIn); if (gross == 0 || gross > MAX_AMOUNT) revert InvalidAmount(); uint256 net = gross - Math.mulDiv(gross, feePips, PIPS); if (net == 0) revert InvalidAmount(); return net; }
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 auditWhat 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.
Pools using it let the hook choose the swap fee instead of a fixed tier.
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
- Registered an aggregator pool 1 time
Settings changes: changed the token jar (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.