Onomy Protocol
Published in

Onomy Protocol

Order Book Trading — How It Works

Order books are central to currencies and the financial market. It’s the model the New York Stock Exchange and other financial institutions around the world use to tally and transact the furious buys and sells of the traders. In the classic image of traders waving chits in the air for longs, shorts, calls and puts, they are demanding spaces on the order book. Of course, technology has moved on, and now trades are carried out electronically.

These electronic (or analogue) ledgers compile all the buy orders (bid) and all the sell orders (ask) and fill orders as appropriate as the price of an asset moves. The asset price is found by searching for the price convergence between the lowest bid and highest ask. An order book has a ‘matching engine’, which is merely a fancy term for connecting appropriate buys with appropriate sells and getting everyone what they want.

How Order Books Work and Their Advantages

Order books have familiar order types that traders and investors have come to know and love. It is how traditional finance moves trillions of dollars of value on any given day. The most common order types are a market order, limit order, and stop order. A market order is an order to buy or sell an asset at the market’s current best available price. They ensure execution immediately after submission, but do not guarantee a specified price.

Another key advantage, provided by limit orders, is the ability for traders to input specific prices they are willing to pay for an asset and, should the asset ever move to that price, the order is filled. In a similar fashion, downside risk can be mitigated by placing stop loss orders, which allow a trader to input a price to sell their position automatically, preventing further downside, if the specified stop loss price is met.

Order books then have a clear advantage that they can achieve price convergence effectively and execute trades cleanly once bids and asks are met. This determines the current market price, which changes to reflect whenever a new bid-ask is completed with the matching engine.

How to Run an Order Book

Running an order book isn’t just a matter of connecting buyers and sellers. In order to provide for the smooth function of the order book and to ensure that orders can be comfortably and continually met, the pairs listed on the book need to have deep liquidity behind them. Order books are ideal for liquid markets, where this type of paired liquidity is available, but are poor for illiquid markets — with this being the reason why you can’t just get anything you want off an order book exchange and why more marginalised tokens are found on AMMs.

This is why, on any given exchange, you can’t have every coin paired — or even most coins paired. Instead, you frequently only get high volume cryptos that are relatively well-known as these assets have deep enough pools to sustain constant high volume trading — including gigantic bids or asks, without disrupting the price flow of the market.

Order Books vs AMMs — What’s Better?

Automated Market Makers are systems that allow for automated cryptocurrency trading, via the permissionless and non-custodial capabilities of smart contracts. Unlike order book exchanges, where users must wait to have their limit orders fulfilled, AMMs process all transactions automatically, without relying on third party buy/sell requests for the token being traded.

The key difference to the average user is that with order books, traditional market makers facilitating trades capture the spread between bids and asks to make earnings and keep the market efficient. AMMs, on the other hand, do this automatically and earnings are shared with liquidity providers (LPs).

On AMMs — where liquidity pools are funded by the users — intense slippage can occur on very large orders, particularly on more esoteric coins. Slippage occurs when an order is so large it drains much of the liquidity in the pool and thus ramps the price of the asset as the sale is enacted, as the pool seeks to retain its constant product formula. While little slippage on common trading pairs is a fact of trading, larger impacts are detrimental to keeping the market efficient. This bottleneck is fortunately achievable by enacting a hybrid AMM / order book model under Onomy’s model, as highlighted later.

The benefits of AMMs are clear though. There is no central market maker creating (and thus controlling) the market. Rather than aggregating buy and sell prices to achieve convergence, and attempt to match buyers to sellers, the AMM can always provide both a fair price and availability of the token to buy. More details on the way AMMs work and the general advantages/disadvantages between the two frameworks are available in this Medium article.

The Current State of Order Books on the Crypto Markets

In cryptocurrency, order books are the model used on all the large centralized exchanges that currently — for better or for worse — act as the main trading desks for the world crypto markets. Highly liquid pairings are funded by the central exchange, and due to their centralized nature, they remain the fastest way to do business. Like all authority-centric centralized services, they have innate risks built in. There is a pragmatic, yet difficult to prove theory, stating that as centralized exchanges can see users’ stop limits and liquidation figures, they are in fact able to leverage huge liquidity in order to cause long/short shakeouts, effectively liquidating those in high risk positions. In theory, CEXs with centralized order books can spot market patterns or significant strong or weak trading positions, and trade against their users to prevent orders from being filled.

What About Decentralized Order Book Exchanges?

The “not your coins, not your crypto’ saying has already been ingrained in the minds of most crypto enthusiasts out there. Order book DEXs make it possible for users to conduct limit & stop orders whilst not having to worry about centralized capital management.

However, most of the DEX order books out there are in fact pseudo-decentralized, as the order book itself remains centrally hosted, exposing sensitive trade information only to the exchange. This exposes users to the same theoretical risk present in the case of any CEX, so to some, it is not the appropriate solution.

These DEXs are still attempting to accumulate the liquidity required to run a successful order book, as despite their non-custodial nature, the user experience remains stilted. Time delay between bids and asks, insufficient support for small cap coins users want to trade, and complicated interfaces, are only few of the factors which hamper mass adoption.

Finally, DEXs running on a specific blockchain like Ethereum or Binance Smart Chain are restricted to their own native pool of assets — making far-reaching, sophisticated trading difficult to execute. They’re also expensive, a fact which further pushes users toward centralized exchanges.

Hybrid DEX — The Future of Crypto Trading

The solution then, is complex, and a new conception of the perfect trading hub is required. The Onomy Exchange (ONEX) is the first DEX to converge AMM liquidity pools with order book trading, thus creating the ideal scenario: a non-custodial decentralized exchange that runs a fair, viewable and unimpeachable order book as well as an AMM side by sides, allowing on-chain multi-asset trading and swaps across multiple blockchains, thus giving traders both the choice and the freedom to enact their desired strategies, whilst accessing any trading pair as long as sufficient liquidity is provided. The decentralized order book will be fast to keep up with the pace of market movements, and fair, with everyone being able to access trading data.

The Onomy Exchange (ONEX) does this, and aims to become the de-facto gateway to enter and exit any asset ecosystem, whilst pooling usability, liquidity, security, and functionality within a simple, yet beautiful interface suitable to both beginners and crypto-natives. Thanks to its hybrid architecture, the best of both AMMs and order books is integrated, thus creating a powerful, fair, and non-custodial approach to decentralized trading that supports stop losses, limit orders, and advanced charting.

From a technical standpoint, whenever there is a token swap request, the ONEX will first process limit and stop orders placed into the order books. Each limit or stop order execution is processed by the AMM liquidity pool, consequently moving the price while filling the order. The AMM will only fill trades that are introduced within the spread of the order books while charging the ends of the spread to gain a profit for LPs. After the swap is completed and finality is reached, the AMM exchange rate will be settled at the designated price.

Importantly, however, the Onomy Exchange does not renounce the importance of asset interoperability. Onomy has its own layer-1 Cosmos-based chain, and is actively building bridges to prominent blockchain economies, making it possible for users to seamlessly trade assets across different token standards, without needing to hold multiple wallets (or browser extensions). A swap from AVAX to NEAR, for example, is conducted between the two networks at the click of a button via the ONEX, at significantly enhanced efficiency thanks to the Onomy Network.

In the future, the ONEX will expand beyond cryptocurrencies as we know them, and welcome Forex pairs. Onomy’s approach to infrastructural support means that the ONEX, once paired with Onomy’s custom consensus protocol, will allow for on-chain Forex trading, hence plugging a $6.6T per day market into the burgeoning world of decentralized finance.



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