prepare-swap-transaction
Prepare unsigned token swap transactions on Osmosis by specifying pool ID, input token, and minimum output amount to ensure desired exchange rates.
Instructions
Prepares an unsigned transaction for token swap
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": {
"poolId": "<poolId>",
"sender": "<sender>",
"tokenIn": "<tokenIn>",
"tokenOutMinAmount": "<tokenOutMinAmount>"
},
"name": "prepare-swap-transaction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| poolId | Yes | The ID of the liquidity pool | |
| sender | Yes | The sender's Osmosis address | |
| tokenIn | Yes | ||
| tokenOutMinAmount | Yes | Minimum amount of output token to receive | |
| slippageTolerance | No | Slippage tolerance percentage (e.g., 0.01 for 1%) |