Perpetual + Uniswap

  • Updated

What is the deal with Perpetual Protocol and Uniswap?

Key points:

  1. There is no partnership between Perpetual Protocol and Uniswap. We built on top of Uniswap v3 smart contracts permissionlessly.
  2. All operations with Uniswap v3 pools holding perpetual tokens must be performed via the protocol clearinghouse. You cannot add or remove liquidity, or swap tokens directly via Uniswap smart contracts.
  3. Liquidity on Perpetual Protocol does not depend on Uniswap liquidity. There can be a small amount of liquidity on Uniswap v3's regular pools, and a huge amount of liquidity for the same asset in the perpetual token pool.
  4. Perpetual Protocol only offers cash settled perpetuals—these are derivatives; you cannot swap for real assets or withdraw the real asset; you cannot provide liquidity in the real asset as a maker. All settlement and liquidity provision is in USDC.

The following is a discussion of why and how we build on top of Uniswap.

Money lego

Perpetual Protocol Curie (v2) permissionlessly builds on top of Uniswap v3, using Uniswap's on-chain infrastructure as a key component of the protocol. This is done to solve a major bottleneck in v1—static liquidity. In addition, building on Uniswap v3 allows Perpetual Protocol to create markets with concentrated liquidity without reinventing the wheel, and makes it easy for partners familiar with Uniswap to integrate with and build on Perpetual Protocol. Classic money lego.

Trading engine

Perpetual Protocol uses Uniswap v3 as a trading engine, so all trades occur on Uni v3, mediated by the Perpetual Protocol clearinghouse. From a trader's perspective, you will trade on Perpetual Protocol, while under the hood actual token swaps are seamlessly happening in Uniswap pools.

Dynamic liquidity

Perpetual Protocol v1 used static, fixed liquidity for each market, and its design made implementing dynamic liquidity very challenging. V2 allows dynamic liquidity by introducing makers (LPs). This means liquidity is provided by dynamic actors who can be responsive to market conditions, ie. place their liquidity in price ranges corresponding to their read of the market. This create a much more stable and sustainable system overall.

Learn more

Quote vs base asset

Fee application

Fees are applied to the amount of quote token returned by Uniswap in order to account for incomplete swaps, slippage etc.

Customized fee tier

The Perpetual Protocol clearinghouse design allows for more fee tiers than currently offered by Uniswap.

Uniswap protocol fee

If Uniswap governance votes to activate a protocol fee, this can be handled via accounting in the protocol clearinghouse.

For example, if the Uniswap protocol fee is 0.05%, the clearinghouse will mint an additional 0.05% of quote token for each trade to be provided to Uniswap.

Since quote tokens on Perpetual Protocol have zero market value or utility, there is no loss to Perpetual Protocol.

Liquidity frontrunning

A known issue with Uniswap v3 reported by Chainsight Analytics (and earlier) is 'just-in-time' liquidity from MEV bots used to add and remove liquidity within a single block. This is in essence a sandwich attack and can also affect Perpetual Protocol in its current form.