Price a swap
get_swap_quotePrice a token swap before doing it: how much of output_token the user would receive for amount of input_token, plus price impact, fees, the slippage tolerance (slippage_bps) and the least the route can deliver (minimum_output_amount_ui). Quote output_amount_ui to the user — output_amount is in the token's smallest unit. pricing_basis states what produced it. This only prices the trade. It does not move funds and nothing is submitted on-chain. Returns a quote_id that execute_swap consumes. Quotes go stale in seconds — show the numbers to the user, get their answer, and if they hesitate, quote again rather than executing an old one. Always call this before execute_swap so the user sees what they are agreeing to. If execute_swap returns pending or fill_pending, only get_swap_status can tell you it completed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | How much of `input_token` to spend, in whole token units (not the smallest unit). | |
| network | No | solana | |
| input_token | Yes | Contract address of the token being SPENT. | |
| output_token | Yes | Contract address of the token being RECEIVED. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||