Comment on page
Order Matching - Frequent Batch Auction
By implementing the FBA model, MES will become a more competent orderbook DEX that also provides CEX-like experience by having deeper liquidity, better capital efficiency, tighter spreads and less attacks.
But most importantly, it achieves a fairer settlement price for traders.
What is FBA?
Frequent Batch Auction (FBA) Model is a model used in the mechanism of matching limit orders.
Like other orderbook DEXs, all the limit orders placed on MES will go into the mem pool which is where the order matching happens. Generally, orderbook DEXs and CEXs adopt a matching mechanism named Continuous Limit Order Book (CLOB); FBA adopted by MES is another way to match the orders.
In the CLOB model, buy and sell orders match with one another randomly and continuously when they were added to the mem pool. Let’s take a timeframe of 0.05s as an example. As illustrated below, every 0.01s there is a buy order matching with a sell order and they will vanish after matching.
Before implementing FBA
Now let’s see what it is like after implementing the FBA model.
The mechanism is no longer a continuous action, but instead a batched action per interval.
Taking the same timeframe of 0.05s and make that also the time interval of the batch. During this time interval, no matching is done in 0.01–0.04s, the orders just keep accumulating until 0.05s and will settle by then as it is the end of the interval.
During the interval, the Uniform Settlement Price (USP) is decided and is used to settle all the orders in the batch. USP is where the quantity of crossing orders is the highest.
After implementing FBA
In short, FBA takes away the time sensitiveness of order matching by putting orders into batches and batch-settling them with USP.
Apart from increased fairness, FBA also has another major benefit — reducing front-running.
Front running is a phenomenon caused by High Frequency Trading (HFT) bots. It happens when these HFT bots make profit from stale orders created by MM bots.
For instance when the market price is $1000/ETH, MM bot will send both buy and sell orders at $1000/ETH to help with order matching in mempool.
However since the market is not static and market price can go up and down, when the market price increases to $1005/ETH, what HFT bots will do is take the $1000/ETH sell orders from MM bots and then sell at $1005/ETH to make profit out of the price difference. HFT does that with its high speed ability taking advantage of the delay of MM bots.
After implementing FBA, all orders are batched up and will not be revealed until the end of the time interval, therefore HFT bots will not be able to abuse the stale orders to generate profit. This reduces front-running and again brings more fairness to users.
Budish, Eric, Peter Cramton, and John Shim. 2014. “Implementation Details for Frequent Batch Auctions: Slowing Down Markets to the Blink of an Eye.”