v1

latestOpenAPI 3.1.02026-07-24223580832.9 KB
dex

Get DEX Swap Price

Retrieves a swap quotation for a given token pair or a series of tokens along a specified path. By providing an input amount (amountIn), the endpoint calculates and returns the estimated output amounts for each token in the swap path. This allows users to accurately gauge current market pricing and estimate the value of potential swaps on a decentralized exchange, facilitating more informed trading decisions.

💡 Compute Unit Value: 70 (Fixed)

get/defi/v1/dex/price

Query parameters

dexId'1000' | '1001' | '1300' | '1301' | '1305' | '1306' | '1307' | '1308' | '1309' | '1310' | '1100' | '1101' | '1200' | '1201' | '2900' | '2901' | '2800' | '2808' | '2809' | '1500' | '1400' | '1402' | '2300' | '2100' | '2101' | '2500' | '2501' | '2700' | '2600' | '2400' | '2401' | '1600' | '1602' | '1604' | '1605' | '1607' | '1608' | '1700' | '1701' | '1702' | '1703' | '1704' | '1706' | '1707' | '2200' | '2201' | '2202' | '2203' | '2204' | '2205' | '2206' | '3000' | '3001' | '3100' | '3300' | '3301' | '3500' | '3501' | '3400' | '3401' | '3600' | '3800' | '3700'

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

Example:1000

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

pathstring required

Comma-separated values of token addresses whose price is to be fetched.

Example:0x514910771AF9Ca656af840dff83E8264EcF986CA,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

Comma-separated values of token addresses whose price is to be fetched.

amountInstring required

Amount of token.

Example:10000

Amount of token.

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

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.

poolFeesstring

Different pool based on the fees. By default, it will take the pool with maximum amountOut.

Example:3000

Different pool based on the fees. By default, it will take the pool with maximum amountOut.

slippagestring

Percentage of total swap value. By default, 1.

Example:10

Percentage of total swap value. By default, 1.

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": {
    "amountIn": "100000000000000000",
    "path": [
      "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
      "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
    ],
    "amountsOut": [
      "100000000000000000",
      "212386733"
    ],
    "prices": {
      "usd": [
        {
          "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1": "2125.29"
        },
        {
          "0xaf88d065e77c8cC2239327C5EDb3A432268e5831": "0.999664134155166"
        }
      ]
    },
    "priceImpact": {
      "percentage": "0.0214",
      "value": "0.045422"
    }
  }
}