POST
/
v1
/
route
curl --request POST \
  --url https://backend.swap.coffee/v1/route \
  --header 'Content-Type: application/json' \
  --data '{
  "input_token": {
    "blockchain": "ton",
    "address": "native"
  },
  "output_token": {
    "blockchain": "ton",
    "address": "native"
  },
  "input_amount": 1,
  "output_amount": 1,
  "max_splits": 4,
  "max_length": 3,
  "pool_selector": {
    "blockchains": [
      "ton"
    ],
    "dexes": [
      "dedust"
    ],
    "max_volatility": 1
  },
  "mev_protection": true,
  "additional_data": {
    "sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
    "referral_name": "tonkeeper"
  }
}'
{
  "input_token": {
    "address": {
      "blockchain": "ton",
      "address": "native"
    },
    "metadata": {
      "name": "ARBUZ",
      "symbol": "ARBUZ",
      "decimals": 123,
      "image_url": "<string>",
      "listed": true
    }
  },
  "output_token": {
    "address": {
      "blockchain": "ton",
      "address": "native"
    },
    "metadata": {
      "name": "ARBUZ",
      "symbol": "ARBUZ",
      "decimals": 123,
      "image_url": "<string>",
      "listed": true
    }
  },
  "input_amount": 123,
  "output_amount": 123,
  "input_usd": 123,
  "output_usd": 123,
  "savings": 123,
  "left_amount": 123,
  "recommended_gas": 123,
  "price_impact": 123,
  "estimated_cashback_usd": 123,
  "partner_commission_ton": 123,
  "mev_protection_fee": 123,
  "paths": [
    {
      "blockchain": "ton",
      "dex": "stonfi",
      "pool_address": "<string>",
      "input_token": {
        "address": {
          "blockchain": "ton",
          "address": "native"
        },
        "metadata": {
          "name": "ARBUZ",
          "symbol": "ARBUZ",
          "decimals": 123,
          "image_url": "<string>",
          "listed": true
        }
      },
      "output_token": {
        "address": {
          "blockchain": "ton",
          "address": "native"
        },
        "metadata": {
          "name": "ARBUZ",
          "symbol": "ARBUZ",
          "decimals": 123,
          "image_url": "<string>",
          "listed": true
        }
      },
      "swap": {
        "result": "fully_fulfilled",
        "input_amount": 123,
        "output_amount": 123,
        "before_reserves": [
          123
        ],
        "after_reserves": [
          123
        ],
        "reason": "<string>",
        "left_amount": 123
      },
      "recommended_gas": 123,
      "average_gas": 123,
      "next": [
        {}
      ]
    }
  ]
}

Authorizations

X-Api-Key
string
header
required

Body

application/json

Response

200
application/json

resulting route

The response is of type object.