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: An adaptive implementation of Uniswap V4 Liquidity Pools via hooks
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.
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:
Additionally, this incentivize huge liquidity, this liquidity provided creates consistent trades where price impact is minimum, therefore, making healthier the user trades.
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: