v3

latestOpenAPI 3.0.32026-07-21128192192.7 KB
Routing

Returns the best route for the given trade pair using smart settings

post/v1/route/smart

Request body

input_amountnumber double

Input amount in tokens (not nano!) to be swapped

output_amountnumber double

If specified, the route will be built to get the specified output amount. If not specified, the route will be built to get the maximum output amount for the given input amount.

max_splitsinteger

Defines the maximum number of independent paths (i.e., transactions) the route can split into. For v4 wallets, you can omit this or set it to 4; for v5 wallets, you can set it to 20 (this is our internal upper limit, and we may reduce it later to something like 10).

Example request

{
  "input_token": {
    "blockchain": "ton",
    "address": "native"
  },
  "output_token": {
    "blockchain": "ton",
    "address": "native"
  },
  "additional_data": {
    "sender_address": "UQCNTO0Nh0Z7QNyRW1BLWfk08f2dAOw4izrx9sO6OUPg4DoV",
    "referral_name": "tonkeeper"
  }
}

Response

resulting route

input_amountnumber double required
output_amountnumber double required
input_usdnumber double required
output_usdnumber double required
savingsnumber double
left_amountnumber double
recommended_gasnumber double required
price_impactnumber double required
estimated_cashback_usdnumber double
partner_commission_tonnumber double
mev_protection_feenumber double

Fees for the usage of MEV protection.