Returns a swap/bridge quote for the given token pair without creating any transaction state. Supports both fromAmount and toAmount (mutually exclusive).
curl --request POST \
--url https://app.dynamicauth.com/api/v0/sdk/{environmentId}/swap/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": {
"address": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
"chainId": "An example name",
"chainName": "ETH",
"tokenAddress": "An example name",
"amount": "<string>"
},
"to": {
"address": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
"chainId": "An example name",
"chainName": "ETH",
"tokenAddress": "An example name",
"amount": "<string>"
},
"maxPriceImpact": 0.5,
"order": "CHEAPEST",
"slippage": 0.5
}
'{
"from": {
"address": "<string>",
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountMin": "<string>",
"amountUSD": "<string>"
},
"id": "<string>",
"steps": [
{
"from": {
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountMin": "<string>",
"amountUSD": "<string>"
},
"id": "<string>",
"to": {
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountMin": "<string>",
"amountUSD": "<string>"
},
"tool": "<string>",
"type": "<string>",
"feeCosts": [
{
"amount": "<string>",
"included": true,
"name": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountUSD": "<string>"
}
],
"gasCosts": [
{
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountUSD": "<string>"
}
]
}
],
"to": {
"address": "<string>",
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountMin": "<string>",
"amountUSD": "<string>"
},
"approvalAddress": "<string>",
"feeCosts": [
{
"amount": "<string>",
"included": true,
"name": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountUSD": "<string>"
}
],
"gasCostUSD": "<string>",
"signingPayload": {
"chainName": "ETH",
"chainId": "<string>",
"evmTransaction": {
"to": "<string>",
"data": "<string>",
"value": "<string>",
"gasLimit": "<string>",
"gasPrice": "<string>",
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"nonce": 123
},
"evmApproval": {
"tokenAddress": "<string>",
"spenderAddress": "<string>",
"amount": "<string>"
},
"serializedTransaction": {
"serializedTransaction": "<string>"
},
"psbtTransaction": {
"psbt": "<string>"
}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ID of the environment
36^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"95b11417-f18f-457f-8804-68e361f9164f"
Show child attributes
Show child attributes
The price impact threshold above which routes are hidden. As an example, one should specify 0.15 (15%) to hide routes with more than 15% price impact. The default is 10%.
0 <= x <= 1Route optimization preference.
CHEAPEST, FASTEST Slippage tolerance (e.g. 0.005 for 0.5%)
0 <= x <= 1Swap quote
Show child attributes
Show child attributes
Show child attributes
Address that needs token approval (spender), if applicable
Show child attributes
Chain-aware signing payload. Which fields are populated depends on chainName: EVM uses evmTransaction + optional evmApproval. SOL and SUI use serializedTransaction. BTC uses psbtTransaction.
Show child attributes
Was this page helpful?
curl --request POST \
--url https://app.dynamicauth.com/api/v0/sdk/{environmentId}/swap/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": {
"address": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
"chainId": "An example name",
"chainName": "ETH",
"tokenAddress": "An example name",
"amount": "<string>"
},
"to": {
"address": "0xbF394748301603f18d953C90F0b087CBEC0E1834",
"chainId": "An example name",
"chainName": "ETH",
"tokenAddress": "An example name",
"amount": "<string>"
},
"maxPriceImpact": 0.5,
"order": "CHEAPEST",
"slippage": 0.5
}
'{
"from": {
"address": "<string>",
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountMin": "<string>",
"amountUSD": "<string>"
},
"id": "<string>",
"steps": [
{
"from": {
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountMin": "<string>",
"amountUSD": "<string>"
},
"id": "<string>",
"to": {
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountMin": "<string>",
"amountUSD": "<string>"
},
"tool": "<string>",
"type": "<string>",
"feeCosts": [
{
"amount": "<string>",
"included": true,
"name": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountUSD": "<string>"
}
],
"gasCosts": [
{
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountUSD": "<string>"
}
]
}
],
"to": {
"address": "<string>",
"amount": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountMin": "<string>",
"amountUSD": "<string>"
},
"approvalAddress": "<string>",
"feeCosts": [
{
"amount": "<string>",
"included": true,
"name": "<string>",
"token": {
"address": "<string>",
"chainId": "<string>",
"decimals": 123,
"name": "<string>",
"symbol": "<string>",
"coinKey": "<string>",
"logoURI": "<string>",
"priceUSD": "<string>"
},
"amountUSD": "<string>"
}
],
"gasCostUSD": "<string>",
"signingPayload": {
"chainName": "ETH",
"chainId": "<string>",
"evmTransaction": {
"to": "<string>",
"data": "<string>",
"value": "<string>",
"gasLimit": "<string>",
"gasPrice": "<string>",
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"nonce": 123
},
"evmApproval": {
"tokenAddress": "<string>",
"spenderAddress": "<string>",
"amount": "<string>"
},
"serializedTransaction": {
"serializedTransaction": "<string>"
},
"psbtTransaction": {
"psbt": "<string>"
}
}
}