CustomHooks is a customizable hook-based solution for Uniswap v4, enabling trading on custom invariant curves while leveraging Uniswap's efficient pool and routing infrastructure
This project introduces custom invariant curve hooks to enhance Uniswap v4's liquidity pool functionality. By redefining the fundamental curve that governs the pool's behavior, the aim is to provide an advanced, flexible mechanism for token swaps.
Instead of relying solely on Uniswap’s traditional constant-product curve (x⋅y=k), this project offers two custom invariant curves:
Weighted Product Curve Hook (StableHook):
A Balancer-inspired curve that allows for flexible token weights, providing better control over token importance in the pool. Lambert Curve Hook (Lammbert):
A novel curve leveraging the Lambert W function is ideal for scenarios requiring dynamic liquidity concentration or stable pricing mechanisms. These custom curves enable custom trading dynamics while retaining Uniswap's core infrastructure, such as its routing logic and pool management.
This project is built over Uniswap V4, leveraging its hooks architecture to implement custom invariant curves. The project uses solidity and leverages the Hooks template from Uniswap V4. For the Mathematical equations, the project has used Vectorized's Solady library (i.e. FixedPointMathLib). The entire project is built with Foundry and utilizes its various dev tools for various development and testing.