Skip to content

GET /route

GET https://router.intear.tech/route

Returns an array of quotes, one per DEX that found a route, best first. If no DEX found a route, the array is empty.

https://router.intear.tech/route?token_in=near&token_out=usdt.tether-token.near&amount_in=1000000000000000000000000&max_wait_ms=2000&slippage_type=Fixed&slippage=0.01&trader_account_id=alice.near&referrer_id=alice.near
Parameter Type Description
token_in token ID Token to swap from
token_out token ID Token to swap to. Must be different from token_in
amount_in or amount_out integer string Exact amount to pay, or exact amount to receive, in the token’s smallest unit. Pass exactly one. See Exact input and exact output
max_wait_ms integer How long to wait for slow DEXs, in milliseconds. At most 60000. 1000–2000 is plenty for the current DEXs
slippage_type Fixed | Auto See Slippage
slippage decimal With Fixed: slippage from 0 to 1. 0.01 is 1%
min_slippage, max_slippage decimal With Auto: the range to choose slippage from, each 0 to 1
Parameter Type Description
trader_account_id account ID The account that will sign the transactions. Lets the route include missing storage deposits and registrations. Strongly recommended
referrer_id account ID Your account, for referral tracking and fees
dexes comma-separated list Only use these DEXs, for example Rhea,RheaDcl,Plach. Defaults to all. Must not be empty. IDs are case-sensitive, see DEXs
signing_public_key public key Deprecated and ignored. Was used by NEAR Intents, which is no longer supported

200 OK with Content-Type: application/json, an array of quote objects:

[
{
"deadline": null,
"has_slippage": true,
"estimated_amount": { "amount_out": "4880007" },
"worst_case_amount": { "amount_out": "4831206" },
"dex_id": "RheaDcl",
"execution_instructions": [
{
"NearTransaction": {
"receiver_id": "usdt.tether-token.near",
"actions": [
{
"FunctionCall": {
"method_name": "storage_deposit",
"args": "eyJyZWdpc3RyYXRpb25fb25seSI6dHJ1ZX0=",
"gas": 10000000000000,
"deposit": "1250000000000000000000"
}
}
]
}
},
{
"NearTransaction": {
"receiver_id": "wrap.near",
"actions": [
{
"FunctionCall": {
"method_name": "near_deposit",
"args": "e30=",
"gas": 5000000000000,
"deposit": "1000000000000000000000000"
}
},
{
"FunctionCall": {
"method_name": "ft_transfer_call",
"args": "eyJyZWNlaXZlcl9pZCI6ImRjbHYyLnJlZi1sYWJzLm5lYXIiLC...",
"gas": 106814800000000,
"deposit": "1"
}
}
]
}
}
],
"needs_unwrap": false,
"token_output": "nep141:usdt.tether-token.near",
"estimated_max_gas_cost": "12521020071713600000000",
"estimated_gas_usage": "8231794617168100000000",
"storage_deposits": "1250000000000000000000",
"max_storage_deposits": "1250000000000000000000"
}
]

Errors are plain text, see Errors.

Each quote’s value is its output (for amount_in) or minus its input (for amount_out), minus its gas and storage costs converted to the quoted token at current prices. Quotes are sorted by that value, highest first. If prices for the tokens aren’t known, quotes are sorted by amount only.

Routing is deterministic: the same request against the same pool state always gives the same quotes.