We are working on upgrading our DEX to support 3 invariants and hooks.
Hooks as defined on UniswapV4 are lifecycle function calls. For example, a pool with a pre-swap and post-swap hook will call the hook contract before and after every swap.
This allows developers to extend the functionalities of DEX pools at deployment. Swap hooks can enable KYC/whitelisted pools, dynamic fees, limited orders, lending protocol integrations, and so on.
Our current approach uses Hot Potatoes and Witnesses:
A pool with a pre-hook requires a HotPotatoe argument to guarantee that the hook contract was called beforehand.
A pool with a post-hook creates a Hot potato that can only be destroyed with the hook contract witness.
We need help with the following:
Resources:
https://github.com/Uniswap/v4-core/blob/main/whitepaper-v4-draft.pdf