Unified token swapping interface with multi-DEX integration for optimal trading on Solana
The Swap Module provides a comprehensive token swapping solution that integrates multiple DEX providers into a unified interface for the Solana blockchain. It automatically finds the best routes and prices across different protocols to maximize trading efficiency.
Integrated support for Jupiter aggregation, Raydium pools, and PumpSwap custom routing
Automatic route optimization to find the best prices and lowest fees across all DEXs
Live price updates, slippage calculations, and fee estimates for informed trading decisions
Customizable slippage, provider selection, and transaction parameters for power users
Import Module
Import the swap components and hooks:
Wallet Integration
Ensure Embedded Wallets are configured:
DEX Configuration
Configure DEX provider settings (optional):
The swap module is built with a modular, provider-agnostic architecture:
Primary DEX Aggregator - Best price discovery across all Solana DEXs
Features:
Primary DEX Aggregator - Best price discovery across all Solana DEXs
Features:
Direct Pool Access - Concentrated liquidity and direct pool swaps
Features:
Custom Pool Support - Direct pool address specification with custom slippage
Features:
SwapScreen
- Complete swap interface with all features
Features:
SwapScreen
- Complete swap interface with all features
Features:
SelectTokenModal
- Advanced token selection interface
Features:
Granular UI Components - Building blocks for custom interfaces
The primary hook for swap functionality:
Provider-agnostic service for executing swaps:
Quote Caching: Implement intelligent quote caching to reduce API calls and improve response times.
Rate Limiting: Be mindful of DEX API rate limits when implementing real-time price updates.
Essential for transaction signing and balance checking
Token metadata, prices, and portfolio integration
Works alongside Pump.fun, Raydium, and Meteora modules
AI can execute swaps through natural language commands
For detailed API documentation, see:
The Swap Module provides the foundation for all token trading activities in your Solana app, offering users the best possible prices through intelligent multi-DEX routing while maintaining a simple and intuitive interface.