project screenshot 1
project screenshot 2
project screenshot 3

UniV4 CCLP Hook

UniV4 Crosschain Liquidity Hook evens out fragmented liquidity across chains to meet trader's needs

UniV4 CCLP Hook

Created At

ETHGlobal New York

Winner of

🥈 Axelar — Best Use

🌐 NeonEVM — Most Transactions

🪝 Uniswap Foundation — Best use of Hooks

Project Description

The multichain future is causing disproportionate liquidity fragmentation. Some chains have too much liquidity sitting idly, and others don't have enough. This has negative effects on the small chains, as traders experience high slippage, but users on larger chains also face lower yield.

One example of fragmented liquidity is FRAX. On Ethereum, there is over $350m in liquidity, mainly in the FRAX/USDC pool on Curve. This deep liquidity provides multiple benefits to users and protocols on Ethereum. A $500k swap between FRAX and USDC on Ethereum would lead to ~0.22% slippage. Conversely, on Arbitrum, there is only about $5m in liquidity, leading to a 14% slippage when attempting a $1m swap from FRAX to USDC.

Enter the UniV4 Crosschain Liquidity Hook. This is hook that automatically bridges out a portion of a user's LP from a chain that they're LPing to, to another chain with low liquidity on that pair. By evening out the liquidity on chains, LPers not only get increased yield, but activity can now finally flourish on that smaller chain due to an increase in liquidity.

Slide Deck: https://docs.google.com/presentation/d/1C1lLhoYYmpsEEC-JGbzujo_J7OndEnWInum2RjecHco/edit?usp=sharing

How it's Made

This project uses UniV4's beforeModifyPosition to bridge off a pool-specific percent of the LP the user is about to provide - to another chain via the AxelarGateway, and provide LP on a pool over there.

We spun up two local chains, that have support for EIP-1153 in order to deploy UniV4's core contract. We then developed a hook which also implements the ILockCallback interface as we modified the modifyPosition function to add bridging support. We included callback functions of AxelarExecutor that allows AxelarGateway contract to call it with custom data. This callback helps to add liquidity on the foreign chain with the configured parameters on the source chain, like the liquidity range and liquidity amount. Upon receiving the tokens, the contract callback calls the Uniswap PoolManager on the foreign chain to provide liquidity, and later transfer the LP position to the user wallet on that chain. We self hosted a relayer to monitor the bridging events. The relayer queries the event every 5 seconds and sends the crosschain transaction when it receives. The relayer code is modified from axelar example repo with custom parameters and bug fixes so that it runs on a hosted cloud server.

background image mobile

Join the mailing list

Get the latest news and updates