Jump to content
Chain Times

Markets, protocols, policy and people

How Apps Should Quote BaseSwap Trades

Apps should quote a BaseSwap trade from live pool data for the exact token pair and amount, then show fees, minimum output and how quickly the estimate can go stale.

The Chain Times Desk3 min read

How Apps Should Quote BaseSwap Trades

Apps should quote a BaseSwap trade from live pool data for the selected tokens and exact input amount. A token’s displayed market price cannot tell a user how much a pool will return for a trade of that size. The pool’s liquidity and fee affect the result, and the quote can change before the transaction is included. The linked baseswap explainer covers the wallet trade flow in more detail.

What should an app include in a BaseSwap quote?

A useful quote tells the user what they are trading, what they may receive and what could change. It should use the exact token contracts and network, since names and tickers alone do not identify an asset. It should also use the input amount the user entered, rather than extrapolating from a small trade.

Apps need to account for token decimals when converting between the amount shown on screen and the smaller units used by the contract. Then they can show the estimated output, the exchange rate for this trade and any pool or app fee that applies. Network gas is a separate cost, usually paid in ETH on Base. If the app cannot estimate it reliably, it should label the estimate or show the wallet’s transaction preview.

Price impact means the trade itself moves the pool’s price. It can make the effective rate worse as the input grows, especially when liquidity is limited. A quote should reflect that effect for the full amount.

How should apps handle slippage and stale quotes?

Apps should turn the user’s slippage setting into a minimum output and refresh the quote when the pool state changes. Slippage is the allowed drop from the quoted output before the swap fails; it does not erase price impact already included in the estimate. A tight limit can cause a transaction to revert, while a loose one allows a worse result.

Show when the quote was fetched or how long it remains usable, and update it before the user signs if it has aged. The transaction should enforce a minimum output on-chain, so the swap fails if the result falls below the user’s chosen floor. A displayed estimate alone cannot protect the trade.

How can users compare quotes fairly?

Users should compare the amount they would actually receive for the same input, not just a headline rate. Apps can make that comparison clearer by showing the main costs and execution limits together:

  • Estimated output for the full input amount
  • Pool, app and network fees, with any exclusions stated
  • Minimum output after the slippage setting
  • Quote age and the route or pools used, if available

A route with a better quoted output may still cost more once gas or app fees are included. The clearest app gives the user an amount to expect, a floor the transaction will enforce and enough cost detail to judge the trade before signing.

More stories

  1. 01Polygon Bridge withdrawals: how to check a stuck transfer
  2. 02OCC leaves stablecoin rewards open to case-by-case review
  3. 03How to Read a Cross-Chain Swap Quote
  4. 04Solana switches mainnet to Alpenglow at slot 459,653,000