swap
Exchange tokens through a DEX aggregator with built-in fee. Non-custodial, using your private key.
Instructions
Swap tokens via a DEX aggregator with our built-in fee; non-custodial.
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": {
"private_key": "<private_key>",
"sell_token": "<sell_token>",
"buy_token": "<buy_token>",
"sell_amount": "<sell_amount>",
"nonce": "<nonce>",
"max_fee_per_gas": "<max_fee_per_gas>",
"max_priority_fee_per_gas": "<max_priority_fee_per_gas>"
},
"name": "swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gas | No | Gas limit. | |
| chain | No | Which chain family to act on. | evm |
| nonce | Yes | Account nonce for this transaction. | |
| chain_id | No | EVM chain id (137 = Polygon). | |
| buy_token | Yes | Token address to buy. | |
| sell_token | Yes | Token address to sell. | |
| private_key | Yes | The caller's own private key. Used transiently to sign; never stored (non-custodial). | |
| sell_amount | Yes | Amount of sell_token (base units). | |
| fee_recipient | No | Optional address to receive the integrator fee. | |
| max_fee_per_gas | Yes | EIP-1559 max fee per gas (wei). | |
| max_priority_fee_per_gas | Yes | EIP-1559 priority fee per gas (wei). |