Swap
The Swap page is the default landing view of the DEX. It lets users trade one token for another at the current market rate, with configurable slippage and optional advanced settings.
Supported Versions
The swap interface supports three protocol versions, selectable via the version picker in the top-right of the swap card:
| Version | Pool Type | Fee Tiers | Routing |
|---|---|---|---|
| v2.5 (default) | Constant-product AMM | Fixed (set at pool creation) | Direct + multi-hop |
| V3 | Concentrated liquidity | 0.01%, 0.05%, 0.30%, 1.00% | Single pool per fee tier |
| V4 | Singleton PoolManager | 0.01%, 0.05%, 0.30%, 1.00% | Single pool per fee tier |
Multi-hop Routing (v2.5)
When no direct pool exists between the selected tokens, the v2.5 swap engine automatically finds a route through intermediate tokens. The router:
- Builds a bidirectional graph of all available pairs
- Uses BFS to discover all paths up to 3 hops
- Selects the route that produces the highest output amount
- Displays the full route path in the UI (e.g.,
USDC → WUSDC → TOKEN)
URL Parameters
The swap page supports pre-selecting tokens via URL query parameters. This is useful for linking directly to a specific trading pair.
| Parameter | Description | Example |
|---|---|---|
inputCurrency | Input token address | ?inputCurrency=0x360... |
outputCurrency | Output token address | ?outputCurrency=0x89B... |
symbolFrom | Symbol for dynamic input token | &symbolFrom=MYTOKEN |
symbolTo | Symbol for dynamic output token | &symbolTo=USDC |
decimalsFrom | Decimals for dynamic input token | &decimalsFrom=18 |
decimalsTo | Decimals for dynamic output token | &decimalsTo=18 |
from | Legacy alias for inputCurrency | |
to | Legacy alias for outputCurrency |
Settings Panel
Click the gear icon on the swap card to access:
- Slippage Tolerance — preset buttons (0.1%, 0.5%, 1.0%) or a custom value. Maximum is 50% in normal mode.
- Degen Mode — raises the slippage ceiling to 99% and changes presets to 0.5%, 1.0%, 5.0%, 10.0%. Displays a red warning theme when active.
Trading Chart
A price chart is available in the swap card (toggle via the chart icon). It uses thelightweight-charts library and displays historical price data for the selected pair with 1H, 4H, 1D, and 1W timeframes.
Transaction Flow
- Enter the input amount — the output is estimated automatically.
- Review the route, price impact, and minimum received amount.
- If the input token is not yet approved, click Approve first.
- Click Swap (or Swap via Multi-Hop for routed trades).
- Confirm the transaction in your wallet.
- A transaction modal tracks each step (approve → swap → confirmed).
WUSDC / Native USDC
Arc Testnet uses native USDC at address 0x3600000000000000000000000000000000000000. The DEX wraps it as WUSDC (0x911b4000D3422F482F4062a913885f7b035382Df) for compatibility with the AMM contracts. This wrapping/unwrapping is handled transparently — users always see "USDC" in the UI.