PumperTaxHook
BSCPumperTaxHook is a Uniswap v4 hook on BSC. Runs code on every swap. Can take tokens from swaps. Sets its own swap fee.
- Contract name
- PumperTaxHook
How this hook works
Trading taxA trading tax hook. It sets its own trading fee, takes a tax on trades and only takes simple trades.
Sets its own trading fee
Instead of a fixed fee chosen by the pool creator, it decides the fee itself on each trade.
The code that does this (beforeSwap):function beforeSwap(address, PoolKey calldata key, SwapParams calldata params, bytes calldata) external returns (bytes4, BeforeSwapDelta, uint24) { if (msg.sender != address(poolManager)) revert NotPoolManager(); if (params.amountSpecified > 0) revert ExactOutputNotSupported(); bool isBuy = _isBuy(key, params); if (!isBuy) { return (this.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, LPFeeLibrary.OVERRIDE_FEE_FLAG); } uint256 gross = uint256(-params.amountSpecified); (uint256 fee,) = PumperFeeMath.quoteFeeFromGross(gross, uint256(buyTaxBps + BASE_FEE_BPS) * 100); BeforeSwapDelta delta = toBeforeSwapDelta(int128(int256(fee)), 0); return (this.beforeSwap.selector, delta, LPFeeLibrary.OVERRIDE_FEE_FLAG); }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 is paid out in the same trade.
The code that does this (beforeSwap):function beforeSwap(address, PoolKey calldata key, SwapParams calldata params, bytes calldata) external returns (bytes4, BeforeSwapDelta, uint24) { if (msg.sender != address(poolManager)) revert NotPoolManager(); if (params.amountSpecified > 0) revert ExactOutputNotSupported(); bool isBuy = _isBuy(key, params); if (!isBuy) { return (this.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, LPFeeLibrary.OVERRIDE_FEE_FLAG); } uint256 gross = uint256(-params.amountSpecified); (uint256 fee,) = PumperFeeMath.quoteFeeFromGross(gross, uint256(buyTaxBps + BASE_FEE_BPS) * 100); BeforeSwapDelta delta = toBeforeSwapDelta(int128(int256(fee)), 0); return (this.beforeSwap.selector, delta, LPFeeLibrary.OVERRIDE_FEE_FLAG); }Simple trades only
Trades must state the amount going in, not the amount coming out.
The code that does this (beforeSwap):function beforeSwap(address, PoolKey calldata key, SwapParams calldata params, bytes calldata) external returns (bytes4, BeforeSwapDelta, uint24) { if (msg.sender != address(poolManager)) revert NotPoolManager(); if (params.amountSpecified > 0) revert ExactOutputNotSupported(); bool isBuy = _isBuy(key, params); if (!isBuy) { return (this.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, LPFeeLibrary.OVERRIDE_FEE_FLAG); } uint256 gross = uint256(-params.amountSpecified); (uint256 fee,) = PumperFeeMath.quoteFeeFromGross(gross, uint256(buyTaxBps + BASE_FEE_BPS) * 100); BeforeSwapDelta delta = toBeforeSwapDelta(int128(int256(fee)), 0); return (this.beforeSwap.selector, delta, LPFeeLibrary.OVERRIDE_FEE_FLAG); }
Who controls it: Nobody. The hook has no admin functions, and the code cannot be changed.
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.
Pools using it let the hook choose the swap fee instead of a fixed tier.
Hook history
- Took its tax from a trade 4 times
Latest transactions
- 0xe435c0c9…1c930b block 132,790,487
- 0xe435c0c9…1c930b block 132,790,487
- 0x450aebd4…62c868 block 132,790,411
- 0x1eeaccc0…b867fc block 132,790,362
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.