The Evolution of DeFi Trading

Uniwhale Exchange
Uniwhale
Published in
5 min readNov 18, 2022

Part 1

Version 0.0:

Uniswap was deployed to the Ethereum mainnet in Nov 2018, which created a new era of Defi from zero to one. It enabled non-custodial on-chain spot trading by using a constant product formula (x * y = c), which not only is mathematically elegant but also simple enough for any user to trade trustlessly. The protocol was permissionless, which opened the door for many projects to list their tokens. However, despite the simple and elegant design, users experienced issues like 1) significant slippage, 2) exposure to risk-free front running, and 3) high Impermanent Loss. Hence many projects try to address these issues using different approaches.

Version 1.0:

Curve came into the picture, which uses a combination of constant sum (x + y = c) and constant product to offer a highly efficient way to exchange tokens while maintaining low fees and low slippage by only accommodating liquidity pools made up of correlated assets. But like Uniswap V3 (see below), it only solved the liquidity issue of stable pairs. Non-correlated pairs are not popular on Curve.

Uniswap V3 also tried to solve its own issues. It uses concentrated liquidity to allow LPs to allocate their assets in a custom price range to reduce impermanent loss. However, Uniswap V3 is much more complicated than V2 for LPs. At the same time, although it subsequently dominated with 98% of the overall trading volume of stablecoin pairs on Uniswap, V2 has dominated the overall number of trades, accounting for 68% of the total trading volume, especially for long-tail assets.

Part 2

The emergence of Defi summer led by Maker, Uniswap, Compound, and the like has resulted in a large volume of spot transactions being migrated to on-chain trading, and DeFi users are also looking forward to derivatives being introduced to decentralized exchanges. Last year we saw the emergence of the new Layer 1s. The gas fee of these new layer 1s was much cheaper than that of the Ethereum mainnet, which greatly reduced the cost of leveraged trades and provided the basis for the emergence of derivatives on-chain. However, the on-chain leveraged trading did not explode on the same scale as the spot trading in DeFi summer last year, mainly because:

  • Insufficient liquidity to support large-value trades, making it difficult for institutions to participate, resulting in mainly a retail market;
  • Much of the spot DEX trading volume consists of demands for long-tail assets. These long-tail assets fluctuate greatly and are not suitable for leveraged trading. Therefore, leveraged trading lacks long-tail trading demand;
  • Many of these new Layer 1s are relatively centralized, and there are certain security risks when transacting large-cap assets such as BTC and ETH on the new L1s.

Over this summer, we started to see more derivatives/perp trading DeFi platforms introducing different approaches to address the above issues.

Version 2.0: DYDX — Central Limit Order Book

DYDX built on L2 protocol StarkWare, uses an order book model for trading, hence the trading experience is similar to CEX, and the funding rate mechanism is used to balance naked positions. The entire transaction process is not on-chain but executed off-chain, and is only on-chain when funds are transferred in and out of the margin account. It introduced professional market makers to enhance liquidity. The entire transaction process is a three-party game process between market makers and long and short traders.

Version 2.1: Perp — vAMM Order Book

Perpetual Protocol is a decentralized perpetual trading protocol built on L2 protocol Optimism. In the V1 version, the protocol uses virtual AMM (vAMM) to price. vAMM does not store real assets but is convenient for liquidation. When trading, virtual assets are minted in vAMM. If you open a long position with 10x leverage at 100 USDC, 1000 vUSDC will be minted and deposited into vAMM. A funding rate mechanism is used to balance naked positions. Since the K value setting in the V1 version significantly impacts the pricing results, in the V2 version, vAMM is abandoned and the AMM mechanism of Uniswap V3 is adopted. When the user deposits funds to provide liquidity, the funds will be deposited into the vault, and a group of LPs will mint into Uniswap V3; when the user trades, the margin will be deposited into the vault, and vUSD will be minted and traded in Uniswap V3. The entire transaction process is a game process between AMM’s LP and the long and short sides.

Version 2.2: GMX — Single Liquidity Order Book

GMX is a spot and perpetual trading protocol deployed on the L2 protocol Arbitrum, which currently supports up to 30x leveraged trading. The counterparty of all transactions is the GLP pool. The GLP pool is a multi-token pool composed of BTC, ETH, USD, and other mainstream (large-cap) tokens (mainly stablecoins) in specific weighting. Users deposits those tokens and mint GLP tokens to start market making. There is no concept of impermanent loss. Since the counterparty of all trades is the GLP pool, this is a zero-sum game between LP and traders: the traders’ profit and losses will be directly transferred from/to GLP (resulting in a price increase/decrease of GLP). Since the order book and AMM are not used, there is no problem of price slippage, and there is no need to balance long and short positions through funding fees. The price of opening and closing positions is provided by the keeper or oracles.

Pros & Cons of the 3 different types of order books:

Part 3: Uniwhale

We see on-chain trading evolving from a simple constant product formula to concentrated liquidity, to more efficient leveraged trading. All the efforts are looking to address the following three issues:

  1. Zero Credit Risk: full ownership and control of your assets
  2. Deeper Liquidity: trades with higher leverage, but with lower slippage cost
  3. Safer Liquidity Provision: enables retails to participate in liquidity provision, earning from marketing making like a pro, but at the same time, lower impermanent loss

Uniwhale addresses all above and more:

  • Allows perpetual trading with up to 200X leverage on several pairs, relying on our special oracle aggregator design and strict risk management models;
  • Enables the lower risk of liquidation. Uniwhale aggregates multiple oracles to protect positions from harmful candle wicks;
  • Provides deeper liquidity which lowers transaction costs and slippage;
  • Encourages anyone to be a liquidity provider by providing stablecoins liquidity to the vault, which avoids impermanent loss and produces passive market-making yield;
  • Provides NFT-based trading bots to allow anyone to enjoy the fees earned from liquidation as well as systematic trading strategies;
  • Enables full ownership and control of your wallets and assets.

Liquidity aggregation across multiple chains is something we are working on, and we will introduce it soon in the future!

To get involved and to stay updated on all Uniwhale related matters:

--

--

Uniwhale Exchange
Uniwhale

Decentralized Leveraged Trading. Trade BTC, ETH, and more with up to 200x leverage. Low fees. No scam wicks. Join the Community: http://linktr.ee/uniwhale