Direct crypto to crypto swaps eliminate fiat intermediaries but introduce routing decisions, slippage mechanics, and counterparty models that affect execution cost and settlement finality. This article dissects the technical pathways for exchanging one cryptoasset for another, covering centralized order book execution, automated market maker mechanics, crosschain bridge protocols, and the trade-offs embedded in each.
Centralized Exchange Order Books
Centralized exchanges match buyers and sellers through a limit order book. When you swap BTC for ETH on a CEX, you typically execute a market order against the best available limit orders or place a limit order yourself.
The exchange acts as custodian during execution. You deposit BTC into your exchange wallet, the system converts it to the quote currency (often USDT or USDC as an intermediary even if you never hold it), then executes a second leg into ETH. Some exchanges offer direct pairs (BTC/ETH) to reduce friction, but liquidity often concentrates in quote currency pairs.
Settlement happens in the exchange database. Your balances update immediately, but the underlying blockchain state changes only when you withdraw. This creates counterparty risk: the exchange holds both assets during and after the swap. Withdrawal delays, account freezes, or insolvency events can prevent you from taking custody.
Fee structure combines maker/taker spreads and withdrawal fees. Taker orders typically cost 0.10% to 0.50% of notional value, depending on your volume tier. Maker orders may receive rebates. Network withdrawal fees are separate and fluctuate with blockchain congestion.
Automated Market Maker Protocols
AMMs replace order books with liquidity pools governed by bonding curves. Uniswap, Curve, and similar protocols lock two tokens in a smart contract and allow traders to swap against the pool reserves.
The constant product formula (x * y = k for Uniswap V2) determines price. When you sell token A for token B, you increase A reserves and decrease B reserves. The ratio shift moves the price. Larger trades relative to pool depth cause greater price impact, which manifests as slippage.
Slippage is deterministic but nonlinear. A swap of 1% of pool depth might move price 1.01%, while a swap of 10% of pool depth could move price 11% or more, depending on the curve. Concentrated liquidity models (Uniswap V3) allow liquidity providers to focus capital in specific price ranges, improving depth for common trades but increasing slippage for large or volatile swaps.
Routing algorithms optimize execution across multiple pools. Aggregators like 1inch or Matcha split a single swap across Uniswap, SushiSwap, Curve, and other venues to minimize total slippage. A 50 ETH to USDC swap might route 30 ETH through Uniswap V3, 15 ETH through Curve, and 5 ETH through Balancer, executing within a single transaction.
Gas costs scale with routing complexity. A single pool swap costs roughly 100,000 to 150,000 gas. Multi-hop routes or split routes can exceed 500,000 gas. At 30 gwei and ETH priced at $2,000 (illustrative), that’s $30 to $300 per swap. Layer 2 networks reduce this to under $1, but you must bridge assets first.
Crosschain Bridge Protocols
Swapping assets on different blockchains requires a bridge or messaging layer. You cannot directly exchange Bitcoin on the Bitcoin blockchain for Ether on Ethereum. Instead, you rely on a bridge protocol or centralized intermediary.
Lock and mint bridges hold the source asset in a custody contract and issue a wrapped representation on the destination chain. Wrapped Bitcoin (WBTC) on Ethereum represents BTC locked by a custodian. Swapping BTC for ETH involves minting WBTC, swapping WBTC for ETH on an AMM, or using a bridge that combines both steps.
Burn and release bridges work in reverse. You burn the wrapped asset on the destination chain to unlock the native asset on the source chain. Trust assumptions vary: some bridges use multisig custodians, others use validator sets with slashing conditions, and a few rely on optimistic verification with fraud proofs.
Atomic swaps use hash time locked contracts (HTLCs) to enable trustless exchange. Both parties lock funds with a cryptographic hash. One party reveals the preimage to claim the counterparty’s funds, which also allows the counterparty to claim the original funds. Atomic swaps eliminate custodial risk but require both parties to be online and coordinated, limiting their use to peer to peer scenarios or specialized protocols.
Crosschain AMMs like THORChain and Chainflip pool native assets from multiple blockchains and facilitate swaps through their own consensus layer. You send BTC to a THORChain vault address, the protocol credits your account, swaps to the ETH pool, and sends ETH to your destination address. Latency ranges from minutes to an hour, depending on confirmation requirements.
Worked Example: Routing a Large Swap on Ethereum Mainnet
You hold 100 ETH and want USDC. The Uniswap V3 ETH/USDC 0.05% fee pool has $50 million liquidity concentrated between $1,900 and $2,100 per ETH. Current ETH price is $2,000.
A direct swap of 100 ETH ($200,000 notional) represents 0.4% of pool liquidity. Estimated slippage is 0.35%, meaning you receive $199,300 USDC instead of $200,000. Fee is $100 (0.05% of notional). Gas cost is 150,000 gas at 25 gwei, or $7.50 at $2,000 ETH.
An aggregator finds a split route: 60 ETH through Uniswap V3, 25 ETH through Curve tricrypto pool, and 15 ETH through Balancer weighted pool. Total slippage drops to 0.22%, yielding $199,560 USDC. Gas cost rises to 420,000 gas ($21 at 25 gwei), but net proceeds are $260 higher. The aggregator route wins.
If you execute on Arbitrum instead, the same swap costs under 500,000 gas at 0.1 gwei, or $0.10. Liquidity is lower, so slippage rises to 0.50%, yielding $199,000 USDC. You save $21 in gas but lose $560 to slippage. The mainnet route wins for this size.
Common Mistakes and Misconfigurations
- Assuming quoted prices include slippage. AMM interfaces show the spot price, not the execution price after your trade moves the curve. Always check the minimum received amount.
- Ignoring token decimals when calculating allowances. USDC uses 6 decimals, ETH uses 18. Approving 1000000 USDC means 1 USDC, not 1 million. Wallets abstract this, but custom scripts can fail.
- Setting slippage tolerance too low in volatile markets. A 0.1% slippage cap may cause legitimate trades to revert if price moves between simulation and execution. The transaction fails, you pay gas, and the swap does not execute.
- Swapping through illiquid pairs to save one transaction. Trading ETH for obscure token X directly might offer a worse rate than ETH to USDC to token X, even with the extra hop. Check effective price, not just transaction count.
- Forgetting to account for bridge finality time. Crosschain swaps may take 10 minutes to several hours. If you need the destination asset immediately, a centralized exchange with both chains may execute faster.
- Trusting aggregator routing without checking the constituent pools. An aggregator might route through a pool with a malicious token contract. Verify that all pools in the route use trusted token addresses.
What to Verify Before You Rely on This
- Current liquidity depth for your trading pair on each venue. Pools can drain or concentrate during market events.
- Gas price and network congestion for the relevant blockchain. Execution costs fluctuate by orders of magnitude.
- Bridge validator set composition and slashing history if using crosschain swaps. Validator turnover or slashing events indicate risk.
- Smart contract audit status and upgrade authority for AMM protocols. Unaudited contracts or admin keys that allow arbitrary changes introduce execution risk.
- Exchange withdrawal policies and processing times. Some CEXs batch withdrawals or impose manual review thresholds.
- Token contract upgrade mechanisms. Upgradeable tokens can change behavior post-swap, affecting redeemability or transferability.
- Aggregator MEV protection features. Some aggregators include frontrunning protection, others expose you to sandwich attacks.
- Regulatory restrictions on the assets or venues you plan to use. Compliance filters may block your transaction or freeze your account.
- Actual transaction simulation output, not just the interface estimate. Tools like Tenderly let you simulate the exact calldata before broadcasting.
Next Steps
- Benchmark execution quality across three venues for a representative swap size in your portfolio. Compare net proceeds after fees, gas, and slippage.
- Set up monitoring for the liquidity pools or order books you rely on. Track depth, fee tier changes, and utilization rates.
- Test a crosschain swap with a small amount to measure latency and confirm the destination address format before executing larger trades.
Category: Crypto Trading