build_swap
Construct an unsigned Solana swap transaction for buying or selling tokens. Provide wallet, token, action, amount (lamports for buy) or percentage (bps for sell), and slippage. Outputs a base58-encoded transaction ready for signing.
Instructions
Build an unsigned Solana swap tx via REST. Returns base58 swap_tx. Pass to submit_signed_swap or use auto_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": {
"wallet_address": "<wallet_address>",
"token_address": "<token_address>",
"action": "<action>"
},
"name": "build_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_address | Yes | ||
| token_address | Yes | ||
| action | Yes | ||
| amount | No | Lamports (buy only) | |
| holdings_percentage | No | Bps (sell only, 10000=100%) | |
| slippage | No |