I haven’t seen much in-depth discussion on this topic, so I figured it would be interesting to hear some opposing perspectives.
AMMs are my favorite innovation of defi. It allows users to benefit from volatility harvesting without requiring large amounts of capital, trade bots, or complex options spreads.
Order books have the advantage of limit and stop orders, but these aren’t necessarily orderbook exclusive features. I personally don’t use these much even when they’re available, since I generally don’t participate in active trading. It’s a negative-sum game, and judging by my past performance, I don’t seem to possess any discernable edge in the market.
Am I wrong in this assessment? Is there any benefit for users who simply wish to earn passive yield from wiggly lines?
>Order books have the advantage of limit and stop orders, but these aren’t necessarily orderbook exclusive features
The practical problem with implementing on-chain order books and limit orders in EVM is that settling the orders requires you to loop through available limit orders (“matching”) at the top of the book. [EVM is notoriously bad at doing for loops because of loop length manipulation attack](https://ethereum.stackexchange.com/questions/8551/ethereum-smart-contract-security-checklist/8593#8593).
Note that this practical problem is less of a problem for next-gen blockchains with a more solid foundation virtual machine foundation:
* Many app chains doing order books like [Vega](https://vega.xyz/)
* Tonic – order book DEX on NEAR
* Serum – order book DEX on Solana
There is also EVM based “poor man’s order book” on [Clober](https://github.com/clober-dex/core/blob/main/contracts/OrderBook.sol) based on [this research](https://ethresear.ch/t/enabling-on-chain-order-matching-for-order-book-dexs/14051). Clober does not implement all of the features you would expect from a real order book – so depending on your definition, it may or may not be “order book based”.
Then:
>AMMs are my favorite innovation of defi.
The question is – do we need to have order books in the first place? The answer is “it depends.” If you ask any current market maker (Jump, Wintermute, etc.) the answer is “yes” because their business depends on high-frequency trading. More HFT, more professional market makers make money, less money left for someone else. But do we need order books for liquidity formation and price discovery? The answer is likely no, as Uniswap v2/v3 and PancakeSwap have [more volume than Coinbase on a good month](https://tradingstrategy.ai/blog/defi-volume-all-time-high-reached-this-weekend) and [better prices for retail trades](https://tradingstrategy.ai/blog/most-efficient-market-is-on-a-public-blockchain-and-decentralised).
Can you do limit do limit orders natively on AMM? Not really, because it all comes does to the fact what kind of for loops and gas constraints your blockchain VM has, regardless of underlying liquidity is a bonding curve or an order book.
An oldie but a goodie
https://thecontrol.co/a-comparison-of-decentralized-exchange-designs-1deef249f56a