prepare_uniswap_swap
Prepare a direct Uniswap V3 swap (bypasses LiFi aggregator). Use this ONLY when the user explicitly asks for Uniswap — otherwise default to prepare_swap which compares routes across venues. Same-chain only (Uniswap V3 is not a bridge). Auto-picks the best pool fee tier (100/500/3000/10000 bps) by...
This record as markdown: /tools/io-github-szhygulin-vaultpilot-mcp/prepare-uniswap-swap.md
What prepare_uniswap_swap does on VaultPilot MCP
AI agents use prepare_uniswap_swap to commit financial operations through VaultPilot MCP, usually the final step of a payment, billing, or trading workflow. A call moves real money.
| Parameter | Type | Required | Description |
|---|---|---|---|
chain | string | Yes | |
amount | string | Yes | Human-readable decimal amount, NOT raw wei/base units. Example: "1.5" for 1.5 USDC, "0.01" for 0.01 ETH. Interpreted as fromToken input by default; set `amountS |
wallet | string | Yes | |
feeTier | number | — | Optional fee-tier override (100 / 500 / 3000 / 10000 bps). When omitted, QuoterV2 is queried across all four tiers and the best-pricing pool is picked. |
toToken | object | Yes | |
fromToken | object | Yes | |
amountSide | string | — | Which side of the swap `amount` refers to. "from" (default) = exact-in: spend exactly `amount` of fromToken, receive a variable output. "to" = exact-out: receiv |
slippageBps | integer | — | Slippage tolerance in basis points (50 = 0.5%). Default 50. Hard-capped at 500 (5%); > 100 requires `acknowledgeHighSlippage: true` to prevent MEV sandwiching. |
toTokenDecimals | integer | — | Optional decimals hint for toToken if on-chain lookup fails. Native is 18. |
fromTokenDecimals | integer | — | Optional decimals hint for fromToken if on-chain lookup fails. Native is 18. |
acknowledgeHighSlippage | boolean | — | Opt-in flag required when slippageBps > 100. Forces explicit acknowledgement of unusually-high slippage. |
Parameters from the server's own tool schema.
Why prepare_uniswap_swap is rated Critical
This tool prepares a cryptocurrency swap transaction on Uniswap V3, which is a DeFi financial operation involving the exchange of crypto assets. Even though it returns an unsigned transaction (not yet executed), it constructs the financial transaction payload including token approvals and swap parameters. This falls squarely in the Financial category as it commits to a specific financial trade with real asset value.
From the tool's definition prepare a direct Uniswap V3 swap...ERC-20 <-> ERC-20, native-in (ETH -> ERC-20), and native-out (ERC-20 -> ETH). Both exact-in and exact-out. Returns an unsigned tx (with a reset+approve chain when the router needs allowan
Risk signalsHigh parameter count (11 properties)
Attacks that exploit this kind of access
The rule that runs prepare_uniswap_swap safely
PolicyLayer is an MCP gateway: it sits between your AI agents and VaultPilot MCP, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For prepare_uniswap_swap, this is the rule to start with:
Any call to prepare_uniswap_swap is blocked until a human approves it. The rest of the server keeps working.
The button opens the PolicyLayer dashboard: create your workspace, connect VaultPilot MCP, apply this rule, and every prepare_uniswap_swap call is checked against it from then on.
Questions about prepare_uniswap_swap
Prepare a direct Uniswap V3 swap (bypasses LiFi aggregator). Use this ONLY when the user explicitly asks for Uniswap — otherwise default to prepare_swap which compares routes across venues. Same-chain only (Uniswap V3 is not a bridge). Auto-picks the best pool fee tier (100/500/3000/10000 bps) by quoting all four against QuoterV2 and choosing the one with the best price; pass feeTier to override. Supports ERC-20 <-> ERC-20, native-in (ETH -> ERC-20), and native-out (ERC-20 -> ETH). Both exact-in and exact-out. Returns an unsigned tx (with a reset+approve chain when the router needs allowance) that send_transaction can forward to Ledger Live. Single-hop only in v1 — multi-hop routes through an intermediate asset (e.g. via WETH) fall back to prepare_swap. It is categorised as a Financial tool in the VaultPilot MCP MCP Server, which means it involves financial transactions. Block by default and require explicit approval.
prepare_uniswap_swap accepts 11 parameters: chain, amount, wallet, feeTier, toToken, fromToken, amountSide, slippageBps, toTokenDecimals, fromTokenDecimals, acknowledgeHighSlippage. Required: chain, amount, wallet, toToken, fromToken. The full parameter table on this page comes from the server's own tool schema.
Register the VaultPilot MCP server in PolicyLayer and add a rule for prepare_uniswap_swap: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches VaultPilot MCP. Nothing to install.
prepare_uniswap_swap is a Financial tool with critical risk. Critical-risk tools should be blocked by default and only enabled with explicit human approval.
Yes. Add a rate_limit block to the prepare_uniswap_swap rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for prepare_uniswap_swap. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
prepare_uniswap_swap is provided by the VaultPilot MCP server (vaultpilot-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on VaultPilot, and thousands of servers like it.
Across the catalogue