When TRANSFER_REQUIRE_CONFIRMATION=true (default), Uniswap swaps follow the same human-in-the-loop pattern as native transfers: the agent prepares an unsigned quote, the user reviews details in chat, then Confirm or Cancel.
The env var name is shared with transfers (TRANSFER_REQUIRE_CONFIRMATION). Set it to false only when you want auto-sign for both transfers and swaps.

Flow

Chat UI

The sample web app renders a Swap confirmation card with: Buttons: Confirm (sign + broadcast) and Cancel (discard pending swap). Pending swaps expire after PENDING_SWAP_TTL_MINUTES (default 15, max 60).

REST API

Base path: your agentic-ai API (sample: /agents). Confirm response (success):

SSE events

During chat streaming, the backend emits: Message metadata persists swapPending so history reloads the card without re-parsing markdown.

Environment variables

Implementing in your app

Mirror the sample web app:
  1. Parse swapPending from assistant message metadata (or markdown fallback).
  2. Render a confirmation card with sell/buy/network rows.
  3. On Confirm, POST …/swaps/:pendingId/confirm with the user JWT.
  4. Show swapTxHash with a block explorer link.
Transfer confirmation uses the same pattern — see Full-stack integration.