execute_swap_transaction
Complete a token swap on Solana by signing and executing a transaction from a Jupiter quote, spending real funds irreversibly.
Instructions
🚨 WARNING: THIS WILL EXECUTE A REAL TRADE AND SPEND ACTUAL SOL! 🚨
Sign and execute a swap transaction via Jupiter Ultra API.
This is a PAID operation that executes real trades on the Solana blockchain. Only call this function when you want to actually execute a trade.
This method will:
Sign the provided unsigned transaction with your configured private key
Execute the signed transaction on the Solana blockchain
SPEND REAL SOL/TOKENS - THIS IS NOT REVERSIBLE!
Args: transaction: The base64 encoded UNSIGNED transaction from get_swap_quote request_id: The request ID from the swap quote response
Returns: Dictionary containing: - success: Boolean indicating if the execution was successful - data: Contains 'signature' and transaction details if successful - error: Error message if execution failed
Example: >>> # First get a quote >>> quote = await api.get_swap_quote(input_mint, output_mint, amount) >>> if quote["success"]: ... # Then execute the trade ... result = await api.execute_swap_transaction( ... transaction=quote["data"]["transaction"], ... request_id=quote["data"]["requestId"] ... ) ... if result["success"]: ... print(f"Trade executed! Signature: {result['data']['signature']}")
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": {
"transaction": "<transaction>",
"request_id": "<request_id>"
},
"name": "execute_swap_transaction"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request_id | Yes | ||
| transaction | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||