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.
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 |