# BlockReversal > Charges the swap that unwinds a block's own price move, which is the only leg of a sandwich that can be identified without knowing who anybody is. A production Uniswap v4 hook. Source: https://github.com/nirholas/block-reversal. Part of the HookForge catalogue: https://hookforge.pages.dev ## How it works Anti-sandwich designs almost all try to identify the attacker: track an address, require a bond, tax a trader who reverses direction. Every one of them is defeated by a second EOA, which costs a bot nothing. Identity is the wrong thing to look at, because a sandwich is not a property of who is trading. It is a property of the price path. A sandwich has a shape: within one block, the price moves away from where the block opened and then comes back. The profitable leg is always the one that comes back, because that is where the position is closed. This hook never asks who is trading. It records where the price stood when the block opened, watches how far it has travelled since, and prices any swap that moves it back toward the opening more expensively the more of that move it is unwinding. The victim is not charged: their swap is the one that moves the price away. Nor is the attacker's opening leg. Only the close pays, which is the leg that has something to pay with. The same charge lands on an honest trader who happens to trade against the block's direction, and that is not a flaw to apologise for. Such a trader is buying at a price that an earlier trade in the same block improved for them, at the expense of the liquidity providers who supplied it. Returning part of that improvement to those providers is the correct answer whether the trader meant to sandwich anybody or not. The fee is an LP fee, so that is exactly where it goes. Nothing here needs an oracle, an auction, a keeper, a bond, a private mempool, or a way to tell one address from another. It reads the pool's own tick against where the block opened, and that is all. ## Prior art Sandwich-resistant AMM designs reorder or batch within a block. Encrypted mempools (Shutter, SUAVE) hide the order. Auction-based capture (am-AMM, MEV-Share, Diamond) sells or reclaims the backrun. Volatility-indexed dynamic fees raise the fee for everybody when the pool is moving. Pricing an individual swap by how much of the current block's own price move it is unwinding, so the closing leg pays and the victim does not, with no identity and no auction, is the contribution here. ## Where it does not help An honest trader who trades against the block's direction pays the surcharge too. That is deliberate and it is the real cost: the mechanism cannot distinguish a sandwich close from an ordinary trade in the same direction, because at the level it observes them they are the same event. It also does nothing about a sandwich split across two blocks, which is a different and much riskier attack for the attacker to run. And a pool with a large `thresholdTicks` is protected only against sandwiches big enough to cross it, while a small one charges ordinary two-way flow more often; that trade is the pool's to make. ## Facts Slug: block-reversal Contract: BlockReversalHook Callbacks: beforeSwap, afterInitialize Parameters: baseFee (uint24), maxSurcharge (uint24), thresholdTicks (int24), halfPointTicks (int24) Dynamic fee required: yes ## Caveats - Unaudited. - A deployment with status "deterministic" is a mined CREATE2 address with no code at it yet. Never present one as live.