/quote - Understanding the response
Response structure
The response lists the available providers for the route, limited by the list used to quote it. If the parameter was not included the response lists all possible providers. Estimated output, expected slippage and estimated time are some of the information listed for each swap provider so you can choose the best routes. Additionally, SwapKit provides tags to aid you in the process and identify what we would consider ourselves.
quoteId
quoteId
A unique identifier for the quote request. You can optionally store it to reference the quote provided by SwapKit at a later date.
routes
Object
routes
ObjectThe routes
array contains possible swap options, each identified by the providers
object at the start.
providers
array
List of providers available for this route (CHAINFLIP
, THORHCAIN
etc.).
sellAsset
string
The asset being sold (e.g., "ETH.ETH"
).
buyAsset
string
The asset being bought (e.g., "BTC.BTC"
).
sellAmount
string
Amount of the sell asset in smallest units.
expectedBuyAmount
string
Estimated amount of the buy asset to be received.
expectedBuyAmountMaxSlippage
string
Worst-case buy amount considering max slippage.
sourceAddress
string
Source address.
destinationAddress
string
Destination address.
targetAdddress
string
Address to send the initial transaction to.
memo
string
Transaction memo, which can be used in UTXO chains directly.
fees
array
List of fees applied to the swap (inbound, network, affiliate).
tx
array
estimatedTime
object
Estimated time for different phases of the swap.
totalSlippageBps
number
Expected total slippage.
legs
array
The different involved steps in the swap.
warnings
array
Potential warnings about this swap provider.
meta
array
Other information about the transaction.
The
tx
object is only provided if the"includeTx":true
parameter was included. It can be used as the transaction data for EVM chains.For UTXO chains, the
memo
provided can be directly used.targetAddress
is the address to send the transaction to, but Chainflip transactions need to use a deposit channel instead.
It is necessary to approve targetAddress
as an spender if you are trading tokens on an EVM chain.
Example routes
Object:
routes
Object:Fees breakdown
Fees are categorized into different types based on their role in the swap process.
Inbound
Fee for transferring the sell asset, paid from the user wallet.
Network
Blockchain transaction fee for processing the swap.
Affiliate
Fee paid to the specified affiliate.
Outbound
Fee for transferring the buy asset to the destination address.
Liquidity
Fee applied by the liquidity provider to facilitate the swap.
Only the inbound fee will be paid from the source wallet. The other fees are deducted from the output, and the output values provided by the endpoint already take this into consideration.
Transaction details
Transaction details are only included if the option "includeTx": true
was used in the /quote
request. It provides an object valid to initiate a transaction in the source chain. These objects can be used so sing and send the transaction using the main libraries for each blockchain.
Estimated time
The estimated time in seconds for the swap is divided into the following phases:
Inbound: Time taken to receive the sell asset.
Swap: Time taken for the swap process.
Outbound: Time taken to transfer the bought asset to the destination. This includes the provider outbound time, not only the transaction time.
Total: The sum of all time estimates.
Example estimated time:
Transaction metadata
The meta
section provides additional information about the swap.
priceImpact
The expected impact on market rates.
affiliate - affiliateFee
Details of affiliate commissions.
tags
["FASTEST", "RECOMMENDED", "CHEAPEST"]
approvalAddress
The contract address for ERC-20 approvals.
chainflip
Information necessary to open a deposit channel for the Chainflip providers.
Example meta
Object:
meta
Object:The "tags"
can help recognize what SwapKit considers the best routes by filtering through the ["FASTEST", "RECOMMENDED", "CHEAPEST"]
identification.
RECOMMENDED
Best overall route based on output and speed.
CHEAPEST
The route with the maximum output.
FASTEST
The route with the shortest total estimated time.
Additionally the "chainflip"
object is added for CHAINFLIP
and CHAINFLIP_STREAMING
swaps. This is used to open a deposit channel, a necessary step to initiate a trade.
Warnings
Warnings highlight potential issues such as high price impact or insufficient liquidity.
Example warning:
Provider errors
If certain providers cannot facilitate the swap, the response may include error messages under providerErrors
.
Example provider error:
Last updated