How We Calculate Execution Costs
Real World Perps compares execution costs across multiple perpetual DEXs in real-time. This documentation explains our methodology and how each exchange calculates fees and slippage.
Overview
When you trade perpetual contracts, your total execution cost comes from several sources: trading fees, slippage (the difference between expected and actual price), and spread (the gap between buy and sell prices).
Different exchanges use different pricing models. Some use traditional order books where your order walks through available liquidity. Others use oracle-based pricing where you trade against a pool at oracle prices plus a spread.
We fetch real-time data from each exchange and calculate what your actual cost would be for a given trade size, direction, and asset.
How It Works
For every comparison, we query each exchange's API to get current order book depth, fee rates, and spread information. We then simulate executing your trade to calculate the total cost.
Real-Time Data
All calculations use live data. Prices, fees, and liquidity are fetched fresh for each comparison. Data auto-refreshes every 10 seconds.
The Calculation Process
- Fetch current order book or oracle prices from each exchange
- Query each exchange's fee API for your specific fee tier
- Simulate walking through the order book (for order book exchanges)
- Calculate spread costs (for oracle-based exchanges)
- Sum up all costs and convert to basis points
- Identify the lowest-cost venue
Cost Breakdown
Every trade has costs on both sides — opening and closing your position. We calculate the round-trip cost so you can compare apples to apples.
Total Cost Formula
total_cost_bps = opening_slippage + closing_slippage + open_fee + close_feeUSD Cost = (order_size × total_cost_bps) ÷ 10,000
What is a Basis Point?
A basis point (bps) is one hundredth of a percent (0.01%). So 10 bps equals 0.10%. For a $100,000 trade at 10 bps, your cost would be $10.
Opening vs Closing Costs
Opening costs occur when you enter a position. For a long trade, you're buying — so you pay the ask price (or walk up the ask side of the order book).
Closing costs occur when you exit. For a long trade, you're selling — so you receive the bid price (or walk down the bid side).
Supported Exchanges
We currently support eight perpetual DEXs, each with different pricing models and fee structures. Understanding these differences helps you choose the best venue for your trade.
Order Book Exchanges
Your order walks through available liquidity. Slippage depends on order book depth.
Oracle-Based Exchanges
Trade against a pool at oracle prices. Cost comes from spread, not order book depth.
Hyperliquid
Order BookHyperliquid is an L1 blockchain built specifically for perpetual trading. RWA assets trade on the xyz sub-market with symbols like xyz:GOLD and xyz:EUR.
How Slippage is Calculated
We fetch the order book at maximum precision and simulate your order walking through each price level. The average execution price compared to the mid-price gives us the slippage in basis points.
Fee Structure
Hyperliquid fees are dynamic and depend on several factors:
- Base rate — fetched from the userFees API
- Deployer fee scale — a multiplier set by the xyz market
- Growth mode — when enabled, fees are reduced by 90%
Growth Mode Discount
When growth mode is active on an asset, fees are reduced to just 10% of the normal rate. This can make Hyperliquid significantly cheaper during promotional periods.
Lighter
Order BookLighter runs on ZK-Lighter (Elliot mainnet), a zero-knowledge rollup designed for high-performance trading. Each asset has a specific market ID.
How Slippage is Calculated
Same order book walking method as Hyperliquid. We fetch up to 250 price levels and simulate your order execution.
Fee Structure
Fees are fetched from the orderBookDetails API. Both taker and maker fees are published on-chain. Currently, many markets have 0 bps taker fees as a promotional measure.
Aster
Order BookAster uses a Binance-compatible API structure. It's a centralized-style DEX with deep order books for popular assets.
How Slippage is Calculated
We fetch up to 1,000 order book levels and walk through them to calculate your average execution price.
Fee Structure
Fees are fetched via authenticated API calls. The commission rate typically ranges from 2-5 bps depending on your fee tier.
Avantis
Oracle-BasedAvantis is an oracle-based perpetuals protocol on Base. Unlike order book exchanges, you trade against a liquidity pool at oracle prices.
How Spread is Calculated
Spread can be either dynamic or static depending on the asset. Dynamic spreads are fetched from Avantis's risk API and scale with position size.
One-Way Spread
Avantis is unique — spread only applies when opening a position, not when closing. This means the spread cost is half what it would be on other oracle-based exchanges.
Fee Structure
Opening fees are skew-adjusted. If the pool is heavily skewed (e.g., many more longs than shorts), going with the majority costs more. This incentivizes balanced open interest.
Closing fees are a flat rate specific to each asset.
Liquidity Limits
Each asset has a maximum position size (maxWalletOI). If your order exceeds this, we mark it as a partial fill.
Ostium
Oracle-BasedOstium specializes in real-world asset perpetuals. They use their own price feed that provides bid, ask, and mid prices directly.
How Spread is Calculated
For assets with dynamic pricing, spread combines the market spread (bid-ask gap) with a volume-based component. Recent trading activity affects the spread — high volume leads to wider spreads.
The volume impact decays over time using a mathematical formula, so old trades have less effect than recent ones.
Fee Structure
Fees come from the pairs API and may be overridden during promotional seasons. Notably, Ostium charges no closing fee — you only pay when opening.
Extended
Order BookExtended runs on Starknet, a validity rollup on Ethereum. It offers order book trading for select RWA pairs.
How Slippage is Calculated
Same order book methodology as other CLOB exchanges. We fetch the full order book and simulate your execution.
Fee Structure
Fees are fetched via authenticated API calls. Both maker and taker rates are returned per market.
EdgeX
Order BookEdgeX is a high-performance perpetual DEX with order book-based trading. It offers deep liquidity for popular RWA pairs.
How Slippage is Calculated
Same order book methodology as other CLOB exchanges. We fetch the full order book and simulate your execution to calculate slippage.
Fee Structure
Fees are fetched via API. Both maker and taker rates are returned per market.
GRVT
Order BookGRVT (Gravity) is an institutional-grade perpetual DEX with order book trading. It focuses on deep liquidity and low-latency execution.
How Slippage is Calculated
Same order book methodology as other CLOB exchanges. We fetch the full order book and simulate your execution to calculate slippage.
Fee Structure
Fees are fetched via API. Both maker and taker rates are returned per market.
Exchange Comparison
Here's a side-by-side comparison of how each exchange handles pricing and fees:
| Feature | Hyperliquid | Lighter | Aster | Avantis | Ostium | Extended | EdgeX | GRVT |
|---|---|---|---|---|---|---|---|---|
| Pricing Model | Order Book | Order Book | Order Book | Oracle | Oracle | Order Book | Order Book | Order Book |
| Spread Applied | 2× (round trip) | 2× (round trip) | 2× (round trip) | 1× (open only) | 2× (round trip) | 2× (round trip) | 2× (round trip) | 2× (round trip) |
| Close Fee | = Open fee | = Open fee | = Open fee | Separate rate | 0 (no fee) | = Open fee | = Open fee | = Open fee |
| Fee Discounts | Growth mode (90% off) | — | — | — | Season overrides | — | — | — |
| Liquidity Check | Book depth | Book depth | Book depth | Max position cap | Always filled | Book depth | Book depth | Book depth |
Supported Assets
Not every exchange lists every asset. Here's what's available where:
| Asset | Hyperliquid | Lighter | Aster | Avantis | Ostium | Extended | EdgeX | GRVT |
|---|---|---|---|---|---|---|---|---|
| Gold (XAU) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Silver (XAG) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| WTI Crude Oil | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — |
| Brent Crude Oil | ✓ | ✓ | — | ✓ | ✓ | ✓ | — | — |
| EUR/USD | ✓ | ✓ | — | ✓ | ✓ | ✓ | — | — |
| GBP/USD | ✓ | ✓ | — | ✓ | ✓ | — | — | — |
| USD/JPY | ✓ | ✓ | — | ✓ | ✓ | ✓ | — | — |
| Apple (AAPL) | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — |
| Microsoft (MSFT) | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — |
| Google (GOOG) | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — |
| Amazon (AMZN) | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | ✓ |
| Meta (META) | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — |
| Nvidia (NVDA) | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | — |
| Tesla (TSLA) | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | ✓ |
| S&P 500 (SPY) | — | ✓ | — | ✓ | ✓ | — | — | — |
| Nasdaq 100 (QQQ) | — | ✓ | ✓ | ✓ | ✓ | — | — | — |
| Coinbase (COIN) | ✓ | ✓ | ✓ | ✓ | ✓ | — | — | ✓ |
A dash means the exchange doesn't list that asset and won't appear in comparisons for it.
Questions? Reach out on Twitter or Discord.
← Back to comparison tool