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

Agent View of the PolicyLayer registry record for `prepare_sunswap_swap`. HTML page: https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-sunswap-swap

## Facts

- Tool: `prepare_sunswap_swap`
- Server: VaultPilot MCP (`vaultpilot-mcp`) — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp.md
- Install: `npx -y vaultpilot-mcp`
- Homepage: https://github.com/szhygulin/vaultpilot-mcp
- Risk category: Destructive (Critical risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 9 (4 required)
- Recommended policy verdict: Hidden

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `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 | no | 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 | no | Slippage tolerance in basis points (50 = 0.5%). Default 50. |
| `deadlineSeconds` | integer | no | Deadline window in seconds from now. Default 1200 (20 min). The router rejects the swap if it hasn't landed by then. |
| `toTokenDecimals` | integer | no | REQUIRED when toToken is a non-canonical TRC-20. Same reasoning as `fromTokenDecimals`. |
| `fromTokenDecimals` | integer | no | 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.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "prepare_sunswap_swap",
    "arguments": {
      "amount": "<amount>",
      "wallet": "<wallet>",
      "toToken": "<toToken>",
      "fromToken": "<fromToken>"
    }
  }
}
```

## Why prepare_sunswap_swap is rated Critical

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.

## Use case

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.

## Recommended policy (PolicyLayer)

Verdict: **Hidden**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches VaultPilot MCP:

```json
{
  "version": "1",
  "default": "deny",
  "hide": [
    "prepare_sunswap_swap"
  ]
}
```

## Other tools on VaultPilot MCP (188)

- `prepare_btc_lifi_swap` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-btc-lifi-swap.md
- `prepare_btc_rbf_bump` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-btc-rbf-bump.md
- `prepare_jito_stake` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-jito-stake.md
- `prepare_marginfi_init` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-marginfi-init.md
- `prepare_solana_nonce_close` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-solana-nonce-close.md
- `prepare_uniswap_v3_burn` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-uniswap-v3-burn.md
- `prepare_uniswap_v3_mint` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-uniswap-v3-mint.md
- `remove_contact` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/remove-contact.md
- `unregister_btc_multisig_wallet` — Destructive — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/unregister-btc-multisig-wallet.md
- `combine_btc_psbts` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/combine-btc-psbts.md
- `pair_ledger_btc` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/pair-ledger-btc.md
- `prepare_aave_repay` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-aave-repay.md
- `prepare_btc_multisig_send` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-btc-multisig-send.md
- `prepare_compound_repay` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-compound-repay.md
- `prepare_compound_supply` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-compound-supply.md
- `prepare_curve_swap` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-curve-swap.md
- `prepare_custom_call` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-custom-call.md
- `prepare_kamino_init_user` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-kamino-init-user.md
- `prepare_kamino_supply` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-kamino-supply.md
- `prepare_lido_unstake` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-lido-unstake.md
- `prepare_lido_unwrap` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-lido-unwrap.md
- `prepare_lido_wrap` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-lido-wrap.md
- `prepare_native_stake_deactivate` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-native-stake-deactivate.md
- `prepare_native_stake_delegate` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-native-stake-delegate.md
- `prepare_rocketpool_unstake` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-rocketpool-unstake.md
- `prepare_safe_tx_execute` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-safe-tx-execute.md
- `prepare_solana_lifi_swap` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-solana-lifi-swap.md
- `prepare_solana_nonce_init` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-solana-nonce-init.md
- `prepare_solana_swap` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-solana-swap.md
- `prepare_swap` — Execute — https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp/prepare-swap.md
- …and 158 more: https://policylayer.com/tools/io-github-szhygulin-vaultpilot-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=io-github-szhygulin-vaultpilot-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/io-github-szhygulin-vaultpilot-mcp
