project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

AdaptivePools

Hooks incentivizing concentrated liquidity at tick ranges benefitting LPs by increasing fees during volatile periods and minimizing price impact for user swaps via Just In Time liquidity provision from external lending pools

AdaptivePools

Created At

ETHGlobal London

Project Description

Adaptive Pools

AdaptivePools: An adaptive implementation of Uniswap V4 Liquidity Pools via hooks

Why AdaptivePools?

Liquidity Pools and AMM are a fundamental part of DeFi, but over time, their initial implementation starts to change to adapt to market needs.

AdaptivePools helps liquidity providers to improve their rewards and traders to have enough liquidity to perform profitable and huge trades, leading to a win win situation by adapting the pool to the market momentum.

Sounds good, but how?

Uniswap V4 introduces hooks within their Liquidity Pools, therefore allowing us to interact with the contract based on constantly changing situations as liquidy supply, price market volatily and high or low trade demand.

For it, we modify pool fee within a settable range to make 2 things:

  • Under low trade demand, we can reduce the pool fee so best trade routing mechanisms like 1inch or Matcha will find our pool and the LP get more trades
  • Under high trade demand, we can increase the pool fee as trades are gonna happen due to the momentum of the market, therefore, increasing liquidity providers rewards

Additionally, this incentivize huge liquidity, this liquidity provided creates consistent trades where price impact is minimum, therefore, making healthier the user trades.

How it's Made

AdaptivePools uses Uniswap V4 Pools due to the flexibility of these pools. This is done in order to have hooks that allow different adaptive strategies to be used by the liquidity providers within the liquidity pools.

It's important to say that we modified the binaries of solidity compiler to allow the usage of transient storage in solidity pragma version 0.8.22.

Also, due to being using pragma version 0.8.22, we had to modify from all the Uniswap V4 core contracts all the pragma version ^0.8.24 to ^0.8.22.

Regarding the different pieces within the code, we can separate the project into the following main pieces:

  • Uniswap V4
  • AdaptivePoolHook (main piece, inherits BaseHook)
  • ExtendedPoolManager (extends Uniswap V4 PoolManager with some extra functionality)
  • SimpleTSStore (helper contract to interact with Transient Storage)
  • BaseFlashLoan (piece that would allow some flash liquidity scenarios for a better user experience)
background image mobile

Join the mailing list

Get the latest news and updates