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 a simulated order book where slippage is derived from an oracle price and a dynamic spread parameter.
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 simulated order book 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.
Simulated Order Book
Trade against oracle prices with a dynamic spread. Slippage is modelled from the spread parameter rather than real 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
Simulated Order BookAvantis is a perpetuals protocol on Base that uses a simulated order book model. Instead of resting limit orders, prices are derived from an oracle with a dynamic spread that acts as synthetic slippage.
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 simulated order book 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
Simulated Order BookOstium 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.
Slippage Calculation
How slippage is computed depends on the exchange's pricing model. We treat CLOB and simulated order book venues differently.
Order Book Exchanges (CLOB)
For Hyperliquid, Lighter, Aster, Extended, EdgeX, and GRVT we fetch the full order book and simulate walking through it level by level until the full notional is filled.
CLOB Slippage Formula
weighted_fill = Σ (level_price × level_size) / total_size
slippage_bps = |weighted_fill − mid_price| / mid_price × 10,000Both opening and closing slippage are calculated this way. Closing slippage uses the opposite side of the book (bids for a long exit, asks for a short exit).
Simulated Order Book (Avantis & Ostium)
Avantis and Ostium use a simulated order book model — there is no real resting order book. These venues publish a spread parameter that represents how much the execution price deviates from the oracle price. We use this spread as the synthetic slippage component for both opening and closing legs.
Insufficient Liquidity
For CLOB exchanges, if the order book does not have enough resting orders to fill the full requested size, the venue is marked Insufficient Liquidity and excluded from the best-execution ranking. For Avantis and Ostium, a protocol-published maximum position size cap is used instead.
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 | Simulated OB | Simulated OB | 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 | No close fee | = Open fee | = Open fee | = Open fee |
| Fee Discounts | Growth mode | — | — | — | Season overrides | — | — | — |
| Liquidity Check | Book depth | Book depth | Book depth | Position cap | Position cap | 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.
Limitations
Our methodology is designed to be as accurate as possible, but there are factors we do not currently account for:
- Gas / network fees — on-chain transaction costs are not included. These vary by network and are typically small relative to position size but non-zero.
- Volume-based fee tiers — high-volume traders may qualify for reduced taker fees not reflected in our default-tier calculations.
- Partial fills — we assume orders fill in full. In thin markets, a partial fill may result in a different effective cost.
- Market impact during execution — submitting a large order can move the market before it settles, especially on CLOB venues.
- Holding / funding fees — ongoing position costs (funding rates, margin fees) are not included in the round-trip cost figure as they are duration-dependent and vary continuously.
- Counterparty and smart contract risk — we compare execution cost only; protocol security and counterparty risk are outside the scope of this tool.
Questions? Reach out on Twitter or Discord.
← Back to comparison tool