Delta-neutral LP on Uniswap v4, earn trading fees while auto-hedging downside via V4 Hooks + GMX
HedgeLP is the first protocol to combine Uniswap v4 Hooks with perpetual protocol hedging to create a truly delta-neutral liquidity provision strategy (there's Dripd
The core problem: liquidity providers on DEXs lose money to impermanent loss when token prices move. In a -30% ETH crash, a traditional LP suffers -34.5% losses. HedgeLP reduces that to -1.5% (through hedge allocation and auto-rebalancing)
In our project, when a user deposits USDC into our ERC4626 vault, funds are automatically split, for example 80% enters a Uniswap v4 liquidity pool to earn trading fees, and 20% opens a 1x ETH short on GMX v2 as a hedge.
The key innovation is our HedgeLPHook.sol, a Uniswap v4 afterSwap hook that monitors sqrtPriceX96 after every swap in the pool. When price deviates more than 5%, the hook atomically calls vault.hookRebalance() to resize the GMX hedge position, maintaining delta neutrality without any off-chain keepers or manual intervention.
The platform includes a full-featured frontend with live Uniswap V4 swaps via the Universal Router and Permit2 authorization chain, real-time token prices and charts from CoinGecko, pool analytics from DeFiLlama, an interactive ROI calculator with accurate IL math (2√r/(1+r) - 1) comparing HedgeLP vs Pure LP vs HODL strategies, and a Telegram bot (@hedgeLP_army_bbot) for on-the-go market monitoring and vault management.
The Telegram bot is configured with the latest OpenClaw and gives alerts to the user when prices reaches a predetermined range by the user and also gives daily digest of top vaults, top pools and top tokens for the day
HedgeLP is built across three layers: smart contracts with UniSwap v4, a Next.js frontend, and a standalone Telegram bot configured with OpenClaw
Smart Contracts (Foundry, Solidity 0.8.26): The core is three contracts. HedgeLPVault.sol is an ERC4626 vault that accepts USDC deposits, mints vHLP shares, and enforces an 80/20 split between LP and hedge allocations. HedgeLPHook.sol extends Uniswap v4's BaseHook with afterSwap permission, it reads sqrtPriceX96 from every swap, computes price deviation against a stored reference, and calls vault.hookRebalance() when deviation exceeds 500 bps. The hook is deployed via CREATE2 salt mining in Deploy.s.sol, which brute-forces a salt until the resulting contract address has the correct AFTER_SWAP_FLAG bits set in its leading bytes , this is a v4 architecture requirement where the hook's address itself encodes its permissions. GMXHedgeAdapter.sol implements the hedge side, interfacing with GMX v2's ExchangeRouter for 1x short positions. All contracts use OpenZeppelin's battle-tested ERC4626, Ownable, and SafeERC20 alongside the official v4-core and v4-periphery libraries as Foundry git submodules
Frontend (Next.js 16, React 19, Wagmi v3, Viem): The swap page executes real Uniswap V4 swaps through a three-step Permit2 authorization flow: ERC20 → Permit2 approval, Permit2 → Universal Router approval, then encoding a V4_SWAP command with ExactInputSingle parameters including the PoolKey (currency0, currency1, fee, tickSpacing, hooks address) and calling UniversalRouter.execute(). Pool deposits use the same router with batched SWAP_EXACT_IN_SINGLE actions via multicall. Swap quotes come from the on-chain V4Quoter's quoteExactInputSingle(). All of this encoding logic lives in uniswap.ts library that handles ABI encoding, PoolKey construction, and command byte packing. The frontend fetches live market data through Next.js API routes that proxy CoinGecko and DeFiLlama to avoid CORS, with staggered caching (15s for exchange rates, 30s for prices, 5min for global stats). The ROI calculator implements the exact impermanent loss formula (2√r/(1+r) - 1) with Recharts visualizations comparing three strategies across configurable price scenarios.
Telegram Bot configured with OpenClaw (standalone long-polling): Built with node-telegram-bot-api, the bot runs as an independent process with sliding-window rate limiting, per-user session management with 10-minute TTL, a 60+ token symbol-to-CoinGecko-ID mapping, structured JSON logging, and graceful SIGINT/SIGTERM shutdown. It reads vault state directly from on-chain contract calls. Configured with OpenClaw.
The CREATE2 salt mining for hook deployment was the trickiest part, Uniswap v4 determines hook permissions from the hook contract's address bits, so we had to mine an address where specific bit positions match AFTER_SWAP_FLAG. The deploy script iterates through salts until it finds one that produces an address with the correct flag encoding.
We also ran Lighthouse scores and these are the cool results: 100 Performance, 95 Accessibility, 100 Best Practices, 100 SEO with 0.2s FCP and 0ms TBT
We did well i guess, from idea validation and project MVP on testnet in these few days, super busy but we did pull through together as a team, LFG! Hope we enter hehe
We also did this because there's some protocols doing almost the same things as us in Solana like Kamino, but in Ethereum there's no many, so why not bring it to the ETH ecosystem!

