swap build
swap_buildGet a ready-to-sign swap transaction at the best DEX route: to, data, value and gas for your wallet, the minimum output after slippage, and the exact-amount approve() to send first for tokens. Unsigned: you sign and send it yourself; we never hold funds. Costs $0.005 USDC per call (x402).
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": {
"from_token": "<from_token>",
"to_token": "<to_token>",
"amount": "<amount>",
"sender": "<sender>"
},
"name": "swap_build"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | base (default), ethereum, arbitrum, optimism, polygon | |
| amount | Yes | ||
| sender | Yes | Wallet that will sign | |
| to_token | Yes | ||
| recipient | No | ||
| from_token | Yes | ||
| slippage_percent | No | Default 0.5 |