DeDust Hub

Find the best quote to swap

POST
/router/quote

Provides the best quote for swapping between two assets, given the input parameters such as amount, slippage, swap mode, etc.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://mainnet.api.dedust.io/v4/router/quote" \  -H "Content-Type: application/json" \  -d '{    "in_minter": "native",    "out_minter": "EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE",    "amount": "100000000000",    "swap_mode": "exact_in",    "slippage_bps": 100,    "max_splits": 4,    "max_length": 3  }'
{
  "in_amount": "string",
  "out_amount": "string",
  "swap_data": {
    "slippage_bps": 0,
    "routes": [
      [
        {
          "pool_address": "string",
          "is_stable": true,
          "in_minter": "string",
          "out_minter": "string",
          "in_amount": "string",
          "out_amount": "string",
          "network_fee": "string",
          "protocol_slug": "string",
          "stonfi_extra_details": {
            "router": "string",
            "from_router_wallet": "string",
            "to_router_wallet": "string"
          },
          "tonco_extra_details": {
            "from_router_wallet": "string",
            "to_router_wallet": "string",
            "zero_to_one": true
          }
        }
      ]
    ]
  },
  "display_data": [
    {
      "in_percent": 0,
      "network_fee": "string",
      "steps": [
        {
          "pool_address": "string",
          "in_minter": {
            "address": "string",
            "name": "string",
            "symbol": "string",
            "description": "string",
            "image": "string",
            "decimals": 0,
            "aliased": true,
            "included": true,
            "protocol": "string"
          },
          "out_minter": {
            "address": "string",
            "name": "string",
            "symbol": "string",
            "description": "string",
            "image": "string",
            "decimals": 0,
            "aliased": true,
            "included": true,
            "protocol": "string"
          },
          "in_amount": "string",
          "out_amount": "string",
          "network_fee": "string",
          "protocol": {
            "name": "string",
            "slug": "string",
            "image": "string",
            "website": "string"
          },
          "volatility_1m": 0,
          "volatility_5m": 0,
          "volatility_10m": 0,
          "volatility_15m": 0
        }
      ]
    }
  ],
  "improvement": "string",
  "in_minter_price": "string",
  "out_minter_price": "string",
  "price_impact": 0,
  "swap_is_possible": true
}
Empty
Empty