Skip to content
PlutoDocs

Swap

From typing an amount to the receipt. What each part of the screen means, and every call behind it.

Swap one token for another at the best price across every pool, in a single transaction.

Pick the tokens

Tap a token to search for it, or paste its address.

Type what you pay

Enter an amount, or tap 50% or MAX.

Check the quote

Read the rate, the route and the savings before you go on.

Follow the button

Do what it says: connect, switch network, approve, then swap. Sign each step in your wallet.

Real screen, captured from the app
  1. 1Slippage: Auto, or your own value
  2. 2You pay: type an amount, or tap 50% / MAX
  3. 3Token: tap to search or paste an address
  4. 4You receive: the best price across all pools
  5. 5Savings against the best single pool
  6. 6Rate: tap to flip the direction; quote age and gas sit beside it
  7. 7Route: how the trade is split across pools
  8. 8The button tells you what's needed next

When you've signed, the app shows the swap's progress:

AfterYou see
15 s"Taking longer than usual…"
120 s"Status unknown, check explorer". The app keeps polling GET /swap/status.
SuccessA toast with the time it took, and a receipt with the actual amount out.

What the button says

The button runs one ordered list of rules. The first rule that matches sets the label.

What the swap button says, and whyLive demo, running the app's own codeFlip the conditions. Rules are checked top to bottom; the first match wins.
Conditions
Rules, in order
  1. 1Honeypot as output
  2. 2No amount
  3. 3API error
  4. 4Not connected
  5. 5Wrong network
  6. 6Balance too low
  7. 7Quote loading
  8. 8Gas too low
  9. 9Ready
Button
Swap
Every outcome
  1. 1Honeypot as output
    Can't buy a honeypot token
  2. 2No amount
    Enter an amount
  3. 3API error
    No route found
  4. 4Not connected
    Connect wallet
  5. 5Wrong network
    Switch to Elysium
  6. 6Balance too low
    Insufficient USDC
  7. 7Quote loading
    Fetching best price…
  8. 8Gas too low
    Insufficient HYPE for gas
  9. 9Ready
    Swap
Source: src/features/swap/swap-rules.ts → swapButton()

Behind the button

A swap, call by call
Step 11 of 11

The app checks every transaction before your wallet sees it

If the API ever returned a transaction to the wrong contract, the app refuses to send it. See Security.

Each phase, from signing to the receipt, is a state in one machine. Step through it on Transaction lifecycle.