project screenshot 1
project screenshot 2
project screenshot 3

LiquidityChain

Intent-like decision tree is on Uniswap and it is enabled by the Uniswap V4 hooks!

LiquidityChain

Created At

ETHGlobal New York

Project Description

In IFTTT or Zapier, users can write different integrations between different IoT components or APIs. I added a function on Uniswap that supports conditional liquidity flow that allows users stake in one LP contract, then when certain price trigger is met, the smart contract helps user exit an LP position and enter a new one.

For example, if I want to:

  1. open a position when ETH goes over $1600.
  2. sell the ETH I just bought when it goes over $2000 and deposit the money back into a USDT/USDC pair.

This is useful because now one can specify a condition to exit a position, and immediately deploys the capital into a different LP pair.

How it's Made

I used Foundry to manage the Solidity development, and used ERC-1155 to track ownership. The project can automatically exit user's position from an LP whenever anyone calls the swap function.

The buy and sell direction is determined by remembering the previous ticks inside the smart contract. And the liquidity chain is expressed as the following:

${price}->${poolId a.k.a. LP contract address in V4}:${amount}${price}->${poolId}:${amount}:${price}

Each time it gets passed down to another LP pool, the chain gets shorter. The expectaton is that all the pools in the "chain" will have this hook enabled.

background image mobile

Join the mailing list

Get the latest news and updates