swapSolana · Solana Token Swap
may change things: you confirm before it runsExecute a Solana token swap using Jupiter aggregator. Returns a serialized transaction for the user to sign and execute. tokenIn and tokenOut must be different addresses. Next: sign the returned serialized transaction with the user's Solana wallet, then submit it to the Solana network.
Input schema
{
"type": "object",
"properties": {
"tokenIn": {
"type": "string",
"description": "Input token mint address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native token SOL)"
},
"tokenOut": {
"type": "string",
"description": "Output token mint address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native token SOL)"
},
"amount": {
"type": "string",
"description": "Amount to swap in decimal format (e.g., \"1.5\"). Must be a positive number. Use \"-1\" to swap entire balance (only with isExactIn=true)."
},
"isExactIn": {
"type": "boolean",
"description": "If true, swap exact input amount and receive variable output. If false, swap variable input to receive exact output amount. Default: true."
},
"slippage": {
"description": "Slippage tolerance percentage (e.g., \"0.5\" for 0.5%). Default: 0.5%. Maximum: 50%.",
"type": "string"
},
"userWallet": {
"type": "string",
"description": "The wallet address of the user's Solana wallet"
},
"minAmountOut": {
"description": "The minimum amount of the output token to receive",
"type": "string"
},
"maxAmountIn": {
"description": "The maximum amount of the input token to spend",
"type": "string"
}
},
"required": [
"tokenIn",
"tokenOut",
"amount",
"isExactIn",
"userWallet"
],
"additionalProperties": false
}