πRoute Finding
GET https://api.liqd.ag/v2/route
Calculates optimal swap routes across available liquidity. Returns token metadata, quoted amounts, and ready-to-use calldata for execution.
Parameters
Required Parameters
tokenIn
address
Contract address of the input token (0x format)
Yes
0x5555555555555555555555555555555555555555
tokenOut
address
Contract address of the output token (0x format)
Yes
0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb
amountIn
number
Amount of input token (human readable, e.g., 100 for 100 tokens)
Yes*
1000
amountOut
number
Desired output amount (human readable, for exact output swaps)
Yes*
50000
chainId
number
Chain to route on (999 = HyperEVM, 4663 = Robinhood Chain)
Yes
999
Note: Provide either amountIn OR amountOut, not both.
Optional Parameters
multiHop
boolean
Enable multi-hop routing through intermediate tokens
false
true
slippage
number
Slippage tolerance as percentage (0.1-5.0 recommended)
1.0
0.5
unwrapNative
boolean
Unwrap to native token (HYPE on HyperEVM, ETH on Robinhood Chain)
false
true
excludeDexes
string
Comma-separated routerIndex values to exclude from routing
none
1,3
includeDexes
string
Comma-separated routerIndex values to include only (overrides excludeDexes)
none
1,2
feeBps
number
Your fee in basis points (100 = 1%, max 100) β you keep 97.5% of this
0
50
feeRecipient
address
Wallet to receive fee payments and positive slippage
none
0xaC7d...
Resolve routerIndex values via GET /dexes?chainId=....
Example Requests
HyperEVM exact input:
Robinhood Chain exact input:
Multi-hop with custom slippage:
Exact output with native unwrapping:
Exclude specific sources:
Include only specific sources:
With revenue sharing (0.1% fee):
Response Fields
success
Whether a route was found
tokens.tokenIn / tokens.tokenOut
Token metadata: address, symbol, name, decimals
tokens.intermediates
Intermediate tokens for multi-hop routes (empty for direct swaps)
amountIn / amountOut
Human-readable amounts
averagePriceImpact
Overall price impact across the route
execution.to
RouterV2 address for this chain β send the transaction here
execution.calldata
Ready-to-use transaction data
execution.details.path
Token addresses in the swap path
execution.details.amountIn / amountOut
Amounts in base units
execution.details.minAmountOut
Minimum output after slippage (base units)
execution.details.hopSwaps
Per-hop routing breakdown (array of parallel swap arrays)
hopSwaps[][] fields
tokenIn / tokenOut
Token addresses for this leg
poolAddress
Pool used for this leg
routerIndex / routerName
Liquidity source β indexes from GET /dexes?chainId=...
fee
Pool fee (when applicable)
stable
Whether a stable pool is used (when applicable)
data
Opaque per-pool data blob (may be 0x)
amountIn / amountOut
Amounts for this leg in base units
priceImpact
Price impact for this leg
Last updated