DoritoKit API
/quote - Understanding the response
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, dKit provides tags to aid you in the process and identify what we would consider ourselves.
quoteId
A unique identifier for the quote request. You can optionally store it to reference the quote provided by DoritoKit at a later date.
routes
Object
The routes
array contains possible swap options, each identified by the providers
object at the start.
Field | Type | Description |
---|---|---|
|
| List of providers available for this route ( |
|
| The asset being sold (e.g., |
|
| The asset being bought (e.g., |
|
| Amount of the sell asset in smallest units. |
|
| Estimated amount of the buy asset to be received. |
|
| Worst-case buy amount considering max slippage. |
|
| Source address. |
|
| Destination address. |
|
| Address to send the initial transaction to. |
|
| Transaction memo, which can be used in UTXO chains directly. |
|
| List of fees applied to the swap (inbound, network, affiliate). |
|
| Transaction object for EVM chains, a PSBT object for BTC etc. |
|
| Estimated time for different phases of the swap. |
|
| Expected total slippage. |
|
| The different involved steps in the swap. |
|
| Potential warnings about this swap provider. |
|
| 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:
Fees breakdown
Fees are categorized into different types based on their role in the swap process.
Fee Type | Description |
---|---|
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:
The "tags"
can help recognize what dKit considers the best routes by filtering through the ["FASTEST", "RECOMMENDED", "CHEAPEST"]
identification.
Tag | Description |
---|---|
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 (coming soon)
Warnings highlight potential issues such as high price impact or insufficient liquidity.
Example warning:
Provider errors (coming soon)
If certain providers cannot facilitate the swap, the response may include error messages under providerErrors
.
Example provider error:
Join our Community
Any other questions? Book a Call