Speed is the Future for DEX Liquidity

Execution speed is critical for liquidity, and can support a wide range of trading pairs

Ainsley Sutherland
DerivaDEX
4 min readOct 13, 2022

--

DerivaDEX is a new type of decentralized exchange, competing directly with centralized exchanges on performance, fairness, and transparency.

Performance: Matching and Execution

When you submit an order on DerivaDEX, the matching engine reviews the orderbook to find resting orders that can fill your order. This process is called “matching,” and can happen very quickly.

A view of the DerivaDEX (testnet) orderbook. Check it out yourself at https://beta.derivadex.io

Execution is the process by which orders that match are then “executed”. A host of updates to the state of the exchange must be processed. Execution on DerivaDEX includes:

  • changing your liquidation price
  • updating your position/collateral balances and those of your counterparty
  • updating any other metrics affected by the state change.
Here are some of the strategy balances that are updated each time state is updated

State updates on spot DEXes are simple: fees are paid, balances are adjusted, and both sides of the trade can see the result updated on-chain.

For derivatives exchanges, like DerivaDEX, a state update is more complex.

That is because users maintain “positions” over time and liquidation risk must be continuously assessed. You “open” a position, i.e., a long position on ETHPERP, and then you can keep that position “open” for as long as you like. For the exchange to function correctly, it must track a host of information about each trader, and each position.

This trader has an open ETHPERP position of size 10.

This is a challenge for on-chain storage, because the amount of information that must be stored in the state, and updated each time the state is changed, is quite large. This is why derivatives DEXes must utilize one of two approaches:

  1. Order books, and a solution for off-chain execution, and on-chain settlement. This either involves a rollup, a custom L2 solution, or potentially an “appchain”. This is the approach taken by DerivaDEX, DyDx, and Vega protocol.
  2. An automated market-maker (AMM), or some variant thereof, and on-chain execution. This is the approach taken by Perp Protocol, GMX, and Futureswap.

DerivaDEX’s unique solution for satisfies rigorous performance requirements, without sacrificing on decentralization.

But why is performance *so* important for traders?

Speed and Liquidity

Due to the design of DerivaDEX, traders enjoy matching and execution speeds that rival centralized exchanges, without compromising on the security of a DEX. DEX Labs has recently completed performance optimizations for the matching and execution engine: In recent benchmarking tests, matching orders on DerivaDEX are filled by the execution engine in under 2 milliseconds (down from 43 milliseconds in earlier versions).

While this benchmark isn’t a whole “round trip” between a user’s machine and the operators, it represents a large percentage of that total time. This is competitive with leading centralized venues — stay tuned for some more extensive “round trip” benchmarking comparisons!

Why does this matter?

An average trader probably doesn’t care much if an order is filled in 2, or 200 milliseconds. Institutional market makers, however, do.

A key feature of DerivaDEX is that the exchange uses a central limit order book. That means liquidity is provided on DerivaDEX by market makers– who are free to run their most advanced liquidity provisioning strategies. In contrast to automatic market makers (the AMMs referenced above as option 1) that spot DEX traders are familiar with, conventional market making is an industry standard on all centralized exchanges.

While this may not be evident from the canonical trading pairs like BTCPERP and ETHPERP, where liquidity is deep on AMMs and orderbook exchanges, liquidity that can be capital efficient and provisioned by modern market makers can make a huge difference in more illiquid trading pairs. Enabling this kind of liquidity ensures that DerivaDEX is capable of growing quickly into an exchange supporting a wide number of trading products.

There’s plenty more to unpack about what sets DerivaDEX apart, but the TLDR on performance is:

  1. Derivatives require complex state management, which is expensive (impossible?) to do on-chain with open order books. So, exchanges have two options: hybrid architecture or using an automated market maker.
  2. Open order books are necessary for capital efficient, modern market making. Speed is also required for efficient market making.
  3. Efficient, modern market making is important for all trading pairs, but *especially* for lower volume or less popular products.

One factor that drives the appeal of AMM spot exchanges like Uniswap or Sushiswap is the long tail of supported trading pairs: anyone can create a market. Bringing liquidity and volume to that market however, is a different question.

DerivaDEX is poised to provide a decentralized analogue to this for derivatives, with groundbreaking execution speed bringing improved capital efficiency and liquidity.

Get Involved!

DerivaDEX is currently in open beta, and you can try it out at beta.derivadex.io.

To get testnet tokens and learn more about how to test the exchange and provide feedback, or to participate in the DerivaDAO, check out the Discord.

Finally — follow @DDX_Official on Twitter for the latest updates!

Ainsley Sutherland is the product lead at DEX Labs, an R&D technical contributor to DerivaDEX, a decentralized derivatives exchange.

--

--

Ainsley Sutherland
DerivaDEX

Product Lead @ DEX Labs (building DerivaDEX & more)