prepare_sunswap_swap

Build an unsigned SunSwap V2 same-chain swap on TRON. SunSwap V2 is a Uniswap-V2 fork; this tool routes through the V2 router (TNJVzGqKBWkJxJB5XYSqGAwUTV15U24pPq) using the standard swapExactETHForTokens / swapExactTokensForETH / swapExactTokensForTokens selectors based on which side is native TR...

Server VaultPilot MCP vaultpilot-mcp
Category Destructive
Risk class Critical
Parameters 94 required

What prepare_sunswap_swap does on VaultPilot MCP

AI agents call prepare_sunswap_swap to permanently remove resources in VaultPilot MCP — typically in cleanup and lifecycle workflows. It does its job in a single call, and there is no undo.

ParameterTypeRequiredDescription
amount string Yes Human-readable amount of fromToken (e.g. "100" for 100 TRX, "10.5" for 10.5 USDT). Decimals are resolved from the canonical TRC-20 set (USDT/USDC/USDD/TUSD) or
wallet string Yes TRON base58 wallet (T-prefixed, 34 chars) — funds the swap and signs the source tx on Ledger via USB. Pair via `pair_ledger_tron` first.
toToken string Yes Destination token. Either the literal "TRX" or a T-prefixed TRC-20 contract address. Cannot equal fromToken.
fromToken string Yes Source token. Either the literal string "TRX" for native TRX, OR a T-prefixed TRC-20 contract address. TRC-20 source REQUIRES a prior approve to the SunSwap V2
feeLimitTrx string Override the energy fee_limit cap (default 100 TRX). Pass a human-readable TRX amount (e.g. "50"). Energy estimate is reported separately in `estimatedEnergyCos
slippageBps integer Slippage tolerance in basis points (50 = 0.5%). Default 50.
deadlineSeconds integer Deadline window in seconds from now. Default 1200 (20 min). The router rejects the swap if it hasn't landed by then.
toTokenDecimals integer REQUIRED when toToken is a non-canonical TRC-20. Same reasoning as `fromTokenDecimals`.
fromTokenDecimals integer REQUIRED when fromToken is a non-canonical TRC-20 (i.e. not USDT/USDC/USDD/TUSD or "TRX"). We refuse to guess decimals on a swap because an off-by-power-of-ten

Parameters from the server's own tool schema.

Why prepare_sunswap_swap needs a policy

An AI agent that decides to call prepare_sunswap_swap doesn't hesitate, doesn't double-check, and doesn't stop at one. Whatever it removes from VaultPilot MCP is gone — there is no undo for destructive operations.

Questions about prepare_sunswap_swap

What does the prepare_sunswap_swap tool do? +

Build an unsigned SunSwap V2 same-chain swap on TRON. SunSwap V2 is a Uniswap-V2 fork; this tool routes through the V2 router (TNJVzGqKBWkJxJB5XYSqGAwUTV15U24pPq) using the standard swapExactETHForTokens / swapExactTokensForETH / swapExactTokensForTokens selectors based on which side is native TRX. Path encoding: TRX→TRC20 = [WTRX, toToken]; TRC20→TRX = [fromToken, WTRX]; TRC20→TRC20 = [fromToken, WTRX, toToken]. The builder (1) calls getAmountsOut on the router via /triggerconstantcontract to compute the expected output, (2) derives minOut as quotedOut * (10000 - slippageBps) / 10000, (3) for TRC-20 sources, reads allowance(wallet, router) and refuses with a recovery hint if insufficient — the user must run prepare_tron_trc20_approve(token, spender=router, amount) first, broadcast it, wait ~3s for it to land, then retry. (4) hand-rolls ABI calldata for the swap call (no SDK), (5) hits TronGrid /triggersmartcontract to build the tx, (6) verifies the returned raw_data_hex matches exactly what we asked for (selector + parameter + call_value + fee_limit) and refuses any drift. BLIND-SIGN on Ledger TRON app — the SunSwap router is not in the device's clear-sign allowlist. Enable "Allow blind signing" in the on-device TRON app Settings; the device shows the txID, which the user matches against the txID in the prepare receipt. Pair the Ledger via pair_ledger_tron first. Smart Router (V1+V2+V3+PSM aggregator) is intentionally not used — V2 router only — because Smart Router's mainnet address has not been published officially and its multi-version path encoding is a different ABI shape. It is categorised as a Destructive tool in the VaultPilot MCP MCP Server, which means it can permanently delete or destroy data. Block by default and require explicit approval.

What parameters does prepare_sunswap_swap accept? +

prepare_sunswap_swap accepts 9 parameters: amount, wallet, toToken, fromToken, feeLimitTrx, slippageBps, deadlineSeconds, toTokenDecimals, fromTokenDecimals. Required: amount, wallet, toToken, fromToken. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on prepare_sunswap_swap? +

Register the VaultPilot MCP server in PolicyLayer and add a rule for prepare_sunswap_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.

What risk level is prepare_sunswap_swap? +

prepare_sunswap_swap is a Destructive tool with critical risk. Critical-risk tools should be blocked by default and only enabled with explicit human approval.

Can I rate-limit prepare_sunswap_swap? +

Yes. Add a rate_limit block to the prepare_sunswap_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.

How do I block prepare_sunswap_swap completely? +

Set action: deny in the PolicyLayer policy for prepare_sunswap_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.

What MCP server provides prepare_sunswap_swap? +

prepare_sunswap_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.

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.