# CircuitBreaker > Halts swapping for a cooldown after the price moves further than a pool is willing to move in one window, and lets liquidity leave the whole time. A production Uniswap v4 hook. Source: https://github.com/nirholas/circuit-breaker. Part of the HookForge catalogue: https://hookforge.pages.dev ## How it works Every venue outside crypto stops trading after a limit move, for a reason that has nothing to do with paternalism: a violent move is usually either an error or an attack, and the cheapest defence against both is to stop, let information arrive, and start again. On-chain the same event is normally handled by a governance multisig that pauses a contract minutes after it mattered. This hook makes the rule mechanical and local to one pool. It keeps a reference tick, refreshed at most once per `windowSeconds`. After every swap it compares the new tick to that reference. If the pool moved further than `maxTickMove`, swapping halts for `cooldownSeconds` and then resumes on its own. There is no admin, no pause key and no way for anyone, including the deployer, to halt a pool that has not moved or to extend a halt that has expired. The design decision worth stating: the swap that breaches the limit is allowed to complete. Reverting it instead would turn the hook into a price cap, and a price cap on an AMM is a strictly worse instrument than a halt. It cannot be enforced (the same move arrives as several smaller swaps), it strands the pool at a price the market has left, and it guarantees that the arbitrage against the pool stays open and profitable for as long as the cap holds. Halting after the fact gives up the last swap and buys the thing that actually matters, which is time. Liquidity operations are never blocked. A provider can withdraw during a halt, which is the property that makes this safe to use: the worst case for someone caught in a halted pool is that they exit rather than trade. One tick is one basis point to within rounding (`1.0001^1`), so `maxTickMove = 500` is a five percent move. Prior art: pause-guardian patterns are everywhere and oracle-deviation checks exist as hooks. An autonomous, self-clearing, per-pool halt with no privileged role and no oracle does not. ## Prior art Pause-guardian patterns are everywhere and oracle-deviation checks exist as hooks. An autonomous, self-clearing, per-pool halt with no privileged role and no oracle does not. ## Where it does not help A halt is a blunt instrument: it stops honest trading as well as the attack, and it leaves the pool arbitrageable the moment it lifts. It is the right trade only where the alternative is a pool drained at a price nobody would have quoted. ## Facts Slug: circuit-breaker Contract: CircuitBreakerHook Callbacks: afterSwap, beforeSwap, afterInitialize Parameters: maxTickMove (uint24), windowSeconds (uint32), cooldownSeconds (uint32) Dynamic fee required: no ## Caveats - Unaudited. - A deployment with status "deterministic" is a mined CREATE2 address with no code at it yet. Never present one as live.