, 23 tweets, 5 min read Read on Twitter
0/ With the recent explosion of @UniswapExchange, I think it’s a good time to explore the current state of DEX design. This thread will examine the mechanics (and tradeoffs) of a few major DEX protocols.
1/ We’ll start with @UniswapExchange, which uses the constant product market maker model. This model, adapted from the logarithmic market scoring rule (LMSR) used in prediction market protocols like @AugurProject, applies a deterministic algorithm to automatically make markets.
2/ This system works without the concept of limit orders. Instead, market makers provide two sided liquidity and the algorithm provides quotes based on the simple equation x*y = k, where x and y are the pooled quantities of base and quote tokens, and k is a constant product.
3/ The equation represents a nonlinear, inverse variation between token quantities. From this relationship it follows that price quotes are size dependent and liquidity is perpetually available.
4/ Arbitrageurs therefore maintain price levels by adjusting the relative liquidity supplies between the two tokens. Liquidity providers are incentivized via a small, proportionally distributed fee paid to the pools by traders.
5/ Advantages of this system include constant token availability and censorship resistance (completely on-chain). Disadvantages include high price slippage and vulnerability to miner-front running.
6/ Next up is DutchX from @Gnosis. DutchX utilizes a batch auction mechanism that relies on a repeated two state system. In the first state, sellers deposit tokens to sell (analogous to providing liquidity). In the second, a dutch auction is activated for the provided liquidity.
7/ For those unfamiliar with a dutch auction, it is an auction scheme where the price is decreased until a buyer is found.
8/ Bidders can submit orders at any point during the auction period, but are encouraged through the mechanism to bid at their price representing their maximum willingness to pay. Once the auction is closed, all bids are cleared at the price of the last successful bid.
9/ Batch auctions have often been considered a viable (and potentially desirable) alternative to continuous time trading (via limit order books) because they encourage market participants to compete on price rather than speed (trade rationing is price dependent).
10/ Like @UniswapExchnage, DutchX is completely on-chain. Advantages of the DutchX system include the efficiency of the price discovery mechanism as well as its resistance to miner front running and collisions.
11/ Disadvantages of this system are relatively limited, but some research suggests a reduced profit for liquidity providers and therefore an overall reduced liquidity supply. Settlement also takes longer (whether this tradeoff is worth the price benefit is case specific).
12/ Finally, let’s look at @0xProject which is perhaps the most adaptable protocol of those mentioned. @0xProject is based on a maker-taker model, providing a contract settlement system and defining a standard for signed order messages.
13/ In more detail, a market participant, known as the maker, creates and signs a limit order based on the 0x message format. The order is then broadcast to be discovered by a taker who can become the counterparty by submitting the order to the specified exchange contract.
14/ The protocol is highly extensible, encouraging innovation at both the relay and execution layers. Orders are generally relayed (broadcast in the hope of discovery and settlement) via entities called “relayers”.
15/ Relayers are predominately centralized systems that implement either open and closed order book models, but can be non-rent seeking decentralized networks like @ParadigmFdn 😉. Their main function is maintaining an aggregated “bulletin board” of maker orders.
16/ The standardization of the contract system and message format enable liquidity sharing, though some complications arise. Open order book systems currently suffer from miner-front running and possible trade collisions. Cancellations also require an on-chain transaction.
17/ With that said, execution schemes enforced via trade execution coordinators (TECs) have the potential to solve both of these problems.
18/ In addition to enforcing price/time order prioritization in continuous time, TECs can also introduce more sophisticated execution processes. This includes schemes like selective delay, batching, etc.
19/ Near-term implementations of TECs are fairly centralized in nature, but will likely evolve towards decentralization whether it be via the application of VDFs, side chains, or TEC networks.
20/ Advantages of @0xProject include its extensibility, adaptability, efficiency (order placement/price discovery can happen off-chain for free) and scalability (ZKP-based layer 2 scalability solutions are actively being developed).
21/ Challenges for @0xProject include front-running and collision resistance as well as cancellation enforcement and relayer censorship susceptibility.
22/ In short, @Ethereum provides an incredible testbed for experimentation in market design. Many talented teams are exploring DEX design from different angles. Based on fundamental tradeoffs of each system, I suspect this is not a winner-take all market.
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Liam Kovatch
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!