> For the complete documentation index, see [llms.txt](https://city-protocol.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://city-protocol.gitbook.io/docs/software-development-kit/swap/common-frontend-flows.md).

# Common Frontend Flows

#### Standard EVM Swap Flow

1. Call `swapClient.getQuote(...)` to display expected output, price impact, and route in the UI.
2. When the user confirms, call `swapClient.checkApprovals(...)` to determine whether an approval is required.
3. If allowance is insufficient, prompt approval using the payload from `getApproveTransaction(...)`.
4. Call `swapClient.buildSwap(...)` and forward the resulting transaction to the wallet for signing and broadcasting.

#### Managed One-Shot Flow

1. Implement an `executeTransaction` callback that wraps your wallet or relayer.
2. Call `swapClient.executeSwap(...)` with the trade parameters and callback.
3. The SDK handles approval lookup, stale-allowance revocation, swap building, and final execution, returning both `approveTxHash` (if any) and `swapTxHash`.

#### Solana Swap Flow

For Solana-based chains, swap execution passes through the `unsignedTx` field, with `jitoUnsignedTx` available as an optional MEV-protected variant. Your `executeTransaction` callback is responsible for signing and submitting the correct transaction variant based on the user's preference.
