Dominant DEX

Gustav Simonsson
Aug 1 · 6 min read

Dominant DEX is an extension to the classical order book model for Decentralized Exchanges (DEXs). It increases incentives to provide liquidity on the book, makes liquidity more reliable and transparent and provides both takers and makers with more flexibility. The model can be more attractive to market participants than even a zero-fee DEX.

The latest version is tracked on GitHub.

We will jump right into the mechanism. The last section is a background discussion which can be useful if you are less familiar with order books, order matching logic, DEXs and Ethereum.

Overview

We assume a “standard” order book and matching engine, on top of which we add/configure the following:

  1. Taker fees must be positive and should generally be higher than the highest maker fee.
  2. The highest/starting maker fee must be positive.
  3. All order fees are sent to a “Fee Pool”. There is one Fee Pool per order book.
  4. Limit orders can optionally include a timestamp denoting a future time instant. If set, the order cannot be cancelled until this future time.
  5. Maker fees are defined by a continuous function which is not only proportional to the order amount, but also inversely proportional to (1) how far in the future the order is locked and (2) how close the order is to the bid-ask spread.
  6. Maker orders locked far enough into the future and close enough to the bid-ask spread will get a negative fee, which transforms into a claim on the Fee Pool.

Essentially, this adds an optional incentive for makers to not only get a lower or zero fee — but even get paid for locking their liquidity. Makers can very granularly configure their liquidity and price cost/risk vs potential fee revenue.

Long term hodlers can safely earn funds by locking their tokens at their long-term target price. Short-term speculators/traders can earn a significant percentage on liquidity they would anyway place in limit orders, and be more incentivized to make liquidity than take it.

Takers — while required to pay a positive fee — gain not only from the increased amount of liquidity on the book, but also from the hard time guarantees. A taker can filter the order book to only see liquidity locked within the time frame they care about.

Time locked liquidity cannot be spoofed.

This creates a market that both makers and takers may prefer over even a zero-fee regular DEX. A key assumption is that liquidity is often the most important factor for market participants — especially larger ones — triumphing centralized counterparty risk and considerable trade fees (e.g. 0.1-0.3%).

Takers that are currently accepting industry standard fees would presumably do so in a Dominant DEX that gives them access to more reliable and predictable liquidity.

Open questions

  1. Should the inverse proportional factors in the maker fee function (duration of time locks and proximity to bid-ask spread) be linear, quadratic, etc?
  2. What is a meaningful maximum time lock period? True hodlers would surely prefer infinite lockup, but that would also give a negligible fee decrease compared to e.g. 1y lockup.
  3. What is the best way to compute a new order’s proximity to the bid-ask spread? (1) To avoid (extremely) short term manipulation, it could make sense to use a time and/or volume based average of the spread. (2) As the spread moves while the order is locked, how/would the proximity factor be updated?
  4. How exactly is the negative maker fee == claim on Fee Pool modeled? E.g. a time locked order could continuously earn fees as long as it is not (fully) crossed.

Background

Decentralized Exchanges (DEXs) and stablecoins are getting traction on Ethereum, with growing liquidity for trade-pairs using a stablecoin as the pricing currency.

From a legacy finance perspective, DEXs combine exchange, broker and clearing house functionality in one tamperproof, automated and autonomous application.

DEXs also greatly reduce — if not entirely eliminating — counterparty risk. They inherit the security and speed of transactions on the underlying blockchain, enabling users to deposit, trade and withdraw their funds with (effective) finality in as little as 3 minutes on Ethereum.

However, DEXs have not innovated much on order books and matching engine fundamentals. Some DEXs feature novel forms of Autonomous Market Makers (AMMs) which can be optimal for illiquid markets with (very) small order sizes. However, AMMs work poorly for large orders which cause significant slippage as AAM algorithms cannot provide significant liquidity close to the spot price without risking running out of funds. AAMs are also less flexible for liquidity providers (makers) and sometimes require them to lockup both tokens in a trade pair.

While AAMs are a very interesting area of research, it’s worth taking another look at the classical order book and see how we can improve it using smart contract capabilities.

One of the most important reasons why even zero-fee DEXs have been unable to compete with centralized exchanges is liquidity. Traders and other market participants flock to liquidity, often compounding the dominance of high-liquidity exchanges.

Poor usability, user interfaces (UXs) and front-running are other major reasons why centralized exchanges dominate. DEX UXs are ever improving, however, and front running has seen significant research with many promising solutions available.

Looking ahead, liquidity could well be the bottleneck for DEX growth as usability, front running mitigations, scalability and privacy improve.

Meanwhile, the multi-billion $ revenue of centralized exchanges from trading fees demonstrates just how much value could go back to market participants in zero-fee exchanges if they could compete on liquidity.

With everything else equal, zero fees can intuitively seem like the optimal model, as no value is extracted by the exchange operation.

Now for the crazy idea — what if we can do better than zero fees?

Dominant DEX Heuristics

To see how we can potentially unlock more value than even a zero-fee based exchange, we can think of classical order books as having unlocked or unrealized value in terms of the lack of reliability of liquidity on the book.

A maker (placer of limit orders) can always cancel their order at any time. While spoofing is illegal in many jurisdictions, it’s often hard to define the line between spoofing and “legit” algorithmic / high frequency trading. And there appears to be no way to algorithmically prevent spoofing that cannot be gamed without outright locking orders in place — which would incur prohibitive risk and cost for makers.

First, let’s imagine a DEX where taker fees are positive and the highest/starting maker fee is positive. All fees go into a “Fee Pool” held by the DEX smart contract. There is one Fee Pool per order book.

Then, we add an optional time lock to limit orders in the form of an optional timestamp denoting a future time instant. Makers can set this timestamp if they want, in which case the order cannot be cancelled until the future time. The order is otherwise a normal order and matched the same as unlocked orders.

To incentivize makers to lock their orders, we lower the maker order fee the longer the order is locked. If locked far enough into the future, the fee can become negative, transforming into a proportional claim on all trade fees collected by the DEX.

Makers can now granularly configure their time vs liquidity risk. A seller who plans to leave a sell order in place for two weeks can simply time lock it for that period to get a lower fee or even earn some extra funds if the fee goes negative.

Takers — while required to pay a trade fee in order to fund negative maker fees — gain a lot of value from time locked orders. They now have proof of what portion of order book liquidity cannot be spoofed, and can filter the order book to see liquidity locked for various time frames. This can improve arbitrage and generally make the market more stable and reliable.

However, long term hodlers could simply lock their funds at a very high price in order to earn trade fees with little risk. To counter this, we add another factor to the maker fee function: Spread Proximity.

The closer a time-locked order is to the bid-ask spread, the lower its fee is. This can be linear, quadratic — any continuous function.

Long term makers now face an interesting incentive game — they can lock liquidity at lower/higher prices, potentially earning a small amount of funds with low risk. Or, they can place orders closer to the spread to earn much more.

If tuned correctly, makers will have an incentive to optimize their risk and cost of price, liquidity and time. This should create a market that is more attractive to both takers and makers, compared to a zero-fee exchange.

Note that this model is not zero-sum compared to a zero-fee exchange, as while all fees go back to the market participants, the time locking of liquidity represents a new form of value for takers, that is currently not supported in any existing exchange.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade