dex

Get DEX Swap Quotes

Retrieves a comprehensive list of swap quotations from multiple DEXs for a specified token pair pool. By aggregating swap quotes across various DEXs, it enables users to compare rates and identify the most favorable trading option. The response includes detailed information such as the DEX name and identifier, the input amount, the swap path, and the resulting output amounts from each DEX, making it a valuable tool for pricing data and swap execution decisions.

💡 Compute Unit Value: 100 (Fixed)

get/defi/v1/dex/quotes

Request

  • Base URL
    https://svc.blockdaemon.com
  • URL
    https://svc.blockdaemon.com/defi/v1/dex/quotes
  • Auth
    API key in header X-API-Key

Query parameters

chainId'1' | '43114' | '56' | '137' | '42161' | '10' | '8453' | '324' | '5000' | '900' | '1400' | '1200' | '101' | '1700' | '1500' | '1100' | '1600' | '8217'

The unique ID to direct queries or transactions to the correct blockchain. Find more here.

Example:1
pathstring required

Ordered sequence of token contract addresses defining the swap route, provided as a comma-separated string. For a direct swap from token A to B: 'tokenInAddress,tokenOutAddress'. Example (WETH→USDC on Ethereum): '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'.

Example:0x514910771AF9Ca656af840dff83E8264EcF986CA,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
amountInstring required

Amount of the input token to provide, specified in the token's smallest denomination (base units). Do not send human-readable decimal values. Examples: to swap 1 WETH (18 decimals), use "1000000000000000000"; to swap 1 USDC (6 decimals), use "1000000".

Example:1000000000000000000
chainSymbolstring

The abbreviated chain name for queries or transactions.

Example:ETH
excludedDexesstring

Comma-separated list of DEX protocol IDs (dexId values) to exclude from routing. Find available IDs via the /support endpoint.

Example:1700
poolFeesstring

Fee tier of the target liquidity pool in basis points (1 bp = 0.01%). Common values for Uniswap V3-style AMMs: 100 (0.01%), 500 (0.05%), 3000 (0.3%), 10000 (1%). If omitted, the pool yielding the highest output amount is selected automatically.

Example:3000
vsCurrenciesstring

A comma-separated list of currency symbols to convert the amount into, such as 'USD,EUR'. This parameter is optional and allows retrieving values in multiple fiat currencies.

Example:usd,eur,gbp
maxPriceImpactstring

Maximum acceptable price impact as a percentage (e.g., '0.01' means 0.01% price impact). Quotes that would cause a price impact exceeding this value are excluded from results.

Example:0.01

Response

Successful response

statusnumber

Numeric status code indicating success or failure of the API call

msgstring

Human-readable message describing the API result or error

Example response

{
  "status": 200,
  "msg": "success",
  "data": [
    {
      "dexId": "2200",
      "dexName": "Kyberswap",
      "amountIn": "1000000000000000000",
      "path": [
        "0x514910771AF9Ca656af840dff83E8264EcF986CA",
        "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      ],
      "amountsOut": [
        "1000000000000000000",
        "9044988"
      ],
      "prices": {
        "usd": [
          {
            "0x514910771AF9Ca656af840dff83E8264EcF986CA": "9.075482776456836"
          },
          {
            "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": "0.9998156269527559"
          }
        ]
      },
      "priceImpact": {
        "percentage": "0.0000",
        "value": "0.000000"
      }
    },
    {
      "dexId": "1300",
      "dexName": "UniswapV3",
      "amountIn": "1000000000000000000",
      "path": [
        "0x514910771AF9Ca656af840dff83E8264EcF986CA",
        "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      ],
      "amountsOut": [
        "1000000000000000000",
        "9044309"
      ],
      "prices": {
        "usd": [
          {
            "0x514910771AF9Ca656af840dff83E8264EcF986CA": "9.075482776456836"
          },
          {
            "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": "0.9998156269527559"
          }
        ]
      },
      "priceImpact": {
        "percentage": "0.3007",
        "value": "0.027282"
      }
    },
    {
      "bridgeId": "600",
      "bridgeName": "SquidRouterV2",
      "srcChainId": "1",
      "dstChainId": "1",
      "srcTokenSymbol": "LINK",
      "dstTokenSymbol": "USDC",
      "srcTokenAddress": "0x514910771AF9Ca656af840dff83E8264EcF986CA",
      "dstTokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "amountIn": "1000000000000000000",
      "amountsOut": [
        "1000000000000000000",
        "9044309"
      ],
      "prices": {
        "usd": [
          {
            "0x514910771AF9Ca656af840dff83E8264EcF986CA": "9.075482776456836"
          },
          {
            "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": "0.9998156269527559"
          }
        ]
      },
      "priceImpact": {
        "percentage": "0.3619",
        "value": "0.032847"
      }
    },
    {
      "dexId": "1400",
      "dexName": "BalancerV2",
      "amountIn": "1000000000000000000",
      "path": [
        "0x514910771AF9Ca656af840dff83E8264EcF986CA",
        "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      ],
      "amountsOut": [
        "1000000000000000000",
        "9033226"
      ],
      "prices": {
        "usd": [
          {
            "0x514910771AF9Ca656af840dff83E8264EcF986CA": "9.075482776456836"
          },
          {
            "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": "0.9998156269527559"
          }
        ]
      },
      "priceImpact": {
        "percentage": "0.4840",
        "value": "0.043930"
      }
    },
    {
      "dexId": "1600",
      "dexName": "0x",
      "amountIn": "1000000000000000000",
      "path": [
        "0x514910771AF9Ca656af840dff83E8264EcF986CA",
        "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      ],
      "amountsOut": [
        "1000000000000000000",
        "9025485"
      ],
      "prices": {
        "usd": [
          {
            "0x514910771AF9Ca656af840dff83E8264EcF986CA": "9.075482776456836"
          },
          {
            "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": "0.9998156269527559"
          }
        ]
      },
      "priceImpact": {
        "percentage": "0.1500",
        "value": "0.013559"
      }
    },
    {
      "dexId": "1000",
      "dexName": "UniswapV2",
      "amountIn": "1000000000000000000",
      "path": [
        "0x514910771AF9Ca656af840dff83E8264EcF986CA",
        "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      ],
      "amountsOut": [
        "1000000000000000000",
        "8787450"
      ],
      "prices": {
        "usd": [
          {
            "0x514910771AF9Ca656af840dff83E8264EcF986CA": "9.075482776456836"
          },
          {
            "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": "0.9998156269527559"
          }
        ]
      },
      "priceImpact": {
        "percentage": "3.0504",
        "value": "0.276486"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.