> ## Documentation Index
> Fetch the complete documentation index at: https://pulse-hook.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pulse Hook

> Uniswap v4 hook to resist MEV using nothing but 100% on-chain Math. 

<Frame>
  <img alt="Frame 1" title="Frame 1" lightAlt="Frame 1" darkAlt="Frame 2" src="https://mintcdn.com/pulse-hook/Vl0nE0D6Q6gCTn0P/images/Frame-45(1).png?fit=max&auto=format&n=Vl0nE0D6Q6gCTn0P&q=85&s=7e470918d01f82bb301d6012e85690eb" className="dark:hidden" width="1884" height="684" data-path="images/Frame-45(1).png" />

  <img alt="Frame 1" title="Frame 1" lightAlt="Frame 1" darkAlt="Frame 2" src="https://mintcdn.com/pulse-hook/C7oPvmhXeuVhT6xg/images/Frame-45(3).png?fit=max&auto=format&n=C7oPvmhXeuVhT6xg&q=85&s=54e062a2730088900bc417bad64dbd49" className="hidden dark:block" width="1884" height="684" data-path="images/Frame-45(3).png" />
</Frame>

## 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.**

<Frame>
  The dynamic fee described above is applied to every swap on every pool that uses this hook. Whitelisting (below) does not turn the fee off for a pool — it only controls whether that pool's swaps are allowed to influence the shared median.
</Frame>

# Hook Features

<Card title="Priority Fee Median" color="#FF00F6" icon="chart-bar">
  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.
</Card>

<Card title="Dynamic Fees 1.5x Curve" color="#FF00F6" icon="coins">
  Keep the fees low for real users and high for MEV bots. Use specially created curve to punish only those who deserve it.
</Card>

<Card title="Dust Attacks Double Protection" color="#FF00F6" icon="device-vision-pro">
  The hook has a chain-specific whitelist of chain core tokens, set at deploy time. A pool is marked as registered **once, when it is created**, based on whether either of its two tokens is on that whitelist — this is not re-checked on every swap. Only registered pools' swaps are allowed to update the shared Median. The second defense layer is the Tick Moves Tracker: even on a registered pool, a swap only updates the Median if the pool's price has moved meaningfully since the last accepted update, which also helps avoid small (dust) transactions aimed at moving the Median.
</Card>

<Frame>
  Now you are welcome to [<u>E2E Flow</u>](/overview/e2e-flow) section where it is described step-by-step how exactly this hook works (with code snippets included).
</Frame>

# Ready to build?

<Columns cols={2}>
  <Column>
    <Card title="Initialize Pool" color="#FF00F6" icon="sparkle-highlight" href="https://app.mintlify.com/mpf-hook/pulse-hook/~/c9b06671-47ed-4049-8106-ac36140e63b9">
      Check the networks where the hook is already deployed and initialize your pool there!
    </Card>
  </Column>

  <Column>
    <Card title="Deploy Hook" color="#FF00F6" icon="rocket" href="https://app.mintlify.com/mpf-hook/pulse-hook/~/0cace275-51c3-43c8-bd4c-91fa7ab735f1">
      You can copy this hook, modify it and deploy wherever your want. This hook is MIT-licensed. Note: the constructor's listed-token array is only read once at deploy time and tolerates up to two zero-address entries before it reverts — double-check your token list before deploying.
    </Card>
  </Column>
</Columns>
