← Back to blog

Published on Sat Aug 22 2026 00:00:00 GMT+0000 (Coordinated Universal Time) by Jacob Cavazos

When someone asks what a swap costs on a decentralized exchange, the answer usually starts with a number. “0.3% fee.” That number is the most visible part of the cost, and it is also the least complete.

Execution cost is the total economic distance between the token you start with and the token you end up with. It is everything you give up to make the trade happen. If you swap 1,000 USDC for ETH and end up with less ETH than the market price implied, the gap is your execution cost. That gap is made up of several components, most of which never appear on the trade confirmation screen.

This article breaks down the six components that make up execution cost in DEX trading, how to measure each one, and why the advertised fee is a misleading anchor for understanding what you actually pay.

The Problem With Advertised Fees

Every liquidity pool has a fee tier. Uniswap v3 pools offer 0.01%, 0.05%, 0.3%, and 1% tiers. Other DEXs advertise similar numbers. These fees are real, and they are charged on the input amount of every swap. But they are only one piece of the total cost.

The advertised fee tells you what the liquidity providers take. It says nothing about what the interface charges, what the network charges, what you lose to slippage, what MEV extractors take, or what happens to any surplus generated during routing. A swap with a 0.05% pool fee can easily cost 1% or more in total execution cost once everything else is included.

This is why comparing DEXs by advertised fee is a category error. It is like comparing airlines by ticket price while ignoring baggage fees, seat selection, and the fact that one airline lands you at an airport 90 minutes from your destination.

The Six Components of Execution Cost

Execution cost in a typical DEX trade breaks down into six components. Some are explicit and visible. Others are implicit and only discoverable after the fact.

1. Pool Fees

This is the advertised fee. It is the percentage taken from the swap input and distributed to liquidity providers in the pool. On concentrated liquidity pools like Uniswap v3, the fee is fixed per pool and charged on every swap regardless of trade size or price impact.

Pool fees are the easiest component to measure. The pool contract reports the fee tier, and it is applied deterministically. If you route through three pools, you pay each pool’s fee on the portion of the trade that passes through it.

The key point: pool fees are a known, fixed cost. They do not vary with market conditions. A 0.3% pool charges 0.3% whether the market is calm or volatile. This makes them the least interesting part of execution cost, even though they are the most discussed.

2. Interface Fees

Many DEX frontends charge an additional fee on top of the pool fee. This is the interface fee, and it is often not clearly disclosed at the moment of trade. The interface fee is taken by the frontend or aggregator you use to submit the transaction, not by the liquidity pool.

Interface fees vary widely. Some frontends charge nothing. Others charge 0.5% or more, deducted from the output amount before it reaches your wallet. Because the fee is taken from the output, it reduces the amount of token you receive, which makes it look like slippage or a bad price unless you know to look for it.

How to measure it: Compare the expected output shown by the interface against the output you would get by interacting with the pool contract directly or through a different interface. The difference, after accounting for pool fees and gas, is the interface fee. Some interfaces disclose this in documentation or settings. Many do not.

3. Gas Costs

Every on-chain transaction costs gas. On Ethereum mainnet, gas can be a significant fraction of trade value for smaller swaps. On L2s like Base, Arbitrum, and Optimism, gas is cheaper but not zero.

Gas is paid in the native token (ETH on Ethereum and Base, ETH on Arbitrum, OP on Optimism). This creates a hidden cost: to swap USDC for a token, you need ETH for gas, which means you need to hold a separate asset just to pay for execution.

Gas cost depends on network congestion, transaction complexity (number of hops in a route), and the gas price at the time of inclusion. A multi-hop route through three pools costs more gas than a direct swap.

How to measure it: The transaction receipt reports gas used and gas price. Multiply them to get the gas cost in wei, then convert to the native token’s dollar value. For comparing execution quality across trades, express gas as a percentage of trade value. A $2 gas cost on a $200 trade is 1%. On a $20,000 trade, it is 0.01%.

4. Slippage and Price Impact

Slippage is the difference between the expected price at the time you submit the transaction and the executed price. It has two sources: price impact and transaction-time market movement.

Price impact is the effect of your trade on the pool’s price. Large trades move the price against you because they deplete one side of the pool. This is a mathematical consequence of the constant product formula and is predictable before execution. The larger your trade relative to pool liquidity, the higher the price impact.

Transaction-time market movement is the change in price between when you submit and when the transaction is mined. In a pending state, your transaction is visible to everyone. If the market moves, your transaction may execute at a worse price than you expected.

Slippage tolerance settings protect you by reverting the transaction if the executed price exceeds your tolerance. But a revert still costs gas, and a tight tolerance means more reverts. A loose tolerance means more slippage when the transaction does execute.

How to measure it: Compare the expected output shown at submission against the actual output received. The difference, after subtracting pool fees and interface fees, is slippage. To separate price impact from market movement, compare your trade size against the pool’s liquidity depth at the time of trade.

5. MEV Extraction

Maximal Extractable Value is value taken by block producers or searchers who can reorder, insert, or censor transactions in a block. In the context of DEX trading, the most common form is sandwich attacks.

A sandwich attack works like this. A searcher sees your pending swap in the mempool — see our guide on what MEV is and how to protect against it for the full range of MEV extraction techniques. They submit a buy transaction ahead of yours, pushing the pool price up. Your transaction executes at the inflated price. Then the searcher sells, capturing the difference. You pay for both legs of their trade through worse execution.

Sandwich attacks are invisible to most users. The transaction succeeds, the output is within the slippage tolerance, and the only sign is that the executed price is worse than expected. The extracted value goes to the searcher, not to you or the liquidity providers.

MEV also includes back-running and arbitrage that can occur immediately after your trade. These do not directly cost you money, but they represent value created by your trade that you do not capture.

How to measure it: Use a tool like EigenPhi, MEV-Inspect, or Flashbots’ dashboards to check whether your transaction was sandwiched. These tools trace the transaction’s position in the block and identify matching buy-sell pairs around it. The extracted amount is the difference between your executed price and the price that would have prevailed without the sandwich.

6. Surplus Retention

Surplus is the difference between the price you were willing to accept and the price you actually got, in your favor. If you set a 1% slippage tolerance and the market moves in your favor by 0.5%, there is 0.5% of surplus. The question is who keeps it.

In a traditional AMM swap, surplus stays with you. You get the better price. But in some execution models, particularly those involving intermediaries like intent-based swap execution, the surplus can be captured by the intermediary rather than passed to the user. This is not always disclosed.

Surplus retention matters because it means the slippage tolerance you set is not just a protection mechanism. It is also a price ceiling. If your tolerance is loose and the intermediary captures the gap between the market price and your tolerance, you lose value even though the transaction appears to succeed within parameters.

How to measure it: Compare the executed price against the market price at the time of execution. If the market price was better than your minimum output but you received exactly your minimum output, the surplus was retained somewhere in the execution path. This is the hardest component to measure because it requires knowing the market price at the exact moment of execution and comparing it against the actual fill — for a rigorous methodology on measuring DEX swap cost, see our companion guide.

How to Measure Total Execution Cost

To measure total execution cost on a single trade, you need the following data points:

  1. The input amount and token.
  2. The expected output at the time of submission, including all disclosed fees.
  3. The actual output received.
  4. The gas cost from the transaction receipt.
  5. The market price of the output token at the time of execution.
  6. Whether the transaction was sandwiched or otherwise MEV-impacted.

Total execution cost as a percentage of input value is:

(pool fee + interface fee + gas cost + slippage + MEV extraction + surplus retained) / input value

Each component is expressed in the same unit (input token value or its dollar equivalent). The sum is the total cost of execution.

In practice, most traders do not measure all six components on every trade. They look at the output amount and compare it to what they expected. But if you are trading large amounts or comparing execution venues, measuring the full cost is the only way to know which venue is actually cheaper.

Why This Matters

The DEX landscape markets itself on low fees, but the advertised fee is the floor, not the ceiling. A 0.05% pool fee is a starting point. Add an interface fee, gas, slippage on a large trade, a sandwich attack, and retained surplus, and the total cost can be multiples of the advertised number — for a detailed breakdown of each component, see our guide on understanding DEX aggregator fees.

This is not a criticism of any specific DEX. It is a structural feature of on-chain trading. Every component exists because someone is providing a service or extracting value at some point in the execution path. The question for traders is not whether these costs exist, but whether they are visible and measurable.

Execution quality is the real metric. It is the gap between what you should have gotten and what you actually got. The smaller the gap, the better the execution. Advertised fees tell you nothing about this gap. Only measurement does.

A Framework for Comparing Venues

If you want to compare execution across venues, run the same trade through each one and measure the six components. Use the same input amount, the same token pair, and the same time window. Record the output, the gas, and check for MEV.

You will find that the venue with the lowest advertised fee is rarely the venue with the lowest total execution cost. Gas differences, routing quality, MEV protection, and surplus handling all matter more than the pool fee for most trades.

For small trades, gas dominates. For large trades, slippage and MEV dominate. For trades on volatile pairs, surplus retention matters. The optimal venue depends on trade size, pair liquidity, and network conditions.

The point is not to find one venue that is best for everything. The point is to understand what you are paying for and to measure it. Execution cost is not a single number. It is a stack of costs, each with its own cause and its own mitigation. Knowing the stack is the first step to reducing it.

Orkid is one of the venues working on execution quality in this space. You can read more at orkidlabs.xyz. But the framework above applies to any DEX or aggregator. Measure the full cost, not the advertised fee, and you will make better trading decisions.

Frequently Asked Questions

What is execution cost in DEX trading?

Execution cost is the total cost of completing a trade on a decentralized exchange, beyond just the advertised fee. It includes gas costs, pool fees, slippage, MEV extraction, and any surplus retained by the platform or solver. Understanding the full execution cost is essential for comparing venues and minimizing trading expenses.

How is execution cost measured?

Execution cost is measured by comparing the expected price of a trade with the actual received price, then adding gas and any explicit fees. The difference between expected and actual value captures slippage, MEV, and surplus retention. Measuring all components together gives the true cost of execution.

What is effective spread?

Effective spread is a measure of the actual cost of trading, calculated as the difference between the execution price and the midpoint price of the asset. It captures the combined effect of the bid-ask spread, price impact, and any additional costs. A lower effective spread indicates better execution quality for the trader.

What is price impact in DEX?

Price impact is the change in an asset’s price caused by the size of your trade relative to the liquidity in the pool. Large trades in shallow pools move the price significantly, resulting in worse execution. Price impact is determined by the constant product formula used by AMMs and is a major component of execution cost for larger trades.

Written by Jacob Cavazos

← Back to blog

Research to next step

Turn this research into a usable next move

Reading the post is only step one. The stronger move is to route it into the asset or commercial lane that matches what your team needs next.

Try it now

Swap on Orkid

9 bps flat fee, gasless, MEV-protected. Live on Base, Ethereum, and Unichain. No ETH needed — the solver pays gas.

Open swap →

Launch overview

Read the launch brief

Start with the launch brief when the team needs the fastest summary of fit, trust, and the right next route through the site.

Read launch brief →

Technical packet

Review the Protocol Packet

If the post raised technical questions, move into the packet for the forwardable version of the core framework.

Review packet →

Shortlist and fit

Use comparisons or alternatives

When the question is no longer category education but shortlist fit, use the comparison surfaces to support an honest vendor evaluation.

See comparisons →
  • ZK Proving Systems Compared: Halo2, SP1, Plonky2, and STARKs

    ZK Proving Systems Compared: Halo2, SP1, Plonky2, and STARKs

    Eight zero-knowledge proving systems compared across proving time, proof size, verification, trusted setup, and ecosystem. A developer's guide to choosing a ZK system.

  • What Is Tokenized Credit Infrastructure?

    What Is Tokenized Credit Infrastructure?

    Tokenized credit is more than putting a loan on-chain. It is a full stack: SPV, token registry, compliance layer, and distribution. Here is how it works and why ERC-6909 matters.

  • What Is Surplus in DEX Aggregation?

    What Is Surplus in DEX Aggregation?

    When an aggregator routes your swap better than the quoted price, the difference is surplus. Some aggregators keep it. Some return it. Here is why that matters for your total cost.

  • What Is MEV and How to Protect Against It

    What Is MEV and How to Protect Against It

    Maximal extractable value costs DEX users millions. Here is what MEV is, how sandwich attacks work, and the four approaches to protection — private mempools, batch auctions, intent-based execution, and threshold encryption.

  • What Is ISO 20022 and Why It Matters for Blockchain

    What Is ISO 20022 and Why It Matters for Blockchain

    ISO 20022 is the global messaging standard for payments. Here is what it is, how it works, why banks are migrating to it, and what it means for blockchain settlement.

  • What Is Intent-Based Swap Execution?

    What Is Intent-Based Swap Execution?

    Intent-based execution lets users sign a message describing what they want, and solvers compete to fill it. Here is how the model works and why it's different from traditional DEX trading.

LLM Resource Index llms.txt