Build Best Path
Builds executable calldata for the best-ranked route directly from quote inputs.
Query Parameters
Source chain ID for the input token. Required. Use the numeric chain ID configured in xPath for the chain that holds fromToken.
int640 <= valueDestination chain ID for the output token. Required. Use the numeric chain ID configured in xPath for the chain that holds toToken.
int640 <= valueInput token identifier on fromChain. Required. Pass the chain-specific token address or mint address exactly as xPath stores it.
Output token identifier on toChain. Required. Pass the chain-specific token address or mint address exactly as xPath stores it.
Input amount to evaluate, encoded as a base-10 integer string in the token's smallest unit.
Wallet address that will fund the route and receive any route-specific approvals or calldata bindings.
Maximum slippage tolerance for the returned route, expressed as a percentage. Example: 1 means 1%.
doubleIntegrator fee in basis points, where 100 = 1%. Optional. Must be a non-negative integer.
int320 <= valueRestricts planning to the listed provider keys. Optional. Accepts repeated values or a comma-separated list.
Excludes the listed provider keys from route planning. Optional. Accepts repeated values or a comma-separated list.
Preferred provider hint for route planning. Optional. Use a provider key to bias route selection toward a specific integration.
Route ranking strategy. Optional. Use values such as fastest, max_value, or suggested to influence route ordering.
Integrator identifier associated with the request. Optional. xPath can echo this identifier in downstream route metadata.
Referrer identifier for partner attribution. Optional.
Optional destination-chain calldata to associate with the generated route when the downstream integration supports it.
Optional destination-chain gas limit hint, encoded as a string integer.
Maximum acceptable price impact for route selection. Optional. Expressed as a percentage value.
doubleEnables multi-bridge route candidates during planning. Optional. If true, xPath may return routes that use more than one bridge hop.
Input token acquisition mode. Optional. Typical values are 0 for direct transfer, 1 for native token, and Permit2-based modes for signed execution flows.
int320 <= valueOptional minimum acceptable output amount, encoded as a base-10 integer string in the output token's smallest unit.
If true, includes detailed route composition data in the response payload when available.
If true, requests simulation-aware planning metadata when supported by the route builder.
Header Parameters
Required API key used for authenticated access and account-based rate limits. Missing or invalid keys return 401.
Response Body
application/json
curl -X GET "https://api.xpath.rath.fi/build-best-path?fromChain=0&toChain=0&fromToken=string&toToken=string&amount=string&sender=string" \ -H "api-key: YOUR_API_KEY"{
"code": 0,
"data": {
"Tx": {
"allowanceTarget": "string",
"chain": 0,
"data": "string",
"expiry": 0,
"gasLimit": "string",
"simulation": true,
"to": "string"
},
"route": {}
},
"message": "string"
}