Quote a swap
quote_swapAsk what a swap would give, in either direction: pass amount_from to learn what the user receives, or amount_to to learn what the user must send. Returns the rate, the pair minimum and maximum, who would execute the order, and the warnings to relay. With rate_type "fixed" it also returns the rate_id that create_swap needs to lock that rate for about ten minutes; a fixed rate is only offered for part of the catalogue and the tool says so rather than quietly falling back to a float rate. Nothing is created and no funds move.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Asset the user receives, canonical id, for example "usdt.trx". | |
| from | Yes | Asset the user sends, canonical id, for example "btc.btc". | |
| amount_to | No | Amount the user wants to receive, as a decimal string. The answer then says how much to send. | |
| rate_type | No | float: the rate is settled when the deposit arrives. fixed: the rate is guaranteed for about ten minutes and returns a rate_id that create_swap needs, usually at a slightly worse rate. Ask for fixed whenever the user wants a guaranteed number; if this pair cannot hold one the answer says so instead of quietly returning a float rate. | float |
| promo_code | No | Promo code to apply, if the user has one. | |
| amount_from | No | Amount the user sends, as a decimal string. Pass this or amount_to, never both. | |
| include_providers | No | Add the raw per-provider breakdown. Off by default because the summary answers the user. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| from | Yes | ||
| rate | Yes | ||
| rate_id | Yes | ||
| to_name | Yes | ||
| provider | Yes | ||
| quote_id | Yes | ||
| warnings | Yes | ||
| amount_to | Yes | ||
| from_name | Yes | ||
| limits_in | Yes | ||
| providers | No | ||
| rate_type | Yes | ||
| max_amount | Yes | ||
| min_amount | Yes | ||
| amount_from | Yes | ||
| valid_until | Yes | ||
| high_network_fee | Yes | ||
| speed_forecast_minutes | Yes |