Order book VS Automated Market-Makers

传统订单簿 VS 自动做市商

Eurus Network
5 min readAug 26, 2021

--

Decentralized exchanges (DEXs) are getting more popular as they provide the solutions to the centralized exchanges (CEXs) involving hacking, lack of privacy, deposit restrictions, middlemen issues and high cost. DEX eliminates middlemen and allows users to trade directly from their wallets in a non-custodial manner.

去中心化交易平台 (DEX) 发展蓬勃,为长期困扰中心化交易平台 (CEX) 的问题提供了解决方案,當中包括黑客攻击、缺乏隐私、存款限制、中间商问题和高额费用等。DEX 消除了中间商,并允许用户以非托管方式直接从他们的钱包进行交易。

Soure: https://defiprime.com/dex-volume

In July 2021, the trading volumes on DEXs hit a record high of $60 billion. And it is not difficult to discover that half of the trading volume was contributed by DEXs like Uniswap, Sushiswap and Curve, which are using Automated Market Maker (AMM) instead of order books. As the DEX market matured, more DEXs moved away from traditional order books to Automated Market Maker due to liquidity issues. Let’s take a look at how AMM surpasses order book.

2021 年7月,DEX 的交易量达到了 600 亿美元的历史新高。这不难发现其一半的交易量是由采用自动做市商 (Automated Market Maker, AMM)的交易所如Uniswap、Sushiswap 及Curve。随DEX 市场成熟,流动性的问题令越来越多DEX 从传统订单簿转向自动做市商,现在就来看看AMM 是如何超越订单簿。

How traditional order books work? 传统订单簿如何运作?

An order book compiles a list of all open orders that at present are available on an exchange for a specific trading pair. Buyers are the ones who “bid” for a certain number of assets at a specified price, and sellers “ask” for a specific price for their assets. The depth of an order book is determined by the price spread between the buy/sell orders. This further determines the price of a particular asset on a particular exchange.

订单簿是按照价格水平组织排列,展示特定资产买卖订单的电子列表。订单簿实时显示特定资产的未结订单列表,买方以特定价格“bid” 一定数量资产的人,而卖方是为其资产“ask”特定价格的人。订单簿的深度由买/卖订单之间的价差决定。这进一步决定了特定交易所中特定资产的价格。

Source: https://www.reddit.com/r/CryptoCurrency/comments/85akqm/guys_what_does_this_bitcoin_order_book_at/

When the traders put their orders, the order book organizes them according to the price associated. As a result, as long as there is a supply and demand, any DEX trader can trade the asset. However, placing an order does not guarantee someone else will agree to take the offer. If anyone on the exchange places a better offer than others, then the better offer will be taken first.

当交易者下订单时,订单簿根据相关价格组织订单,故只要有供求关系,任何 DEX 交易者都可以交易资产。不过,下订单并不保证必定有人会接受报价,如有人提供比其他人更好的报价,他的报价将首先被接受。

Disadvantages of order books 订单簿的缺点

❌ The blockchain could be clogged with loads of data of transactions. Due to the higher transaction load, the order matching waiting also increases 区块链可能会被大量交易数据堵塞,高交易负载使订单匹配等待增加

❌ Trade collisions in order book are a major cause of higher transaction fees 订单簿的交易冲突导致交易费用较高

❌ Market manipulation problem. Based on the ask and bids placed in the order books, the speculators could manipulate the market by shifting the market sentiments 市场操纵问题,根据订单簿中的卖价和买价,投机者可以通过改变市场情绪来操纵市场

Besides, the order book is also prone to issues like wash trading, and that is why the developers started looking for other options, like Automated Market Maker.

除此之外,订单簿容易出现等洗盘交易问题,故开发人员开始寻找其他选择,如自动做市商。

What is an Automated Market Maker? 自动做市商是什么?

An Automated Market Makers use smart contracts to form liquidity pools that automatically execute trades, where the prices are determined by a constant mathematical formula. AMMs are a financial tool unique to Ethereum and DeFi. They are always available for trading, and do not rely on the traditional interaction between buyers and sellers. Liquidity providers (LPs) are the ones who add funds to liquidity pools. In return for providing liquidity to the protocol, LPs earn fees from the trades that happen in their pool.

自动做市商是利用智能合约形成流动性池,并自动执行交易,其价格由特定的数学算式来决定。AMM 是以太坊和DeFi 独有的金融工具,常适用于交易,豪不依赖于买卖双方之间的传统互动。而流动性提供者 (LP) 则是向流动性池投放资金的人,他们可从交易当中赚取手续费以作提供流动性的回报。

Constant Product Formula 恒定乘积公式

AMMs have become a primary way to trade assets in DeFi ecosystem. The ingredient of AMMs is just a simple mathematical formula. To explain easily, just take the formula of Uniswap as example:

x * y = K

AMM 已成为 DeFi 生态系统中交易资产的主要方式,其概念只是简单的数学公式,为了方便解释,就以 Uniswap 的公式为例:

x * y = K

x is the amount of one token in the liquidity pool, and y is the amount of the other. K is a constant representing a constant balance of assets that determines the price of tokens in a liquidity pool. From this formula, we could see

price of token x = quantity of token y / quantity of token x

x 是流动性池中一种代币的数量,y 是另一种代币的数量。K 是一个常数,代表资产的恒定余额,决定了流动性池中代币的价格。从这个公式我们可以看出

代币 x 的价格 = 代币 y 的存量 / 代币 x 的存量

Source: Curve Whitepaper

Different AMM formulas result in different pricing curves. From the above chart, when liquidity pool has 15 Y-tokens, it will only pay 0.1 X-tokens for the marginal Y-token. But when it has only 2.5 Y-token, it will pay 4.0 X-tokens. Other pricing curves are designed to concentrate more liquidity around a certain price.

不同的AMM 公式会导致不同的价格曲线。假设流动性池有15 颗Y 代币,用户仅需以0.1 代币 X 来获得一颗代币Y ;而若当池中只有2.5 颗Y 代币时,用户则必须以4 颗X 代币才能换到一颗Y 代币。其它不同的价格曲线,目的在于将流动性主要集中在某个价位附近。

For example, there are 2,700 WBTC and 86,000 ETH in ETH/WBTC pool. This reserve ratio implies that ETH’s market price at that time is 2,700 / 86,000 = 0.0314 WBTC.

Importantly, the AMM does not change this price as other markets move around it. The market price only is updated as the reserve ratio of the tokens in the pool changes, which happens when someone trades against it.

假设 ETH/WBTC 池中有2,700 WBTC 及86,000 ETH,那ETH的价格就是2,700 / 86,000 = 0.0314 WBTC。

重点是,在其它交易平台价格有所波动时,AMM 不会自行更新价格,其价格只会依照池中的代币存量比例的变化而波动,意味着有人进行交易才会改变它的价格。

So what happens if the price on an exchange platform falls to 0.0310 WBTC? That implies LPs are currently buying ETH at a premium, creating an arbitrage opportunity. Therefore, arbitrageurs buy the “cheap” ETH on the CEX and sell it in the pool for an immediate profit. They keep doing this until the next unit of ETH in the pool only pays 0.0310 WBTC — same as on that platform — and they can no longer profit by selling more.

若该交易对在某交易所的价格跌至0.0310 WBTC,会发生什么事?这代表流动性提供者正以高出市场价格收购以太币,进而产生套利机会。套利者能在某交易所买入「便宜」的以太币,并於流动池卖出而获利。套利者会持续进行,直到该交易对的价格跌至与交易所相同的 0.0310 WBTC,此时他们才无法再进行套利。

Advantages of AMM 自动做市商的优点

✔ Can still trade in an insufficiently liquid market 在流动性不足的市场依旧能够进行交易

✔ When an AMM offers promising incentives, the liquidity providers rush to it. Thus, it really solves the fragmented liquidity issue 当AMM 提供奖励时,流动性提供者会提供流动性。因此,它能解决DEX 分散的流动性问题

Disadvantages of AMM 自动做市商的优点

❌ The less traded assets suffer high slippage, especially when a large order is executed 交易较少的资产会出现高滑点,尤其是在执行大订单时

❌ Impermanent losses risk associated with the liquidity providers 流动性提供者的风险如无常损失

Then, which one is better? Automated Market Maker based decentralized exchanges solve one of the biggest issues of the DEX space. Meanwhile, the order book-based DEXs are working hard to improve the liquidity.

If you are looking for DEX service, get in touch with Eurus. Whether you need a centralized exchange or a decentralized exchange, we successfully cater to your needs with our mission-driven solutions.

这两种交易方式都具备各自的特点,那么,两者哪个比较好呢?自动化做市商解决了DEX 领域的最大问题之一;同时,订单簿正在努力提高流动性。

如果您正在寻找 DEX 服务,请关注 Eurus,无论您需要中心化还是去中心化交易,我们会根据您的需求以提供解决方案。

Stay ahead for our latest updates. Follow Eurus on:

继续关注我们的最新更新。

Official Website ; Twitter ; Reddit ; Telegram ; Linkedin

--

--

Eurus Network

Eurus Economic interoperability blockchain network to transfer digital assets / cryptocurrency across completed different consensus mechanism network.