The Past, Present and Future of Decentralized Exchanges

Rahul Rai
Gamma Point Capital
16 min readMar 17, 2021

--

Photo by Pierre Borthiry on Unsplash

Originally published on Messari

Disclaimer:

  1. The above reflects the views of the investor and should NOT be construed as investment advice, financial advice or legal advice.
  2. This information is purely educational and is NOT meant to be taken as a recommendation to buy or sell any product or service. Please do your own research before making any decisions.
  3. Where relevant, direct quotes & passages have been taken from the sources, whitepapers, and blog posts cited.

Market makers play a crucial role in the smooth functioning of financial markets. By continuously quoting prices at which they stand ready to buy (‘bid”) and sell (“ask” or “offer”), they increase liquidity for other market participants, enabling them to trade the underlying asset at tight prices with minimal slippage. In addition, by providing liquidity across various exchanges and arbitraging away inter-market price discrepancies, they increase overall market efficiency and enable price discovery.

Source: Towards Data Science

Market making is ultimately a complex optimization problem, in which participants leverage proprietary statistical models and low-latency technology to build sustainable long-term moats. All of this results in the market maker distribution being power-low dominated and fat tailed, with only a few top participants capturing a lion’s share of trading volume. In U.S equity markets for example, Citadel Securities and Virtu together capture almost 50–60% of market share. Citadel Securities in particular trades approximately 25% of U.S equities volume and 39% of all U.S listed retail volume, across more than 8,000 listed securities and over 16,000 OTC securities.

In stark contrast to traditional finance, where regulatory and competitive barriers prohibit individuals and smaller shops from filling the market maker role, crypto markets provide direct market access to all participants. Individual traders have full access to the technology stack of centralized exchanges, enabling them to provide quotes and trade algorithmically using the same APIs and servers as professional firms. Decentralized Finance (DeFi) has taken this one step further, and fully democratizes access to market making and liquidity provision through the implementation of Automated Market Maker (AMM) based Decentralized Exchanges (DEXs).

AMM based DEXs have proven to be one of the most impactful DeFi innovations, allowing investors to seamlessly trade between cryptocurrencies in a completely decentralized and non-custodial manner through pre-funded on-chain liquidity pools. By just depositing capital into these on-chain liquidity pools (LPs), liquidity providers can earn passive income on their capital through accrued trading fees, based on the percentage of their contribution to the pool.

DEXs have had unprecedented success over the past few months. Led by Uniswap, DEX volumes soared to a record $72 billion high in February, and the total liquidity (otherwise known as total value locked) on DEX platforms also reached a new all-time high of more than $12 billion.

Source: Dune Analytics

However despite their success, AMMs face their own set of challenges. A number of inherent problems such as impermanent loss (IL), capital efficiency, slippage, gas costs, speed and multi-token exposure are holding them back. In this article we’ll cover the three main areas around which DEXs and AMMs are innovating, and highlight their most promising implementations:

  1. Capital Efficiency & Customizable AMM Curves: Bancor, DODO, Balancer, Deriswap, Uniswap
  2. On-Chain Market Makers & Orderbooks: Kyber, 0x, Serum, Raydium
  3. DEX Aggregators & Cross-chain Liquidity: 1inch, Matcha, THORchain

Capital Efficiency & Customizable AMM Curves

The launch of Uniswap’s constant function market, x*y=k, in late 2018, was a pivotal moment that kick-started the Cambrian explosion of innovation around AMM curves and constant-function market makers (CFMMs). Balancer took this one step further by implementing a constant mean market, a generalization of a constant product market, allowing for more than two assets and allowing for weights outside of 50/50. Curve, which launched in early 2020, modified Uniswap’s AMM function to minimize slippage for assets that are relatively stable-priced, demonstrating that small tweaks to CFMM curves could drastically improve capital efficiency and slippage.

There are however some inherent risks and inefficiencies that LPs in AMM pools are exposed to. The most important, and relatively esoteric, risk is impermanent loss (IL) — the difference in portfolio values over time between providing liquidity into an AMM pool versus buying and holding the underlying tokens (HODLing). It occurs because AMM prices don’t automatically adjust, so when market wide prices change, arbitrageurs step-in and profit at the expense of liquidity providers. So the actual return for LPs in AMM pools is a balance between the accumulated fees from trades and the impermanent loss caused by the price differential.

Source: Pintail

In addition to IL, AMMs in their current implementation suffer from capital inefficiency, under-utilized liquidity and multi-token exposure. Since AMMs allocate funds uniformly across the price range (0, +∞), only capital allocated near market prices are being utilized efficiently with a substantial portion of funds only available when the pricing curve begins to turn exponential. As a result, AMMs require larger amounts of liquidity to match slippage on traditional order book exchanges. Moreover, AMMs are often referred to as “lazy liquidity” since price points being offered to traders cannot be controlled, unlike traditional market makers who are much more informed and nimble. Furthermore, AMMs usually require LPs to deposit two or more tokens to provide liquidity, often forcing exposure to additional assets.

AMM curve vs an Order Book. Source: Parsec Research

Given the current limitations with AMMs, a number of protocols have stepped in to innovate around capital efficiency and customizable AMM logic. Bancor V2, which launched in Apr 2020, was one of the first protocols to address capital efficiency, impermanent loss and multi-token exposure. It leverages pegged liquidity reserves, which use price updates from Chainlink oracles to dynamically adjust the AMM pool weights. This aligns the internal pool price with external market prices, preventing arbitrageurs from siphoning value from LPs in the form of IL. In addition, V2 offers customizable AMM curve logic and integrations with lending pools, enabling lower slippage, better prices and higher capital efficiency. Finally by pegging liquidity reserves via Chainlink oracles, LPs can maintain single-token exposure and can select their exposure to any token in the AMM, from 0–100%.

DODO is another protocol innovating around customizable AMM logic that pioneered the proactive market making (PMM) algorithm, which aims to be an elegant generalization of the order book matching system. PMMs allow for greater capital efficiency and IL mitigation by leveraging price oracles to adjust the pricing curve such that a greater fraction of liquidity is concentrated around the market price of an asset. As shown below, it is clear that around the market price the DODO curve is significantly flatter than the Uniswap curve, indicating higher fund utilization and lower slippage.

There are also a few exciting unreleased projects tackling capital efficiency and AMM logic. For instance, Balancer V2, which is expected to launch in March this year, is a generalized AMM protocol innovating around capital efficiency, flexibility and gas efficiency. V2 implements a single vault that holds and manages all assets deposited into Balancer pools. Because the AMM logic is separate from the token management and accounting done by the vault, pools can implement any arbitrary, customizable AMM logic including weighted pools (for constant weight index funds), stable pools (for soft-pegged tokens) and smart pools (for ongoing parameter changes).

Furthermore, with the launch of Asset Managers — trusted external smart contracts that can utilize the underlying tokens the pool has deposited in the vault — capital efficiency and yield can be improved by lending assets in the AMM, that are not being utilized, to lending protocols. The team recently announced a partnership with Aave to build the first Balancer V2 Asset Manager.

In addition, Deriswap, which was announced by Andre Crone in collaboration with Sushiswap at the end of last year, combines swaps, options and loans into a single capital efficient contract. By consolidating liquidity and deploying capital across multiple use-cases, it allows LPs to maintain their asset exposure and earn additional yield. Finally Uniswap V3 is another highly anticipated project that is rumored to implement customizable AMM curves and tackle capital efficiency.

On-chain Market Makers & Orderbooks

Capital markets aim to match buyers and sellers of financial assets in the most efficient and cost-effective manner. Historically, there have been two primary systems that centralized financial exchanges have implemented to match buyers and sellers of liquidity:

  1. Request For Quote (RFQ): Price takers send price quote requests to multiple market makers every time they wish to trade
  2. Central Limit Orderbook (CLOB): Market makers continuously stream quotes in an order book, which price takers trade against

Both of these systems have evolved and survived the test of time as highly efficient ways to enable liquidity and price discovery, and they each have their advantages and disadvantages. RFQ systems work better when price takers come in less frequently with relatively larger sizes, and so market makers only have to show prices when they are pinged by takers. Most OTC desks implement some form of an RFQ technology — when I worked on the Foreign Exchange (FX) desk at Morgan Stanley for example, we would constantly respond to two-way OTC price quotes from hedge funds for large currency trades. CLOB systems work best when there is a constant stream of price takers coming in with relatively smaller trade sizes, in which case market makers are happy to continuously stream two-way price quotes algorithmically. Most centralized electronic exchanges implement CLOB systems.

In DeFi, AMMs captured a lion share of DEX liquidity due to the inherent scaling constraints of Ethereum, which make on-chain orderbooks and market makers less feasible. As AMMs saturate and professional market makers look for more efficient solutions to providing DeFi liquidity, we’re starting to see rapid innovation across both on-chain RFQ and CLOB protocols. Fully on-chain markers do token price quoting, order matching, and trade settlement all directly on the blockchain itself, while hybrid approaches perform orders and matching in an off-chain system.

Kyber, for instance, is one of Asia’s leading players as a fully on-chain DeFi liquidity provider and has 5% of the DEX market share. It has already facilitated over $1 billion in on-chain trading volume through the Fed Price Reserve (FPR) — a liquidity system through which professional market makers can maintain an on-chain inventory of prices with control over pricing and rebalancing algorithms. The team launched KyberPRO in late October of 2020, an end-to-end framework built on top of the FPR system that provides tools, documentation, and technical support to enable professional market makers to easily onboard to DeFi and run a profitable market making operation on-chain with minimal smart contract knowledge. Further with the recent Kyber 3.0 announcement, Kyber plans to transition from a single protocol to a hub of liquidity protocols that are catered to different DeFi use cases. In addition, they plan to launch Kyber DMM — an automated dynamic market maker that enables programmable pricing curves to improve capital efficiency and dynamic fees based on market conditions to mitigate IL and increase LP profits.

Source: Kyber

0x is another leading DEX infrastructure layer that has two main products: a DEX aggregation API that allows developers to integrate cross-platform asset swaps, which has already powered over $3.5B of trading volume, and a consumer facing DEX aggregator called Matcha, which has facilitated over $2.8B in trades in just the past six months. Professional market makers can provide liquidity via RFQs to users of the 0x API through a hybrid system, in which order storage and matching is done off-chain while trade settlement is done on-chain. With the tokenomics of v3, the network has generated over $1M in fees paid to ZRX holders and market makers, and the team recently announced v4, which introduces a new modular architecture that empowers developers to compose 0x with a growing number of DeFi primitives.

Source: 0x

In addition, DODO, which as mentioned earlier pioneered the PMM algorithm, recently announced their v2.0 which aims to bring professional market makers on-chain through the launch of DODO Private Pools (DPP). Market makers can leverage these private markets and customizable PMM liquidity pools to deploy tailor-made strategies on-chain and react dynamically to market conditions. They also have the option of opening up their pools to retail LPs, which is an exciting step forward in the democratization of professional market making.

Furthermore, with some L1 blockchains offering significantly faster transaction throughput and settlement times relative to Ethereum, on-chain order books are becoming increasingly relevant. For instance, Serum is a DEX that lives natively on the Solana blockchain, but is fully interoperable with Ethereum, that offers decentralized on-chain limit orderbooks and trustless cross-chain swaps. Solana is a blockchain that combines a Proof-of-History (PoH) timestamp system with a Proof-of-Stake (PoS) consensus algorithm to optimize for scalability and implements low transaction costs, sub-second settlement times and up to 65K TPS throughput (vs Ethereum’s current 15 TPS). Serum’s orderbook leverages Solana’s higher speeds and lower costs to deploy a fully on-chain and programmatic matching engine, allowing users to submit orders with directions, size and price specified. With over $950mm in volume facilitated since inception, Serum is one of the fastest growing DEXs and will likely continue to capture market share given the current throughput and gas constraints with Ethereum based DeFi protocols.

Serum Orderbook

With the proliferation of on-chain market makers and orderbooks, we are inching closer to realizing Haseeb’s vision, outlined in Unbundling Uniswap, of DeFi liquidity being commodified by aggregators, with professional on-chain market makers competing alongside with AMMs. It will be interesting to see where value ultimately accrues. Will Ethereum be able to maintain its dominance against other faster blockchains? And will AMMs be able to compete with more capital efficient on-chain market makers?

Aggregators & Cross-Chain Liquidity

DEX aggregators, which consolidate liquidity and intelligently route orders to give users best execution on trades, have rapidly grown in volumes over the past few months. As aggregators continue to capture market share, the demand-side effectively becomes commoditized and AMM liquidity becomes undifferentiated supply. Traders will increasingly interact with DEXs only indirectly via aggregators, forcing DEXs to focus on owning the supply-side and providing competitive prices.

In short, aggregators will compete for trader flow while AMMs compete for LP capital.

Pantera captures this thesis beautifully in a recent bog post announcing their Series B announcement in Wintermute, a prominent crypto and DeFi market maker:

We envision a future where liquidity across hundreds of decentralized exchanges is consolidated and easily accessed through aggregators like 1inch or Matcha. Market makers like Wintermute can plug liquidity directly into these aggregators and eventually make DEX markets as efficient as their centralized counterparts. This combination — user-focused DEX aggregators on the front end and hyper-efficient, sophisticated algorithms on the back end — has the potential to accelerate adoption of DeFi and even disintermediate centralized exchanges. In this future, centralized exchanges like Coinbase will serve as front ends for decentralized exchange infrastructure.”

The two most dominant liquidity aggregators are currently 1inch and Matcha. 1inch is the leading DEX aggregator, accounting for about 10% of all DEX daily volume and regularly facilitating over $300 million in daily volume. As Messari previously covered, the aggregation protocol consists of on-chain contracts which execute batched interactions to multiple DEXes. 1inch’s proprietary off-chain Pathfinder API is used to optimize trade routes (speed, cost, and efficiency) for users that are ultimately executed using 1inch’s on-chain contracts. Since inception 1inch has facilitated over $13 billion in trades, half of which were executed in the past three months alone. In addition to dominating the front-end user experience, 1inch is also aggressively pursuing vertical integration strategies, such as the 1inch liquidity protocol, and cross-chain integrations.

Matcha is a consumer facing DEX aggregator, built by 0x Protocol, that uses the 0x API and smart order routing to aggregate liquidity and provide optimal trade execution. Matcha averaged over $40m a day in January and had its second $1B+ month in February. Under the hood, Matcha splits trades across 0x Mesh, Kyber, Uniswap, Curve, Oasis, and its own proprietary liquidity sources to find the best prices for traders. In addition, Matcha employs meta transactions and gas tokens to further reduce transaction costs for traders and minimize Ethereum gas fees.

Source: Delphi Digital

Ultimately value capture is a struggle for DEX aggregators due to the lack of network effects, zero switching costs, and fees extraction becoming a ‘race to the bottom’. DEX aggregators are also starting to face competition from wallets and portfolio management platforms that are all vying to ‘control the end user’ and be the dominant front-end for traders. MetaMask Swaps for example aggregates liquidity from a variety of aggregators and AMMs and charges a service fee of 87.5bps on each trade. It has amassed ~$10m in fees to date and does nearly $20m in daily volume.

MetaMask Swaps Volume Distribution

While most DEX aggregators are focused on Ethereum, cross-chain aggregators and liquidity bridges are becoming increasingly important, as liquidity gets distributed across more L1 chains and protocols. As Ethereum gas fees continue to sky-rocket, we’re seeing users shift to other L1 alternatives such as Binance Smart Chain, Solana and Polkadot. Most Ethereum protocols have announced L2 scaling plans — Synthetix staking is already live on Optimism, Loopring has an active L2 DEX, dYdX announced perpetuals live on Starkware’s ZK-rollup and Uniswap and Curve are also expected to announce rollups soon. But the transition process is slow and as Ethereum Layer 2s scale gradually, other blockchains are stepping in to cater to the burgeoning demand.

BSC in particular has been steadily gaining traction, with its DEX protocol Pancakeswap recently doing more daily volume than Uniswap and its money market protocol Venus accumulating almost $4B in TVL. As this trend continues, and as new smart contract platforms like Polkadot, Solana, Avalanche, and Near mature, aggregation of liquidity fragmented across blockchains and protocols becomes crucial — and that’s where THORchain steps in.

THORchain is a decentralized cross-chain AMM, built on the Cosmos SDK, that provides a trust-minimized way to trade spot tokens across various L1 blockchains. Cross-chain swaps are facilitated by a network of continuous liquidity pools (CLPs) and validator nodes. The protocol’s native asset, RUNE, serves as 1) collateral posted by nodes ensuring network security and 2) the common quote currency for each CLP. RUNE is staked as collateral for validators providing cross-chain proofs to settle cross-chain swaps. In addition, it serves as the settlement for each trade in the system, maximizing liquidity of all assets rather than fragmenting liquidity across lower-volume pairs.

From a tokenomics perspective, THORchain offers strong value capture for RUNE, which accrues value deterministically based on liquidity. Participants of THORchain earn rewards either by bonding RUNE to secure consensus or by staking RUNE along with external assets in the CLPs. As Multicoin explains in their recent report, the value of RUNE must always be worth 3x the value of external assets is liquidity pools — for every $1 of a native asset in the network, LPs must stake an equivalent of $1 RUNE to the corresponding CLP and nodes in the network must bond $2 of RUNE to sign transactions and provide network security. This incentivizes nodes to operate honestly, as the value of the bond that can be slashed is always worth more than the total value of assets in the liquidity pool.

The amount of RUNE in the network therefore aims to be balanced 67%-33% between nodes-LPs. THORchain proposes a novel mechanism called the Incentive Pendulum to allocate block rewards and network fees between node operators and LPs to maintain this balance. In particular, the proportion of system income distributed to liquidity stakers is given by

A Gauntlet report stress-tested the incentive pendulum under a variety of market conditions, and shows that the existing choices leads to a stable and healthy system. THORchain has already accrued over $85M of TVL on Chaosnet, and is planning for a mainnet launch soon that will support BTC, ETH, LTC, BNB and BCH. THORchain ultimately hopes to be the first AMM to tackle the short-tail of crypto assets, an audacious yet highly lucrative goal. Furthermore, it could also provide the foundation of cross-chain DeFi, where traders can not only swap cross-chain assets but also access cross-chain debt markets, synthetics, derivatives and so on.

Conclusion

Ultimately, all investors are looking to deploy their capital to maximize risk-adjusted returns. AMMs have truly been a zero to one innovation, offering a non-custodial, censorship-resistant solution to trading and liquidity pooling. By truly democratizing market making and offering a great way for liquidity providers to earn yield on their capital, DEXs and AMMs have been, and will continue to be, a foundational part of the DeFi stack.

--

--

Rahul Rai
Gamma Point Capital

Finance, Tech, Crypto. Formerly FX at Morgan Stanley. Wharton ‘19.