DeFi risk-analysis

Interaction with Uniswap v4 protocol to protect LPs from LVR liquidity attack

DeFi risk-analysis

Created At

HackMoney 2026

Project Description

The Liquidity Depth Risk Pool project is an advanced automated market maker (AMM) design built on Uniswap v4. It uses Hooks to create a "self-aware" pool that monitors its own health and adjusts fees in real-time to protect liquidity providers (LPs).

Simple Description Standard liquidity pools are passive and often vulnerable to "toxic flow"—sophisticated traders who drain value from a pool when its liquidity is low or prices are volatile. This project introduces an Automated Risk Manager (the hook) that acts as a "surge pricing" algorithm. It calculates the "Risk Premium" of a trade based on how "shallow" the pool is and automatically increases swap fees to compensate LPs for the higher risk of being a counterparty to an informed trader.

How it's Made

Depth-Dependent Fees The pool automatically raises swap fees when liquidity (depth) falls below a safe threshold.

LVR Mitigation Protects LPs from "Loss-Versus-Rebalancing" (LVR) by making it too expensive for arbitrageurs to exploit the pool during volatile moments.

beforeSwap Logic The risk assessment runs before every trade, ensuring the fee is always current and relevant to the immediate state of the pool.

Dynamic Fee Override Uses v4’s dynamic fee capability to bypass static tiers (like v3's 0.3%) in favor of a calculated risk-based rate.

Self-Healing Incentive High fees in low-liquidity states act as a "Risk Premium," signaling to LPs that it is a highly profitable time to deposit more assets and stabilize the pool.

background image mobile

Join the mailing list

Get the latest news and updates

DeFi risk-analysis | ETHGlobal