Get a token swap quote
get_swap_quoteNo version argument: token swaps are protocol-agnostic and run on the v4 backend, so the chains and tokens they cover are that backend's and not every chain Aave holds a market on - a chain it does not serve is rejected outright rather than quoted badly. Call get_swappable_tokens first if you do not already know the chain is covered, or read 'canSwapFrom' on the reserve from get_markets. Quote a token swap: returns the quote with a quoteId to prepare and sign through prepare_order.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buy | Yes | Token to buy: 'native' for the chain's gas token, or an ERC-20 address (0x...). | |
| kind | No | sell = spend an exact sell amount; buy = receive an exact buy amount. Default sell. | |
| sell | Yes | Token to sell: 'native' for the chain's gas token, or an ERC-20 address (0x...). | |
| user | Yes | Wallet address (0x, 40 hex) of the wallet that will sign the swap - the one the user named in this session. If no wallet has been named, ask for it; never substitute a placeholder, which is rejected. | |
| amount | Yes | Amount in main units (of the sell token for kind=sell, the buy token for kind=buy). | |
| chainId | Yes | Chain id (positive integer). | |
| slippagePct | No | Optional max slippage as a percent string, e.g. '0.5' for 0.5%. Omit to accept the backend's suggestion, which moves with market conditions - set this to cap it. |