project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Orderbook Hook

A uniswap v4 hook to interoperate both automated market maker and orderbook exchange

Orderbook Hook

Created At

ETHOnline 2023

Project Description

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.

How it's Made

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.

background image mobile

Join the mailing list

Get the latest news and updates