Swap
Overview
A swap exchanges one token for another against liquidity in pools. The execution price depends on available liquidity and the path chosen by the router. Two user-facing safety controls govern execution:
Slippage tolerance: the maximum acceptable deviation from the quoted output.
Minimum received: derived from slippage tolerance; if execution would produce less, the swap reverts.
Price Impact
Price impact is the difference between the displayed market price and your actual execution price, caused by your trade moving the pool price as it executes.
On AMM-based DEXs, swaps execute against liquidity in a pool. As your order consumes liquidity, the pool price shifts during the swap, so the final execution price is typically somewhere between the starting price and the ending price.
Price impact is influenced by:
Trade size (larger trades usually create higher impact)
Available liquidity for the pair (deeper liquidity usually means lower impact)
Volatility / rapid price movement during execution
The UI estimates price impact in real time and may show warnings when impact is unusually high. If price impact is high, consider reducing trade size, splitting the trade, or trying an alternative pair.
Slippage Tolerance & Minimum Received
Slippage refers to price changes that can happen between the moment you submit a transaction and when it is actually confirmed on-chain.
To protect users from unexpected execution, the swap sets:
Slippage tolerance: the maximum acceptable deviation from the quoted price
Minimum received: the minimum output you are guaranteed to receive if the swap succeeds
If the final execution would result in less than the minimum received, the transaction will revert (fail) and no swap will occur.
When to adjust slippage:
Keep it low for liquid pairs and calm markets
Increase it only if:
the market is volatile,
liquidity is thin,
or your transaction keeps failing due to price movement
Higher slippage can help a swap succeed, but it may also result in worse execution.
Transaction Deadline
Transaction Deadline (Default: 20 minutes) is a separate safety control from slippage. Slippage protects the price you accept; the deadline limits how late the transaction is allowed to execute. If the transaction is mined after the deadline, it will revert (no swap). Note that a transaction may still stay pending in the mempool—this check is enforced at execution time.
Keep the default in most cases. Consider increasing it only during network congestion. Consider lowering it if you prefer a tighter execution window.
Smart Routing
Comet Swap’s router evaluates multiple possible routes and selects the one that is expected to deliver the best execution given current liquidity, fees, and price impact.
What are the routes
V3 CLMM pools across different fee tiers
V2 Classic pools
Multi-hop routes (e.g., Token A → Token B → Token C) when direct liquidity is weak
Mixed routes (V2 → V3, V3 → V2) when it improves net output
How routes are compared
For each candidate path, the router estimates:
Expected output after fees
Price impact along the path (including within CLMM ranges)
Available liquidity / depth (to avoid routes that are likely to slip excessively)
Execution constraints, including your slippage tolerance and minimum received
The selected route is the one with the best expected output while staying within your safety settings.
Splitting and multi-hop behavior
When helpful, routing may involve multiple hops to access deeper liquidity (e.g., through a more liquid intermediate asset).
In some cases, routing may also choose the path with slightly higher fees if it results in lower price impact and a better final output.
What you should expect as a user
If the router finds a meaningfully better route, you can see a route preview (e.g., A → B → C, or V2 + V3).
If liquidity changes quickly, the “best route” can change between quote time and execution — which is why slippage tolerance and deadline matter.
If execution would violate minimum received, the swap will revert rather than fill at a worse price.
Last updated