transaction_same_chain_swap
Swap tokens on the same blockchain by specifying input token, amount, output token, recipient, and slippage tolerance. Optionally set affiliate fee and priority level to control trade execution.
Instructions
Create a same-chain token swap transaction via deBridge
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": {
"chainId": "<chainId>",
"tokenIn": "<tokenIn>",
"tokenInAmount": "<tokenInAmount>",
"tokenOut": "<tokenOut>",
"tokenOutRecipient": "<tokenOutRecipient>"
},
"name": "transaction_same_chain_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | Yes | Chain ID (native or deBridge internal) | |
| tokenIn | Yes | Input token address | |
| tokenInAmount | Yes | Amount in smallest units | |
| tokenOut | Yes | Output token address | |
| tokenOutRecipient | Yes | Address on the source chain to receive target tokens | |
| slippage | No | Slippage tolerance or 'auto' | |
| tokenOutAmount | No | Expected output amount or 'auto' | |
| affiliateFeePercent | No | Affiliate fee percentage | |
| affiliateFeeRecipient | No | Wallet address to receive affiliate fees | |
| senderAddress | No | Transaction submitter address | |
| srcChainPriorityLevel | No | Priority level: 'normal' or 'aggressive' (default: 'normal') |