Documentation Index
Fetch the complete documentation index at: https://anypay-trails-api-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Route Providers
Trails integrates with multiple liquidity sources and bridge providers to find the best routes for your cross-chain transactions. You can specify preferred providers for swapping and bridging, or let Trails automatically select the optimal ones.Available Providers
AUTO(recommended): Automatically selects the best provider based on the routeRELAY: Uses Relay for fast bridging operationsCCTP: Uses Circle’s Cross-Chain Transfer Protocol for USDC transfersSUSHI: Uses SushiSwap for on-chain swapsZEROX: Uses 0x protocol for DEX aggregation
Configuration
Widget-Level Configuration
Specify route providers when initializing the widget:Hook-Level Configuration
When using theuseQuote hook, you can specify both swap and bridge providers:
Provider Characteristics
Auto (Recommended)
TheAUTO setting allows Trails to intelligently select the best provider for each transaction based on:
- Cost efficiency: Lowest fees and gas costs
- Speed: Fastest execution time
- Liquidity: Best rates for the token pair
- Reliability: Provider uptime and success rates
Relay
Relay provides fast cross-chain transfers with competitive fees:- Fast execution: Optimized for speed
- Native bridging: Direct chain-to-chain transfers
- Lower complexity: Simple bridge operations
CCTP
Circle’s Cross-Chain Transfer Protocol for native USDC transfers:- Native USDC: No wrapped tokens
- 1:1 transfers: No slippage for USDC
- Official Circle: Secure and trusted
SushiSwap
SushiSwap provides on-chain swaps across multiple chains:- Multi-chain: Available on many EVM chains
- DEX liquidity: Access to Sushi’s liquidity pools
0x Protocol
0x provides DEX aggregation for optimal swap rates:- Aggregated liquidity: Sources from multiple DEXs
- Best execution: Optimizes for price and gas
Best Practices
- Use
AUTOby default: Let Trails optimize the route for you - Specify for USDC: Use
CCTPbridge provider for USDC-specific transfers if you want guaranteed 1:1 transfers - Consider your use case:
- Fast bridging? Use
RELAYas bridge provider - USDC transfers? Use
CCTPfor native transfers
- Fast bridging? Use
- Separate concerns: Use
swapProviderfor same-chain swaps andbridgeProviderfor cross-chain transfers