.png?fit=max&auto=format&n=Vl0nE0D6Q6gCTn0P&q=85&s=7e470918d01f82bb301d6012e85690eb)
The challenge
Liquidity pools (especially low-liquidity pools on launchpads and pools for creator coins) are highly exposed to MEV, including sandwich attacks. These strategies front-run regular users’ transactions to extract profit, often at the expense of traders and liquidity providers. The challenge is to mitigate this behavior with a solution that remains gas-efficient, fully on-chain, and independent of external infrastructure. It should not require additional nodes, off-chain oracles, or external modules. A standalone Smart Contract that can operate on any network where Uniswap v4 is available.The solution
Pulse Hook maintains a shared median of gas priority fees across all connected pools. When a user’s priority fee significantly exceeds this median, the Hook applies an additional swap fee. As a result, sharp priority-fee spikes become increasingly expensive and can make MEV-driven transactions economically unprofitable. At the same time, the mechanism adapts to network-wide demand. If priority fees rise broadly (for example, during a bullish market when many users compete for faster execution) the median rises with them. The additional penalty then rapidly decreases, allowing regular users to trade without being penalized for a market-wide increase in fees. Pulse Hook is a short name of Priority Fee Pulse Hook - the mechanism to listen to the pulse of the chain, creating a defense layer against MEV bots.Hook Features
Priority Fee Median
The main low-gas mechanism to keep up with pools activity pulse. Updates quite quickly as it is algorithmic median built using Frugal2U approach. Results in 15-blocks snapshots that keeps it even more effective and protective.
Dynamic Fees 1.5x Curve
Keep the fees low for real users and high for MEV bots. The fees are up to specially created curve witр разгон при большем выходе.
Dust Attacks Double Protection
The hook whitelists ‘sound’ tokens. (USDС, WETH, etc.) Only pools that have at least one whitelisted token can update the Median. Also the Tick Tracker lets updates pass only on meaningful price movement, preventing dust-based manipulation.
Now you are welcome to E2E Flow section where it is described step-by-step how exactly this hook works (with code snippets included).
Ready to build?
Initialize Pool
Check the networks where the hook is already deployed and initialize your pool there!
Deploy Hook
Copy this hook, modify it and deploy any custom version. (this hook is MIT-licensed!)
.png?fit=max&auto=format&n=C7oPvmhXeuVhT6xg&q=85&s=54e062a2730088900bc417bad64dbd49)