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



Problem Statement
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:open a position when ETH goes over $1600.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.
Solution
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 wheneveranyonecalls 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.
Hackathon
ETHGlobal New York
2024
Contributors
- jiyuhan
9 contributions