Published in

Order Book vs. Automatic Market Maker (AMM)

Order Book vs. Automatic Market Maker (AMM)

Crypto is a bit strange for those coming from trading stocks, but it’s still similar enough on the centralized exchanges like Coinbase Pro, Binance, and Kraken. You select a pair of cryptocurrencies, look at all the “buy” orders and all the “sell” ones and either buy/sell at the market price or place a limit order for the price you are willing to pay. Simple. Except, how do you know if the price will go up or down, closer to your desired entry price or farther away from it?

That’s where the order book comes in. In the order book, you can see the volume of orders at each price point both for sellers and buyers. Experienced traders can infer possible price movements from the shape of the order book. That is a topic for a whole other article (or book), but here is a basic example: If I see 1 BTC selling for 20 ETH and there is a little volume of sellers willing to sell 1 BTC for 20.1, 20.2, 20.3, and 20.4 ETH but a lot of volume at 20.5 ETH, a trader can infer that with enough buying pressure, the buyers will quickly go throw that little volume up to 20.5 ETH, where there is so much volume that it creates more supply than demand — aka, a wall. So a trader could place an order just under this wall, at 20.47 ETH, for example, and still have a reasonable expectation that it will get filled. Without the order book, the trader would just be guessing.

Decentralized exchanges figured out how to get into the order book game too using protocols like 0x to pull together order books from various DEXs. The problem with that approach is that it often results in high spread and low liquidity (the two nightmares of any trader). So Uniswap, the most popular exchange for ERC-20 tokens (aka, the go-to DeFi exchange) tries to solve these two problems by getting rid of order books in favor of something called an Automated Market Maker (AMM).

Uniswap creates a pool for each pair of ETH, USDt, USDc and one other token, let’s use DEXE as an example. If someone sells 100 DEXE into the pool, the pool now has 100 more DEXE and proportionately fewer ETH. If someone buys 100 DEXE, it reverses. The AMM adjusts the price based on order volume and other factors — no human order books required. The upside is more liquidity and lower slippage (similar to spread) for smaller orders. The downside is more slippage for larger ones. Plus, each pool needs to have enough liquidity to support a decent volume of trades. And Uniswap is not an ETH bank with infinite ETH to mint — it can’t just provide an opportunity for giving liquidity for every pool.

So it must incentivize others to provide liquidity. Uniswap does that by sharing part of its trading fees with liquidity providers (LPs). After all, money is a very effective incentive. And the more trades happen on Uniswap, the more it makes in trading fees (and so do the LPs). This gave people an idea: What if we copy Uniswap’s code (isn’t open-source code nice?) and give LPs a little bit better cut of the trading fees to lure them away from Uniswap (drop us a line if you’d like us to write an article on “Vampire Attacks” — it’s a fun one). And then another competitor gives even more. And so on.

Collecting these fees is what’s commonly called farming. Liquidity is so important that projects are willing to pay very large yields for the pools where liquidity is low or there is a high chance that half of the pair will crash in price. Which is why you can find yield rates above 1000% for some pairs. This sounds insane, of course. It works as a gamble that the LP will get enough return on the initial investment quickly enough before the price of one of the tokens in the pair collapses. Take a look at this list of farms on Coingecko (make sure to sort by the highest Returns). At the moment of writing this, at the top we have the following:

Note how many of them have a well-known coin like WETH or USDC paired with a relative unknown like STBZ and DOUGH (yes, that’s the coin of PieDAO — let us know if you want an article on food-themes exchanges).

So providing liquidity on Uniswap or other DEXes can be very lucrative (albeit risky). But, for traders, it’s missing some of the key elements of order book-driven trading. One of the most crucial ones is the ability to place limit orders, which we discussed at the beginning of the article. With tokens traded on Uniswap, it’s all too common to wake up early only to see that the token you wanted to buy dropped below your target price right in the middle of you sleeping and is now back up and then some, far too expensive. With a limit order, you would just place the order and go to sleep. There are several innovative solutions being developed to bring limit orders to the likes of Uniswap, including one by DeXe (more on that later). We also see the solution options on ways for everyone to do market making on swaps and even solve arbitrage problems on DEX. We are dedicated to developing all these tools because the lack of them is a major hurdle to mainstream adoption of DeFi and DeXe Protocol will complete it. But for now, if you want to exchange one token for another on Uniswap, you have to take the price offered right now (and pray that it gets executed without Metamask errors before the price changes).

What else would you like to know about DeFi trading or trading in general? Let us know and you may just see a writeup about it soon.


Official telegram channel:

Official telegram EN chat:







Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Dexe Network is an ecosystem of tools that bring professional trading to DeFi