# Swapping with the app

> Connecting a wallet, choosing tokens, reading the quote, setting slippage, approving and sending a swap, and what every badge and warning means.

Source: https://tirio.io/docs/swapping · Updated 2026-10-01

The swap app lives at [/swap](/swap). Everything below happens in your browser and your wallet; Tirio never holds your tokens.

The card's state is in the URL, so a link can open it ready to trade: `/swap?chain=bsc&from=<token>&to=<token>&amount=<decimal>&side=in|out` (`from` and `to` are token addresses, the zero address is the native coin; `side=out` opens buy mode; `tab=limit` or `tab=dca` opens an order tab). Two more parameters make a **partner link**: `partner=<address>&partnerFeeBps=<1…1000>` replaces the 3 bps Tirio fee with a partner fee of that many basis points on every swap made from the link. The Router pays it to the partner inside the swap transaction itself, minus the Router's 10 % share (the owner can raise that share to at most 20 %), and the card shows it on a **Partner fee** line with the partner's address while the Tirio fee reads 0. If either parameter is missing or invalid, both are ignored and the 3 bps Tirio fee applies. Orders placed from a partner link carry the partner fee too. Every quote the app requests is tagged `source=app` in the API's logs; the tag never reaches the chain.

## 1. Connect a wallet

Click **Connect wallet**. Under **Installed** the dialog lists every wallet your browser announces through EIP-6963 (MetaMask, Rabby, OKX Wallet, Binance Wallet, Trust Wallet and so on, or a single "Browser wallet" entry when the wallet does not announce itself); the wallet you used last time comes first and is marked **Recent**. Pick one and approve the request in the wallet; if you reject it, or the wallet does not answer, the dialog says so and offers **Try again**.

No wallet in this browser? On a desktop choose **WalletConnect**, scan the QR code with your wallet app and approve the session. On a phone pick your wallet app from the list and the app opens with the request, or choose **Other wallets** to open or copy the WalletConnect link. **Coinbase Wallet** also connects without the extension through its own popup, and the links under **New to wallets?** lead to the download pages.

Once connected, the button shows your address and network. Click it to copy the address, open it on BscScan or disconnect. If your wallet is on another network the button says **Wrong network** and the menu offers **Switch to BNB Chain**.

## 2. Choose the network

BNB Chain is the only live network. Robinhood Chain is planned, but its contracts are not deployed and nothing can be traded there yet. Choosing a network asks your wallet to switch to it; if your wallet changes network on its own, the app follows. The status line in the top bar shows whether the chain is live and the current Tirio fee; while quotes are paused it names the reason (for example pools loading).

## 3. Choose the tokens

Native BNB is preselected as the token you pay; USDT is preselected as the token you receive. Click either token to open the list: it comes from the Tirio API with the native coin first, and you can search by name or symbol. The arrow between the two boxes flips the pair.

To trade a token that is not listed, paste its address. The app reads its `symbol`, `name` and `decimals` on chain and shows it with a warning: its transfer tax and liquidity are unknown, and anyone can deploy a token with any name, so check the address before you trade. Unlisted tokens stay marked as "Unlisted token" in the card.

## 4. Enter an amount

Type into **You pay** to sell an exact amount, or into **You receive** to buy an exact amount (buy mode, available when the network shows it as supported). In buy mode the pay field shows the expected cost, the details list the **maximum paid** (expected cost plus the fee and your slippage), the router never takes more than that, and whatever the route does not need stays in your wallet. Paying with BNB works the same way: the transaction carries the maximum as its value and the Router returns the unused part to you in the same transaction, so your balance must cover the maximum plus gas.

**MAX** fills in your whole balance as the amount you pay; for the native coin it keeps a reserve for gas. Once you review the swap, approximate USD values are shown for both sides when the API can price the tokens, together with the difference between them.

## 5. Read the quote

While you type, the card shows an indicative price, marked **Indicative price**: 400 ms after your last edit the app asks the API's `/price` to route the amount without simulating it, and refreshes it every 15 seconds. The output, rate, price impact, Tirio fee, network fee and route come from it. Press **Review** to get the quote: the API's `/quote` simulates the whole transaction at the latest block and builds it for your wallet, with the minimum received (or the maximum paid), the fees and any approval or permit. Only the quote is ever signed; if the price cannot be read, the card says why and asks for no quote instead. If the API could not run its simulation, which is rare, the quote carries a **Not simulated** badge and a warning that the swap may revert or pay less than quoted, down to your minimum; the app still simulates the transaction itself when you press Swap (step 9).

If the quote gives you less than the price you saw by more than half your slippage, and never more than 0.5 %, the card shows **Price updated** with both amounts and the swap waits until you press **Accept**; a better quote simply replaces the price. In review the quote refreshes every 15 seconds and each refresh is compared with the price you saw or last accepted. Changing the amount, the tokens or the wallet leaves the review. Each quote carries a deadline (20 minutes after it was made, so a slow wallet confirmation does not expire it); the **Valid** badge counts it down, and when fewer than 20 seconds remain the app fetches a fresh quote before letting you swap. The Router refuses a transaction sent after its deadline.

The badges next to the countdown say how the quote was made:

| Badge | Meaning |
| --- | --- |
| **Exact quote** | Every leg of the route was quoted exactly. |
| **Estimated** | Some legs of the route are estimates rather than exact figures. The minimum received still protects you: the transaction reverts if you would get less. |
| **Simulated** | The complete transaction was simulated on chain before the quote was returned; the output and gas shown are the simulated ones. |
| **Not simulated** | The simulation could not run. The output and gas are the routed estimate; the swap may revert or pay less than quoted, down to your minimum. |

Below the badges:

- **Rate**: click it to invert the direction.
- **Price impact**: how far your order moves the pool prices compared with the spot rate.
- **Minimum received**: the least you will get; anything less reverts the swap.
- **Tirio fee**: 3 bps, or 0 with a partner link, in bps and in units of the token it is taken in (the token you pay).
- **Partner fee**: shown only when the link you used carries a partner fee, with the partner's shortened address in the label. The fee goes to that address inside the swap transaction, minus the Router's 10 % share, and is taken from the token you pay.
- **Network fee**: the estimated gas cost, from the quote's gas estimate and the current gas price.
- **Max slippage**: your current setting.

## 6. Slippage and minimum received

Open the settings with the gear button. The presets are 0.1 %, 0.5 % and 1 %; the default is 0.5 %. A custom value may have at most two decimals and cannot exceed 50 %. Settings of 5 % or more show a high-slippage warning; settings below 0.05 % warn that the swap may revert if the price moves at all.

The minimum received is computed by the API from your setting: `minOut = amountOut × (10000 − slippageBps) / 10000`, and it is written into the transaction. The Router compares it with the recipient's balance change and reverts the whole swap if the balance grew by less.

**Positive slippage.** When you sell an exact amount of a token for a token without transfer tax, the output passes through the Router. If the swap delivers more than the quoted output, Tirio keeps the excess up to 1 % of the quoted output (with a partner link, 20 % of what is kept goes to the partner) and anything above that reaches you. If it delivers less, you receive less, down to the minimum received. Buy mode and taxed tokens are not affected.

**MEV.** Slippage is your guard against front-running: a higher setting leaves more room for a sandwich trade. Wallets and RPC endpoints that send transactions privately add another layer.

Tokens with a transfer tax move more than quoted. When a quote involves a taxed token and your slippage is below 1 %, the card suggests 1 % and offers a **Use 1%** button.

## 7. Price impact warnings

The price impact figure turns amber at 1 % and red at 5 %. From 5 % the card adds a **High price impact** notice and suggests a smaller amount. From 15 % the button reads **Price impact too high** and stays disabled until you press **I understand**; it then changes to **Swap anyway**. The confirmation is forgotten whenever the quote changes.

## 8. Approve or sign

An ERC-20 input has to be spendable by the Router. The API tells the app which path applies to your wallet and token:

- **Nothing to do**: the Router already has enough allowance, or a Permit2 signature from an earlier swap still covers the token and the Router pulls through Permit2.
- **Sign & swap**: the token supports EIP-2612 permits, or you have approved it to Permit2. Your wallet asks for a signature first (no gas, no transaction), then the swap transaction carries it.
- **Approve TOKEN via Permit2 (once)**: the default **Token approvals** setting is Permit2. One approval of the token to Permit2 (`0x000000000022D473030F116dDEE9F6B43aC78BA3`) is enough forever, including after router upgrades; from then on you sign.
- **Approve TOKEN**: with the **Direct** setting the token is approved to the Tirio router itself, by default for the exact amount of the swap. **Unlimited approval** is an off-by-default sub-option: with it on, the button reads **Approve TOKEN (unlimited)** and the Router can move any amount of that token on your behalf until you revoke the allowance.

Native BNB needs no approval. Wrapping BNB into WBNB or unwrapping it back goes straight to the WBNB contract without the router, with no fee and no approval.

## 9. Swap

Press **Swap**. The app first simulates the exact transaction with `eth_call` ("Simulating the swap…"). If the simulation reverts, the Router's error is decoded into a plain message (for example `InsufficientOutput` or `Expired`), nothing is sent and a fresh quote is requested. If the check itself cannot complete, because no RPC answers, the card says so under **Not sent** and the wallet never opens; press Swap again. The quote refresh is paused from the moment you press Swap, so the numbers on the card are the ones you sign. Otherwise your wallet asks you to confirm ("Confirm the swap in your wallet"), and the status panel tracks the transaction to its receipt with a link to the explorer.

On success the panel shows what you sold and what you received; for ERC-20 outputs the received amount is read from the receipt's `Transfer` logs, for native outputs and for a wrap into WBNB (whose `deposit()` emits no `Transfer`) the expected amount is shown. If the transaction reverts on chain, nothing was swapped and only gas was spent. A transaction you cancel or replace in your wallet is reported as cancelled.

## Reading the route card

The route card sits at the bottom of the details:

- The title says **Single path** or **Split over N paths**, followed by the number of pools and DEXes used.
- The bar shows each path's share of the input; the same colour marks the path's row below.
- Each row starts with the path's share in percent, then alternates tokens (with the amount flowing through) and DEX pills.
- A **DEX pill** is coloured by the DEX and shows the pool's fee (for example `0.25%`). Click it to open the pool on the explorer (BscScan on BNB Chain). Hover it to see whether the hop was quoted on chain or from the pool's current state and whether it is an estimate.
- The **↻** marker is a wrap or unwrap of the native coin.
- Amounts are the simulated outputs at the current block.

## Limit and DCA tabs

The head of the card switches between **Swap**, **Limit** and **DCA**; **Pro ↗** opens the same pair on the [trade page](/docs/trade), which also offers stop orders. The Limit and DCA tabs sell the token you pay for the token you receive, with prices written as the received token per paid token (the inverse is shown under each price field). A limit order waits for your min price; a DCA order sells in slices on a schedule, never below its price protection. Placing either one moves the tokens you sell into the Tirio Orders contract until the order fills, expires or you cancel it, and the fee is 10 bps of what each fill receives (3 bps between stablecoins). The connected wallet's orders are listed under the card, where you can cancel, pause, edit and claim. Orders are live on BNB Chain since 2026-09-30. How orders work is described in [Orders](/docs/orders).

## Warnings and paused quotes

- **Transfer tax**: "TOKEN charges an X transfer tax on sells/buys. The quote already includes it." If the tax could not be checked, the card says you may receive less than quoted.
- **Quotes paused**: the API answered 503 (it is behind the chain, cannot reach its RPC endpoints, or pools are still loading). The app retries every 5 seconds.
- **Busy, retrying**: the API's rate limit was hit; the app waits for the time it was told and retries.
- **No route found**: no route for this pair and amount, or the best route failed in simulation.
- **Token not supported**: the API refuses the token, with the reason shown.
- **Insufficient balance** and **Insufficient BNB for gas** are checked against your wallet before the button is enabled.
