Are DeFi Perpetual Futures More Expensive than their CeFi Counterparts?

DeFi trading is often associated with high costs compared to CeFi. With the implosions of various CeFi Crypto Trading platforms in 2022, DeFi has re-gained attention due to in-built self-custody and transparency. We compare costs for trading a 100 ETH position in Perpetual Futures on different exchanges and conclude that DeFi Perpetuals trading must not come with high costs.

D8X Exchange
11 min readNov 23, 2022

In their recent study “On The Quality Of Cryptocurrency Markets”, Barbon and Ranaldo [1] find that DeFi spot trading comes with high transaction costs that is to be traded-off against the risks and latency associated with delegated custody on CEXs. However, is this a necessary trade-off for perpetual futures?

Sources of Costs

Costs of trading perpetual futures can be decomposed into different components: trading fees, gas fees, slippage, and holding costs.

  • Trading fees. These fees occur at every point of transaction when traders buy or sell perpetual futures. Usually trading fees are a constant fraction of the notional position size. The notional position size is also termed “contract size”, for example, if you are trading 2 ETH long with a margin of 1000 USDC, the notional position size is 2 ETH (the margin is irrelevant for the trading fee).
  • Gas fees. On decentralized exchanges, trading transactions come with gas fees that differ between Blockchains and smart contract code. For most Blockchains gas costs also depend on the state of the network. Gas fees are usually paid in the underlying currency of the Blockchain. Gas costs do not depend on the position size. There are no gas fees for CEXs.
  • Slippage. Slippage is the difference between the (mid-) price and the price you get when you trade. The larger your position, the higher the slippage for a given exchange and time. Some DeFi protocols differentiate the terminology and use price impact as the expected price deviation and slippage as the unexpected deviation from mid-price (e.g., due to limit orders being cancelled or other traders entering before). Using this terminology we only consider price impact in this article.
    Example: In order-book systems, like the perpetuals exchange on Binance, the mid-price is the average between the best bid-price (the price you get when you sell via market order), and the best ask-price (the price you get when you buy via market order). Figure 1 shows a screen-shot of an order-book on Binance for ETH Perpetuals. We can see that the best ask lies at $1,098.63 and the best bid at $1,098.62. If we buy no more than 263.0731 ETH, we would get the best ask price for our trade, unless another trader gets executed before us or the limit order at this price is cancelled. If we trade more than that amount, the price is slightly worse. This worsening of the price compared to the mid-price is called slippage.
  • Holding Costs. Perpetual Futures usually feature a funding rate. The funding rate is often an 8-hour rate that is paid from the long to the short if there is more demand for long positions than short, and from the short to the long if there is more demand for the short position. This is the design of the classic perpetual as introduce by BitMex [2] in 2016. Historically, most of the time the short gets paid from the long a rate of about 1 basis point (0.01%) per eight hours. However, some DeFi protocols such as GMX [3] deviate from this and charge a “borrowing rate” to both the long and the short, quoted as a one-hour rate (meaning that 0.01% would be 8-times that compared to the BitMEX convention). This can lead to significant holding costs. On Gains Network [4], a “rollover rate” is imposed on the collateral, and is used in combination with funding rates.
Figure 1: Order-Book on Binance.

The Contenders

In this section, we detail how we collect and compare data. We use Binance as our representative centralized exchange. Binance is ranked as the largest exchange in terms of trading volume at the time of writing and features low fees, even compared to other centralized exchanges. For decentralized exchanges, we collect data from GMX [3], Gains Network [4], Perpetual Protocol [5] and dYdX [6]. We compare these results to our own D8X perpetuals. Since, at the time of writing, D8X perpetuals are not on Mainnet, we use an agent-based simulation together with our intended highest cost-tier to determine all the cost components.

dYdX is the only decentralized exchange in our selection that uses an order-book, as opposed to an automated market maker (AMM). Although non-custodial, dYdX’s current implementation with StarkWare has off-chain order-books and is bottle-necked through a single centralized sequencer, see Blogmates [7], eliminating some the usual DeFi advantages.

An AMM based protocol such as Perpetual Protocol, Gains Network, and GMX, use a pricing function to determine the trading price. Every trader trades with the “liquidity pool” through the AMM’s pricing function. The liquidity pool allows anyone to contribute tokens (often a form of USD token such as DAI or USDC) to the protocol and participate in the AMM profit and loss.

GMX pricing function differs from the other protocols in that there is zero slippage. This can lead to possible exploits in some cases, see Joshua Lim [8], but leads to lower costs for the trader. The lower costs due to the elimination of slippage is compensated with borrowing rates that are charged to both the short and the long (unlike funding rates).

Gains Network charge funding rates and borrowing rates. Gains Network uses a linear pricing approach. That is, Gains adds a spread to the index price and linearly worsens the price with trade size, see Gains Network, “gTrade v6.1: In-depth” [9].

Perpetual Protocol offer classic perpetuals that pay funding rates peer-to-peer (from long to short or vice versa). In V2, the protocol borrows the pricing function from Uniswap v3’s concentrated liquidity AMM, see [10]. Thereby Perpetual Protocol V2 inherits the slippage from Uniswap V3.

D8X also offer classic perpetuals that pay funding rates peer-to-peer. D8X differs substantially in their pricing approach. D8X uses a derivative pricing approach in which the AMM sets prices so that traders are incentivized to minimize the AMM risk. For example, if there are an equal amount of long and short in a given perpetual, and there is sufficient liquidity, then the risk for the AMM making a loss due to price movements is very low. In this case, slippage will be very low. If instead, there are more long than short, then the D8X AMM will offer better prices for traders that short and thereby decrease the AMM market exposure, and will offer substantially higher prices and slippage for traders that enter long positions. Compared to Perpetual Protocol and Gains, this leads to much better price impacts in benign times, and prices that can be arbitraged when supply and demand differ substantially.

Data

Our goal is to estimate the price of a 100 ETH trade with a holding period of 8 hours. In this section, we detail our data-collection process and how we determine the slippage.

Trading Fee Data

Trading fee data has been collected directly from the documentation of the different exchanges in our sample (see [11], [12], [13], [14] and [15]). If exchanges offer trading-fee rebate options, we use the fee data for the lowest tier (i.e., a “regular user”). If exchanges differentiate between taker and maker fees, we use the taker fee.

Slippage Data

Slippage data has been collected in October and November 2022. The collection approach differs by exchange and is described below.

Collecting Order-Book Slippage Data: Binance and dYdX

For the two order-book based exchanges in our sample, dYdX and Binance, we collect order-books via their REST APIs. Our Python code downloads the order books every minute and aggregates the data in a PostgreSQL database. We then calculate the average price for each order-book observation for a long and a short trade of size 100 ETH. Averaging all the result gives the final slippage number.

Binance
1556 observations on Oct 30 and 31, 2022,
mean long slippage 0.50bps, 0.56bps std deviation
mean short slippage 0.53bps, 0.61bps std deviation
Figure 2 visualizes the data using histograms.

Figure 3: Slippage on Binance. On average on Oct 30 and 31, 2022 a 100 ETH trade would lead to a slippage of about 1 bps. The maximum observed lies at 12bps on level 50 of the order book. In two occasions level 50 was not enough to support a 100 ETH trade.

dYdX
799 observations on Oct 31, 2022,
mean long slippage 1.87bps, 0.61bps std deviation
mean short slippage 1.76bps, 0.69bps std deviation
Figure 3 visualizes the data using histograms.

Figure 3: Slippage on dYdX. On average on Oct 31, 2022 a 100 ETH trade would lead to a slippage of about 2 bps. The maximum observed lies at 11bps for the 799 order-books observed.

Collecting AMM Slippage Data: Perpetual Protocol, Gains Network and GMX

For the two AMM-based exchanges in our sample that have slippage (Perpetual Protocol and Gains Network) we collected the data directly from the DApps of the protocols. GMX imposes zero slippage by design.

Perpetual Protocol

We collect the total USD amount to be paid for opening a 100 ETH position from the DApp. We derive the implied price offered by the AMM and compute the percentage difference between the (mid-) price and the price we got for the 100 ETH trade. We collected 3 observations on Oct 30, 2022,
and observed a mean slippage of 54.41bps.

Gains Network

We set the total DAI amount to be paid to obtain a position of 100 ETH with 10x leverage, and retrieve the price impact directly from the Gains DApp. We collected observations on Nov 5th, 2022 and Nov 22nd, 2022, and observed a mean slippage of 18 bps.

Collecting D8X Slippage Data: Agent-based Simulations

The simulation mimics the D8X AMM. Perpetual index prices are taken from historical data for the corresponding perpetual. The agents involved are liquidity providers and traders. Liquidity providers randomly add funds to the system. Liquidity providers remove funds after a deterministic holding period. Traders have randomized individual trading preferences with respect to their cash holdings, leverage choices, long/short choices, trading frequency and they have different strategies. The strategies are momentum trading, noise trading (essentially not a strategy), and arbitrage traders that compare the perpetual prices to the index when deciding whether to trade.

We parameterize the simulation so that there is a growing number of traders over time and simulate up to 1,000 traders by the end of one quarter. Finally, we pick a benign period, comparable to the ones assessed for the contenders, and average the slippage.

Holding Cost Data

For exchanges that employ classic funding rates, we assume a 1 basis point funding rate per 8 hours.

GMX, instead of imposing a funding rate, imposes a borrow rate that accounts for the entirety of the holding costs. We average historical borrowing rates from Aug 30, 2022 to Oct 30, 2022 and arrive at 0.32 bps/hour.

For Gains Network we observed rollover fees on Nov 5th, 2022 and Nov 22nd, 2022, which averaged 0.86 bps. These are applied on the collateral deposit instead of the notional, and therefore, at 10x leverage, they correspond roughly to 0.09 bps applied hourly on the position size. Those rollover fees are added to the funding rate, which we assume to be at 1 basis point per 8 hours in line with other exchanges that impose a funding rate, leading to holding costs of 0.215 bps per hour.

Gas Fee Data

There are no gas fees on CEXs, including Binance. Executing trades on dYdX does also not involve any gas fees [16].

For other DEXs we collected the gas fee data from Dune Analytics:

  • Perpetual protocol: average gas fee between Oct, 22 2022 and Nov, 11 2022: $0.12 (see [17])
  • GMX: average gas fee between Oct, 22 2022 and Nov, 11 2022: $0.11 (see [18])
  • Gains Network: we could not identify a reliable data source that specifically tracks gas fees related to executing trades. Given Gains Network runs on Polygon, we assume that gas fees are comparable to the ones for D8X
  • D8X‘s average gas fee based on Testnet data collected between Nov, 11 2022 and Nov, 22 2022 amounts to $0.0015

The observed gas fees are negligible given the 100 ETH position size, we exclude them from our analysis going forward.

Results

Figure 4 shows that total trading costs vary substantially, ranging from up to 129bps (=1.29%) to 11bps.

Figure 4: Trading cost
  • For the AMM-based exchanges Perpetual Protocol and Gains Network, total trading costs reach 129bps and 53bps respectively. The largest part of those costs are linked to the high slippage a trader faces. The high slippage is a result of the pricing approach the AMM uses.
  • For GMX, trading costs are still high (22bps), and more importantly increase substantially the longer a trader holds a position. While high holding costs might not impact a speculative trader that flips a position short-term, they do impact (institutional) investors that want to use perpetual futures for hedging purposes.
  • For dYdX total trading costs are lower (15bps) compared to AMM-based DEXs. This result is mainly explained by the relatively low slippage, which dYdX achieves through its order-book. Note however that the order book is off-chain.
  • Compared to the DEXs discussed above, CEXs offer lower fees. Figure 4 shows that Binance imposes 11 bps trading costs. The largest part of those trading costs are due to fixed trading fees. Because unlike AMM-based DEXs, CEXs do not make money from slippage, fixed trading fees are often their main income used to maintain their services.
  • D8X offers low fees that compete with Binance and is at the same time fully decentralized and non-custodial. Out of the covered exchanges, based on our study, D8X offers the best trading conditions across DeFi and CeFi.

To learn how D8X can offer these competitive prices, stay tuned to check out our intro to D8X perpetuals that will be released shortly.

References

[1] Barbon, Andrea, and Angelo Ranaldo. “On The Quality Of Cryptocurrency Markets: Centralized Versus Decentralized Exchanges.” https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3984897
[2] BitMEX, “Perpetual Contracts Guide”, https://www.bitmex.com/app/perpetualContractsGuide
[3] GMX, “Decentralized Perpetual Exchange”, https://gmx.io/#/
[4] Gains Network, “Rollover & Funding Fees”, https://gains-network.gitbook.io/docs-home/gtrade-leveraged-trading/fees-and-spread#rollover-and-funding-fees
[5] Perpetual Protocol, “Perpetual Protocol”, https://perp.com/
[6] dYdX, https://dydx.exchange/
[7] Blogmates, “What is dyDx, the DYDX Token & dYdX Chain?”, https://blocmates.com/blogmates/what-is-dydx-dydx-token-and-the-dydx-chain/
[8] Joshua Lim, “
Quick thread on the GMX ‘exploit’ last night” https://twitter.com/joshua_j_lim/status/1571554171395923968?lang=en
[9] Gains Network, “gTrade v6.1: In-depth”, https://medium.com/gains-network/gtrade-v6-1-in-depth-b06c0b93fad1
[10] Perpetual Protocol, “How Perp V2 Works”, https://support.perp.com/hc/en-us/articles/9594157347481-How-It-Works
[11] Perpetual Protocol, “Trading Fees and Gas Fees”, https://support.perp.com/hc/en-us/articles/5257683596313-Trading-Fees-and-Gas-Fees
[12] GMX, “Trading”, https://gmxio.gitbook.io/gmx/trading
[13] Binance, “Trading Fees”, https://www.binance.com/en/fee/futureFee [14] dYdX, “Fees”, https://trade.dydx.exchange/portfolio/fees
[15] Gains Network, “Low trading fees”, https://gains-network.gitbook.io/docs-home/gtrade-leveraged-trading/overview#low-trading-fees
[16] dYdX, “Perpetual Order Types”, https://help.dydx.exchange/en/articles/4797992-perpetual-order-types
[17] Dune, “Avg OP Gas Fee — Last 30 Days”, https://dune.com/queries/362001/689431
[18] Dune, “Cost-of-transactions-on-gmx-arbitrum”, https://dune.com/queries/1095373/1873852

IMPORTANT INFORMATION

This content does not constitute an offer to sell, a solicitation of an offer to buy, or a recommendation of any security or any other product (token) or service regardless of whether such security, product (token) or service is referenced in this brochure.

Furthermore, nothing in this content is intended to provide tax, legal, or investment advice and nothing in this content should be construed as a recommendation to buy, sell, or hold any investment or security or to engage in any investment strategy or transaction. The securities, products, or services discussed in this content are not represented as being suitable for any particular investor.

You are solely responsible for determining whether any investment, investment strategy, security or related transaction is appropriate for you based on your personal investment objectives, financial circumstances and risk tolerance. You should consult your business advisor, legal advisors (attorneys), or tax and accounting advisor regarding your specific business, legal or tax situation.

NEITHER THIS CONTENT NOR ANY COPY THEREOF MAY BE SENT, TAKEN INTO OR DISTRIBUTED TO THE UNITED STATES OR TO ANY US PERSON.

--

--