build_swap_transaction
Build a Paraswap token swap on Ethereum, Arbitrum, or Base, returning an ordered list of raw transactions (approve + swap) ready for wallet review and execution.
Instructions
Build a token swap via Paraswap v5 on Ethereum (1), Arbitrum One (42161) or Base (8453). Returns an ORDERED list of raw transactions, each with to/data/value ready for wallet preview and execution: an exact-amount ERC-20 approve when the current allowance is short (preceded by a reset to zero when a partial allowance already exists — USDT-style tokens revert otherwise), then the swap. Execute them in order; do not reorder, skip or batch. Quotes are fetched fresh on every call and expire in minutes: build right before executing.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chain_id": "<chain_id>",
"src_token": "<src_token>",
"src_decimals": "<src_decimals>",
"dest_token": "<dest_token>",
"dest_decimals": "<dest_decimals>",
"amount": "<amount>",
"user_address": "<user_address>"
},
"name": "build_swap_transaction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount to sell in human units, e.g. "5" or "0.25" | |
| chain_id | Yes | Chain to swap on: 1 (Ethereum), 42161 (Arbitrum One) or 8453 (Base) | |
| src_token | Yes | ERC-20 address of the token to sell (0x...) | |
| dest_token | Yes | ERC-20 address of the token to buy (0x...) | |
| src_symbol | No | Optional display label for the source token. Echoed back verbatim and NEVER verified against the contract — it is your own label, not evidence. The address is the identity; do not present this symbol to a human as a confirmed fact. | |
| dest_symbol | No | Optional display label for the destination token. Echoed back verbatim and NEVER verified against the contract — same rule as src_symbol: the address is the identity. | |
| slippage_bps | No | Max slippage in basis points, default 250 (= 2.5%) | |
| src_decimals | Yes | Decimals of the source token (e.g. USDC = 6) | |
| user_address | Yes | Wallet address that will sign the transactions (0x...) | |
| dest_decimals | Yes | Decimals of the destination token (e.g. WETH = 18) |