Get quote for a swap
Get a quote to swap between Native Coin - ERC20 - Avax ERC20
Query Parameters |
---|
sellAsset string — REQUIREDAsset to sell. (e.g. ETH.UNI-0x1f9840a85d5af5bf1d1762f925bdaddc4201f984) |
buyAsset string — REQUIREDAsset to buy. (e.g. BTC.BTC) |
sellAmount number — REQUIREDAmount of sellAsset to sell in assetAmount. (e.g. 100 for 100 UNI) |
slippage numberSlippage tolerance as a percentage. (e.g. 3 means 3% max slippage) |
limit numberThe maximum number of trades routes to return. (e.g. 5) |
senderAddress stringThe senderAddress to be used to build calldata. (e.g. 0x2A1Af1d52641b9B595dbafFe36452d325E6cA103) |
recipientAddress stringThe recipientAddress may be used to build the tcMemo. If you don't provide a recipientAddress, your calldata may be invalid and you may need to replace {recipientAddress} in the memo field. (e.g. 0x2A1Af1d52641b9B595dbafFe36452d325E6cA103) |
providers string[]Possible values: [ Restrict liquidity sources. THORCHAIN provider must be set for cross-chain quotes |
subProviders string[]Restrict sources of the providers. |
preferredProvider stringPossible values: [ Optionally specify the provider the swap should use. |
affiliateAddress stringThe affiliate thorname to receive the affiliate fee. Must be 10 chars or less, the shorter the better. (e.g. partner1) |
affiliateBasisPoints stringBasis point to take from the trade (e.g. 50 for 0.5%) |
isAffiliateFeeFlat booleanIf set to true, the API will adjust the memo so that the total affiliate fees, including smart contract, are as close as possible to the provided affiliateBasisPoints |
allowSmartContractRecipient booleanIf set to true, we will not perform any safety checks on the recipient address on an EVM chain. This is risky, and funds will likely be lost. For more information https://docs.thorswap.net/aggregation-api/pathfinder#smart-contract-addresses |
Responses | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 A complete quote response with calldata
| |||||||||||||||||||||||||||
400 Error
| |||||||||||||||||||||||||||
500 Error
|