Swap with Trails
Trails enables seamless token swapping across multiple blockchain networks in 1-click, allowing users to exchange tokens without manually bridging assets or dealing with multiple DEXs available via an integrated widget or API.Enhanced Swapping Experience
Traditional cross-chain swapping requires users to:- Approve any ERC20 tokens
- Bridge tokens to the target chain
- Find and interact with DEXs on multiple networks
- Pay gas fees on each chain
- Wait for bridge confirmations
Use Cases
Ideal for a variety of token exchange scenarios:- Cross-chain token swaps (e.g., ETH on Mainnet → USDC on Base)
- Same-chain token exchanges with optimal routing
- Portfolio rebalancing across chains
- Converting between stablecoins with minimal slippage
Examples
Simple Cross-Chain Token Swap
Basic cross-chain swap implementation using the Trails widget with callbacks:Swap with Custom Theme
Customize the appearance to match your brand:Advanced Swap with Custom Quote Provider
While Trails automatically optimizes the selected route by the user, you may opt to specify a quote or bridge provider to optimize for your use case. For example, using Circle’s CCTP V2 for bridging:Using the useQuote Hook
For more control over the swap process for headless implementations, use theuseQuote hook directly:
Why Swap with Trails?
- Unified Liquidity: Access tokens from the user’s wallet across all supported chains in one transaction
- High Performance Balance Retrieval: A high-performant indexer is natively integrated to query the entirety of a user’s balance for smooth UX and price retrieval
- Reduced Complexity: Eliminate manual bridging and multi-step swaps (Approval and Transfer)
- Customized Branding: Brand or theme the widget however you’d like to be native to your protocol or application
- Seamless UX: Automatic routing finds optimal swap paths for low slippage for improved UX
- Gasless & Alt-fee token options: Support for gasless or alternative gas tokens like USDC for transactions to reduce friction
- Real-time Quotes: Live pricing and route optimization
- Chain Abstraction: Built from the ground up to support multichain environments and abstract underlying chains.
Next Steps
Learn more about customizing and configuring swap functionality:- Swap Mode Configuration - Complete configuration options and parameters for swap mode
- useQuote Hook - Programmatic control over swap quotes and execution
- Quote Providers - Customize liquidity sources and bridge providers (CCTP, Relay, etc.)
- Widget Theming - Customize the appearance to match your brand
- Tokens & Chains - Configure supported tokens and chains for swaps
- SDK Configuration - General widget configuration and callbacks