Swap
Token-to-token swaps with multi-tier routing across Eloqura V2 and Uniswap V3.
Source: client/src/pages/swap.tsx
Overview
The Swap page is the core feature of Eloqura DEX. It finds the best price across multiple liquidity sources and executes the trade in a single transaction.
Swap Types
ETH → Token
swapExactETHForTokens()
Input is native ETH
Token → ETH
swapExactTokensForETH()
Output is native ETH
Token → Token
swapExactTokensForTokens()
Both are ERC-20 tokens
Quote Routing
The system tries four sources in order:
Eloqura V2 — Direct pair reserves (best for OEC, WETH, USDC pairs)
Uniswap V3 Quoter — Tries all 4 fee tiers (100, 500, 3000, 10000 bps)
Multi-hop — Token → WETH → USDC via Uniswap V3
Eloqura reserve pricing — Fallback for OEC/Eloqura-only tokens
UI Features
Token selectors with search and known token list
Amount input with percentage buttons (25%, 50%, 75%, Max)
Slippage tolerance slider (0.1% to 5%)
Price impact warning for large trades
Exchange rate display (forward and inverse)
Gas estimate before execution
Custom token import — paste any ERC-20 contract address
Swap Flow
User selects tokens and enters amount
Quote system finds best route and price
User reviews rate, price impact, minimum received
If needed, approve token spending (one-time)
Execute swap transaction
Transaction tracked via OECsplorer API
Transaction Tracking
All swaps are reported to the OECsplorer indexer for on-chain analytics:
Last updated