Decentralized Finance (DeFi) is a multi-billion market for good reason, with over $258 billion in total value locked (TVL) in late December 2021. It has elevated and expanded the reach of trustless finance services greatly. However, without users swapping one token for another, DeFi wouldn’t be a fun place to be. A large chunk of the $258 billion under management in different protocols falls under decentralized exchanges.
To illustrate, one of the world’s largest DEXes, Uniswap, had over $8.66 billion in total value locked in late December 2021. Looking at historical performances, assets under management tend to fluctuate, following the value of the base layer’s coins.
Decentralized exchanges have evolved to put an end to troubles related to centralized exchanges. Think of hacks, forced KYCs, account registration restrictions, custody of private keys, and all things shouting anti-crypto. Still, this is not to say centralized exchanges are bad. If anything, they are critical in onboarding new users to this space.
All efficient traditional exchanges, including all centralized ramps, use the order book model. There are several benefits for this design. For instance, they are scalable, efficient, and flexible. The problem is, all these advantages couldn’t be ported over to exchanges operating in most smart contract blockchains like Ethereum, the Binance Smart Chain (BSC), and others. Initial attempts to adapt a DEX using an order book model like EtherDelta turned out to be a failure. These early DEXes had liquidity challenges and fairly complex user interfaces. The primary reason why this couldn’t be possible was due to technical limitations of the blockchain architecture preventing efficient execution of the order book.
To overcome this channel, the Automated Market Maker (AMM) model for Ethereum was detailed by Vitalik Buterin in a paper, “Improving Front Running Resistance of X *y = K Market Makers.” For what the AMM model brought to the table, most DEXes running on account models, like Ethereum and BSC, use this style of market making for efficient exchange.
However, the introduction of UTXO-based smart contract architectures in Cardano and Ergo, for example, allows the implementation of Order Book models by DEXes. This improvement makes it possible for deployment of sophisticated features found in traditional exchanges like limit orders, stop loss, algorithmic trading strategies and more, possible in DeFi. It is an edge and would give developers of trustless DEXes an advantage that they could leverage to narrow the gap with traditional exchanges.
This article will break down what these trade execution models present to the trader and their respective impacts on user experience.
What is an Order Book Model?
An order book model is the default way of all large centralized exchanges. There is an order book in place to record and match all buy and sell orders. Order matching is done based on a set of given rules dictated by the order matching algorithm. Here, the primary distinguishing factor with other trade execution models, as mentioned earlier, is the mechanism (set of rules) for fair price formation at which a given asset’s price will be executed.
From an aggregated list of buy and sell orders, the buyer and seller can either bid to buy or sell an asset at a specific price. The difference between the highest bid and the lowest ask of an asset is the spread. Typically, exchanges with higher liquidity will have a lower spread and vice versa.
There are different benefits for exchanges using the order book model. For instance, there is flexibility in order types. While traders can submit a limit order, they are free to cancel them at any time or wait for the order to be executed by price movements. Also, there is better, decentralized price discoverability determined by market forces of buyers and sellers, not by a fixed price curve. The aggregation of bids and asks on the order book allows for an arbitrary and dynamic liquidity curve governed by prevailing market sentiment. The result is a more efficient liquidity allocation.
Moreover, in order book exchanges, market makers, placing limit orders on both sides of the trade, buying or selling, are central. These Third parties supply liquidity and facilitate the flow of trades, therefore stabilizing price, and profiting from their action by earning a commission.
What is an Automated Market Maker (AMM) model?
The AMM model was an implemented proposal to resolve the liquidity pain point, which until late 2018 had bogged down DEX adoption in Ethereum. An AMM is like a bot for quoting prices at any price a user might want to swap two tokens for.
The single price of the pool (trading pair) is defined algorithmically using a deterministic algorithm using the pool’s liquidity. In this arrangement, oracles and arbitrageurs play a vital role in price stabilization.
Unlike the order book model which might be decentralized with participation from individuals, AMM DEXes fully rely on the community for liquidity provision through a pool. Even so, AMMs are prone to high slippage, pool losses through impermanent loss, and capital inefficiency in exchanges without concentrated liquidity. Although front running could be a problem in order book models, it is amplified in AMM DEXes. Still, front running is still possible and users should be more careful.
DEXes are Evolving in Sophistication
Regardless, order book and AMM models offer their set of benefits, depending on DEX’s objectives, while also offering a different experience to users. Sometimes limitation is foundational, inherent to the blockchain architecture adopted by the blockchain. For example, AMMs are prone to massive slippages if the pool’s liquidity is thin. Meanwhile, Order Book models allow for a higher level of flexibility and deployment of more functions common in centralized exchanges. However, the development of an order book DEX is complicated and for users, tricky to operate.
Genius Yield is set to launch the first non-custodial concentrated liquidity decentralized exchange based on an order-book model on Cardano in early 2022. Notably, the project maximizes the benefits of Cardano’s best-in-class PoS consensus algorithm and its unique architecture allowing for the deployment of an Order Book DEX.
With this, Genius Yield concurrently unlocks tremendous capital efficiency while allowing limit orders deployment and new concepts like Dynamic Orders and Algorithmic Orders.