dex

Get Route

Returns detailed routing information for a token swap between a specified token pair. It provides a breakdown of the swap path, including each liquidity source involved, the corresponding swap details such as input/output amounts, and any associated fees, enabling users to assess and choose the optimal route for their trade.

💡 Compute Unit Value: 30 (Fixed)

get/defi/v1/dex/getroute

Request

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

Query parameters

dexId'2600'

The unique ID to specify the decentralized exchange (DEX) within a particular blockchain. Find more here.

Example:2600
pathstring required

Array of token contract addresses for the source and destination tokens. Provide [srcTokenAddress, dstTokenAddress].

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
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

Response

Successful response

statusinteger
msgstring
dataobject

Example response

{
  "status": 200,
  "msg": "success",
  "data": [
    {
      "swapInfo": {
        "ammKey": "5osJp3xhaP1W16n5NNyNg3my6QwTsfWmnbVZtk5o5fZK",
        "label": "OpenBook V2",
        "inputMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
        "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "inAmount": "21000000000000",
        "outAmount": "5372541897",
        "feeAmount": "0",
        "feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      },
      "percent": 21,
      "bps": 2100,
      "prices": {
        "usd": [
          {
            "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": "0.000025568997516527"
          },
          {
            "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": "0.9998033965484395"
          }
        ]
      }
    },
    {
      "swapInfo": {
        "ammKey": "8B8KYcFPMjZyDtJ1BENsqhW3fEmMrB4ekoEQJiM6z3SC",
        "label": "TesseraV",
        "inputMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
        "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "inAmount": "33000000000000",
        "outAmount": "8443880122",
        "feeAmount": "0",
        "feeMint": "11111111111111111111111111111111"
      },
      "percent": 33,
      "bps": 3300,
      "prices": {
        "usd": [
          {
            "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": "0.000025568997516527"
          },
          {
            "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": "0.9998033965484395"
          }
        ]
      }
    },
    {
      "swapInfo": {
        "ammKey": "B2e5QH2GDkRg6hj3y34GCUURBMGskPfX5RAAXe8RBRjS",
        "label": "SolFi",
        "inputMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
        "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "inAmount": "46000000000000",
        "outAmount": "11770923278",
        "feeAmount": "0",
        "feeMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"
      },
      "percent": 46,
      "bps": 4600,
      "prices": {
        "usd": [
          {
            "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263": "0.000025568997516527"
          },
          {
            "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": "0.9998033965484395"
          }
        ]
      }
    },
    {
      "swapInfo": {
        "ammKey": "5WGYajM1xtLy3QrLHGSX4YPwsso3jrjEsbU1VivUErzk",
        "label": "Raydium",
        "inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "outputMint": "HhJpBhRRn4g56VsyLuT8DL5Bv31HkXqsrahTTUCZeZg4",
        "inAmount": "25587345297",
        "outAmount": "1275002926852046",
        "feeAmount": "29427308",
        "feeMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
      },
      "percent": 100,
      "bps": 10000,
      "prices": {
        "usd": [
          {
            "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": "0.9998033965484395"
          },
          {
            "HhJpBhRRn4g56VsyLuT8DL5Bv31HkXqsrahTTUCZeZg4": "0.019382660424964133"
          }
        ]
      }
    }
  ]
}

Changes

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