A uniswap v4 hook to interoperate both automated market maker and orderbook exchange
AMMs are good for dynamic price actions for digital assets having initial liquidity and instant finality to receive assets on trade. Orderbooks are good for secure trades without slippage and enabling to have more constructive trading strategies on buying or selling assets with mature liquidity. Two were competing against each other until now. Meet this uniswap hook to combine both and utilize them all together.
I used uniswap limit order hook example to start with the codebase. I replaced mock orderbook in the hook with orderbook and matching engine contract I made before. Now the hook can get amount which was swapped from AMM and it can be stored in orderbook. The limit orders are managed with greedy algorithm to match with lower price than the limit price. With Uniswap v4 orderbook hook, users can now safely swap assets with MEV protection via hedging orders in orderbook, or make a whole new strategies as a hook so other traders can both utilize profitting from exposure of price volatility of AMMs and secure trades with orderbook.