factor_swap_openocean
Swap tokens through the OpenOcean DEX aggregator from a Factor vault, automatically fetching a swap route and accepting exact, percentage, or full-balance amounts.
Instructions
Swap tokens through OpenOcean DEX aggregator via a Factor vault. Works on all chains including Base. Automatically fetches the best swap route from OpenOcean. Supports "all" to swap entire vault balance, percentage amounts like "50%", or exact amounts in base units (wei).
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": {
"vaultAddress": "<vaultAddress>",
"tokenIn": "<tokenIn>",
"tokenOut": "<tokenOut>",
"amount": "<amount>"
},
"name": "factor_swap_openocean"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount in base units (wei), or "all" to swap entire vault balance, or "50%" for percentage | |
| tokenIn | Yes | Address of the input token | |
| password | No | Wallet password if encrypted | |
| slippage | No | Slippage tolerance as a percentage (e.g., 1 for 1%). Default: 1 | |
| tokenOut | Yes | Address of the output token | |
| vaultAddress | Yes | The vault contract address |