[Why Gno?] Lessons from the History of Exchanges — Part 2

Gnoswap
9 min readAug 22, 2023
Design Source: Cosmos

Co-authors

Peter Yoon (@whitebitcoin8)
Andrew Kang (@adr_sk_)

This article is Episode 5 of Why Gno?, a series featuring a deep dive into Gno.land, the most performant smart contract platform powered by Gnolang, and Gnoswap, an innovative concentrated liquidity DEX aspiring to become the liquidity hub of Gno.land.

[Why Gno?]

Episode 1: Tracing the History of Crypto

Episode 2: Hello World, Meet Gno.land

Episode 3: A Deep Dive into Gno

Episode 4: Lessons from the History of Exchanges — Part 1

Intro

The rise and fall of exchanges in the past have taught us three invaluable lessons that every builder should know when designing future-proof crypto exchange platforms. Each of the lessons was centered around one mutual consideration: the demand of users. We thoroughly explored the historical factors behind the creation of these demands in Part 1, which you should read first if you haven’t yet.

In this episode, we will discover how the blockchain landscape is evolving as a response, and break down platforms and their solutions that are leading the industry.

Challenge 1 — How to create a secure trading environment

Background

Make Trading Reliable”. After losing billions of dollars from hacks and misappropriation, traders are now searching for a secure place where they can confidently trade without relying on a third party to manage their assets. One way to solve this is by using exchanges that are heavily regulated and audited. However, the world still lacks such legal frameworks. The alternative, fundamental solution to this problem, arguably the more “blockchain” approach, is building a decentralized trading platform where the exchange runs as a protocol, and the assets of users are kept non-custodial, which we call a decentralized exchange (DEX).

Solutions

Spot Order Books — EtherDelta, IDEX

The EtherDelta Frontend | Source: Twitter

The first experiment in building a DEX started in 2016 by developing an order book-style exchange on-chain. EtherDelta and IDEX were the pioneers of this attempt. However, both were partially decentralized, as only the execution and settlements could be implemented as smart contracts, while the submission and matching of orders were handled in centralized servers to avoid excessive gas fees.

Unfortunately, this architecture forced the operators to become liable for trades within exchanges. As a result, EtherDelta, which provided services to residents of the US, was accused of facilitating transactions of unregistered securities by the SEC and met its demise in 2018. This made clear that partial decentralization was insufficient to be free from risks associated with operators.

Automated Market Makers — Uniswap v1 & v2

The Uniswap v2 Frontend | Source: Uniswap

In 2017, the following year of the EtherDelta crackdown, the founders of Uniswap Protocol tried a new approach: a way to deviate from order books to a new method of sourcing on-chain liquidity. The method involved an automatic pricing model called the Constant Product Market Maker (CPMM), which relied on a formula to determine the price of an asset based on the number of tokens in each pool dedicated to a pair that contained the liquidity for trading. Unlike order books, the CPMM required only 1 transaction to provide liquidity across the entire price range, removing the need for the involvement of off-chain servers for facilitating order book filling or matching.

Powered by the CPMM, Uniswap was able to “protocolize” the liquidity infrastructure. As no operators were involved, all of the trading fees were entirely paid to liquidity providers, creating a virtuous cycle that looks like the following:

The Uniswap Flywheel

Uniswap laid out the foundations for the canonical approach of DEX development, which has greatly inspired countless projects to this date.

Challenge 2 — How to diversify listings and support on-chain derivatives

Background

Offer Diversity and Leverage”. Historically, users have shown tendencies of shifting toward exchanges that offer a wider selection of tokens and leverage trading. This is a natural behavior, as the purpose of trading is to make profits, and diversity and derivatives offer more opportunities for users.

Solutions

Permissionless Listing — Uniswap, Sushi, PancakeSwap

Permissionlessly listing a random token on Uniswap | Source: Uniswap

Most AMM implementations allowed the permissionless creation of liquidity pools, meaning that listing tokens were no longer gated by the operators of an exchange. This saved nascent projects tens of thousands of dollars in listing and marketing fee expenses that were paid to centralized exchanges in the past. Naturally, AMM DEXs has become the exchanges with the highest diversities, with Uniswap alone offering over 14,000 pools to trade from, whereas the centralized exchange with most listings, GATE.IO, only offers approximately 2,900 markets.

Perpetual Order Book — DYDX

The DYDX Frontend | Source: DYDX

In 2017, DYDX was founded to bring derivatives on-chain, by building a hybrid order book system-based leveraged futures exchange, which functions similarly to the partially-decentralized spot order books mentioned earlier. DYDX has further scaled this approach by developing a dedicated layer 2 blockchain, in which gas fees were fully paid by the foundation, meaning that users were only left to pay the layer 2 deposit & layer 1 withdrawal fees, basically providing an experience equivalent to that of centralized exchanges.

Once again, however, users were exposed to centralization risks as the exchange was reliant on the off-chain servers run by the DYDX foundation. On top of that, all of the fees were directed to the foundation to cover the operational costs.

Perpetual Liquidity Pools with Oracle Pricing — GMX

The GMX Frontend | Source: GMX

In 2021, as an attempt to fully decentralize perpetual leverage trading, the creators of GMX invented a new product where traders could trade with leverage against a liquidity pool called GLP, which contained a basket of assets distributed in proportions. The strike price relied on the Chainlink oracle due to the lack of an internal pricing mechanism. By locking up the maximum possible profit of an open position, the pool ensured that it always had funds available to pay the trader. For example, if a trader opened a short position of 2 BTC at the market price of 1 BTC = 10,000 USD, the highest profit for that position would be 20,000 USD, since it costs 0 USD to repay 2 BTC when the price reaches 1 BTC = 0 USD. This meant that 20,000 USDT from the pool was locked up and reserved until the position was closed or liquidated. The opposite applied for long positions, where the reserves were kept in the number of BTC, not in stablecoins.

Essentially, the profits of traders resulted in a loss from the pool, and vice versa. With the high fees that are applied on leveraged positions and the fact there tend to be more losing traders in the derivatives market, GLPs became an attractive medium-risk medium-return product, facilitating over $118b in cumulative volume and generating over $186M in fees in less than 2 years since its inception.

Traders have lost over $21.5M against the GLP liquidity | Source: GMX
Source: DefiLlama

However, the risk of exposing the liquidity providers to every single asset that is available for trading limited flexibility in supporting additional tokens. This structure left GMX unscalable in terms of diversity.

Challenge 3 — How to build deep liquidity and streamline UX

Background

Binance and Upbit were each able to dominate the global and local markets, respectively with an intuitive interface, highly vetted token listings, and a friendly trading experience thanks to diverse stablecoins & fiat markets. These factors attracted more traders, and naturally, deeper liquidity.

Solutions

Concentrated Liquidity Market Maker — Uniswap v3

Concentrating Liquidity for Deeper Liquidity | Source: Uniswap

Although traditional AMMs such as the CPMM pioneered decentralized market-making for sourcing on-chain liquidity, its drawback was thinner liquidity compared to order books, as its pricing curve forced liquidity to be evenly distributed across all prices.

To lower the slippage and price impact for better prices, the Uniswap protocol implemented a new model for liquidity provision — the Concentrated Liquidity Market Maker (CLMM) in 2021. CLMM allows liquidity providers to select an upper & lower price bound only in which their liquidity will be active by specifying a price range. Compared to traditional AMMs, CLMM provided up to 20,000x higher liquidity for the same amount of capital. Thanks to its unmatched capital efficiency, Uniswap v3 was able to dominate over 30% of total DEX volume.

Zero Slippage Leverage Trading — GMX

GMX once again marks its name on the list by not only providing an interface as simple and intuitive as that of centralized exchanges. A killer feature of GMX is its oracle-based pricing model that allows 0 slippage leverage trades by utilizing the GLP liquidity to always execute 100% of the order at a single price of the oracle. Essentially, the entire liquidity of GLP served as one huge counter-side liquidity for market orders. Traders were able to find better pricing and price impact on GMX even when compared to centralized exchanges, both when entering and exiting a position.

AMMs Built on Performant Protocols — PancakeSwap, Osmosis

The creation of BSC and Tendermint changed the paradigm for the notion of “DeFi is slow and expensive”. PancakeSwap and Osmosis utilized these protocols to each build a DEX that was fast and cheap. These two platforms lowered the barrier to entry to the DeFi ecosystem, allowing the retail to participate even with small amounts of capital with affordable gas costs.

However, both protocols are slowly losing their market shares — PancakeSwap losing its market share in terms of trading volume, which peaked at 33.2% in May 2021 to 13.6% in July 2023, arguably due to the risk of being based on BSC, a chain highly reliant on Binance, and Osmosis from losing its share which peaked at 2.4% in March of 2022 to 0.27% in July 2023, arguably due to the collapse of UST, which served as the de facto stablecoin on Osmosis.

Conclusion

The demand for, and the market share of DEXs have grown exponentially by offering solutions that were unsolvable within centralized systems such as single point of failure, exposure to misappropriation, and hacks. In a short time, the DEX landscape has evolved from offering simple swaps to supporting advanced financial primitives such as futures products and leveraged trading.

The movements to regulate crypto and centralized exchanges are becoming more and more active, stimulating the flight of traders from CEXs to DEXs, which can be seen from the increasing trading volume share of DEXs. Data seems to indicate that an optimistic future lies ahead for DeFi.

TVL Dominance by Language | Source: DeFiLlama

So far, DeFi protocols utilizing the EVM and Solidity are dominating the market, monopolizing over 95% of the share. However, there is clear room for improvement here. The limits of the EVM and Solidity were explored in Episode 3 of our blog, which are potential setbacks to achieving mass adoption of DeFi.

At Gnoswap, we’ve identified this as an opportunity and are aiming to remove this inefficiency of the market by building a next-generation CLMM DEX that leverages the powerful tech stack brought upon by Gnoland.

Stay tuned for our next blog, where we will explore the breakthroughs and unique design choices of Gnoswap.

--

--

Gnoswap

Gnoswap is the first open-source AMM Dex built by Onbloc using #Gnolang to offer a simplified concentrated-LP experience for increased capital efficiency.