Anti-Toxicity Hook

This UniswapV4 hook reduces impermanent loss by rewarding trades that goes against the market

Anti-Toxicity Hook

Created At

ETHGlobal Buenos Aires

Winner of

Uniswap Foundation

Uniswap Foundation - Uniswap v4 Stable-Asset Hooks 3rd place

Project Description

This UniswapV4 hook protects liquidity providers from impermanent loss by incentivizing balanced trading activity. When traders execute large one-directional trades that move prices significantly, liquidity providers typically lose value compared to simply holding their assets. This hook addresses that problem by encouraging traders to swap in the opposite direction of recent price movements, helping liquidity providers rebalance their positions back to equilibrium. Additionally, LPs can opt into automated position management, allowing the hook to rebalance their positions on their behalf.

How it's Made

The hook intercepts swap through beforeSwap and afterSwap callbacks to implement a dynamic rebalancing incentive system. The core mechanism tracks and measures cumulative directional trading pressure. When swaps occur, we compute their impact relative to the past trend since rebalancing and depending on this, the fee is adjusted Traders swapping against the current imbalance receive fee discounts, while trades worsening the imbalance pay premium fees. This creates natural economic incentives for arbitrageurs to play against the market, resulting in rebalancing opportunities for market makers. For LPs who opt in, we implemented automated position management that monitors trends and automatically place the right ranges and even, place rebalancing ranges when needed.

background image mobile

Join the mailing list

Get the latest news and updates

Anti-Toxicity Hook | ETHGlobal