Have you ever wondered how the price of an asset is determined? In economics, there is a simple answer to this: The price is discovered by the interaction of buyers and sellers in a market, e.g. a process driven by supply and demand.
This process is facilitated by various market mechanisms and participants. This also applies to digital marketplaces like cryptocurrency exchanges or NFT trading platforms, where the interplay of buyers and sellers determines the prices of cryptocurrencies or other Web3 assets.
In Web3, Order Books and Automated Market Makers (AMMs) are two foundational mechanisms for trading assets on exchanges or trading platforms. Centralized Exchanges (CEX, e.g., Binance, Coinbase) primarily use order books because they control the backend infrastructure, can efficiently match orders off-chain and facilitate high-frequency trading with low latency.
In contrast, Decentralized Exchanges (DEXs like Balancer, Uniswap) mainly use AMMs because smart contracts can automate trading without intermediaries or a centralized party. There is also no need for order matching or complex infrastructure, which is more suited to fully on-chain execution.
An order book is a data structure that stores buy and sell orders from users, organized by price and quantity and displayed in a table-like format. The book is typically divided into a bid side (buy orders) and an ask side (sell orders), and the current market price is determined by the highest bid and lowest ask. The price discovery process is dynamic and reflects supply and demand directly from users.
On the other hand, an AMM is a decentralized exchange mechanism that allows users to trade two specific tokens, usually a base token and a quote token. The AMM creates a liquidity pool, which is a smart contract that stores both tokens and calculates the price based on the ratio of tokens in the pool. Prices are set by a deterministic pricing algorithm, typically the constant product formula: x * y = k.
To explain these different price discovery mechanisms, let's think about our art gallery metaphor again. Imagine an art gallery hosting a live auction. The gallery has a book that contains a list of art-loving customers (buyers) and artists (sellers), each with their desired price for a particular artwork. Since this is an art auction, the auctioneer of the gallery facilitates the process of price discovery. He starts the bidding process, calling out the highest bid and incrementally increasing the price until a seller is willing to accept the bid. This is akin to matching buy and sell orders in an order book.
Now, let's imagine an art gallery that operates as a self-service art shop run by a smart robot. Instead of an auction, it uses a sophisticated algorithm to set prices for the artworks. This kind of gallery has a pool of artworks (liquidity pool) with a fixed ratio of different types of art (classical and modern art paintings). When a buyer wants to purchase a classical painting, the algorithm adjusts the price based on the current ratio of classical paintings to modern ones in the pool. If there are more classical paintings than modern paintings, the price of classical paintings will be lower, which will encourage more sales and maintain the ratio. This dynamic pricing ensures that the gallery always has a balanced pool of artworks, just like an AMM adjusts prices to maintain liquidity.
In comparison, the primary purpose of an order book is to match buy and sell orders to execute trades. In contrast, the main purpose of an AMM is to provide liquidity to the market by automatically adjusting the price of the base and quote tokens. The price discovery is driven by market participants or a mathematical formula. And the liquidity of the market is either provided by the orders placed (order book), or the volume of the liquidity pool (AMM).
In sum, both order book and AMM mechanisms are primarily used to find the asset price, also known as the market price or spot price. However, they achieve this in different ways and serve different purposes. An order book is a traditional mechanism used in TradFi and centralized exchanges. At the same time, an AMM is a decentralized exchange mechanism that uses a more complex algorithm to calculate the market price and provide liquidity.
This article was authored by Lutra, a DAO member of The ALANA Project.
Find The ALANA Project on:
Over 100 subscribers
The article challenges readers to think critically.