UnitFlow LogoUnitFlow Docs

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:

VersionPool TypeFee TiersRouting
v2.5 (default)Constant-product AMMFixed (set at pool creation)Direct + multi-hop
V3Concentrated liquidity0.01%, 0.05%, 0.30%, 1.00%Single pool per fee tier
V4Singleton PoolManager0.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.

ParameterDescriptionExample
inputCurrencyInput token address?inputCurrency=0x360...
outputCurrencyOutput token address?outputCurrency=0x89B...
symbolFromSymbol for dynamic input token&symbolFrom=MYTOKEN
symbolToSymbol for dynamic output token&symbolTo=USDC
decimalsFromDecimals for dynamic input token&decimalsFrom=18
decimalsToDecimals for dynamic output token&decimalsTo=18
fromLegacy alias for inputCurrency
toLegacy 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.
⚠️
Slippage above 5% shows a high-slippage warning. Above 50% (Degen Mode only) shows an extreme-slippage warning. High slippage exposes trades to front-running and MEV attacks.

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

  1. Enter the input amount — the output is estimated automatically.
  2. Review the route, price impact, and minimum received amount.
  3. If the input token is not yet approved, click Approve first.
  4. Click Swap (or Swap via Multi-Hop for routed trades).
  5. Confirm the transaction in your wallet.
  6. 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.