AMM and order book share liquidity with each other

The market price is based on the price of the liquidity pool. The liquidity pool and the order book share liquidity with each other. During the swap, the limit order in the order book can be triggered. During the trade, transaction may also trigger token swaps in liquidity pools to update prices.